Added getActiveSubInfoCount

Added getActiveSubInfoCount and migrated more modules
to use SubscrtipionManagerService.

Test: atest FrameworksTelephonyTests
Bug: 239607619
Change-Id: Ie5c929fa7efe24d85385b6939a204d90d76d6b34
This commit is contained in:
Jack Yu
2022-12-03 01:24:28 -08:00
parent 7089c96209
commit 85f02b264e

View File

@@ -1766,8 +1766,7 @@ public class SubscriptionManager {
* *
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* or that the calling app has carrier privileges (see * or that the calling app has carrier privileges (see
* {@link TelephonyManager#hasCarrierPrivileges}). In the latter case, only records accessible * {@link TelephonyManager#hasCarrierPrivileges}).
* to the calling app are returned.
* *
* @return Sorted list of the currently {@link SubscriptionInfo} records available on the device. * @return Sorted list of the currently {@link SubscriptionInfo} records available on the device.
* <ul> * <ul>
@@ -1785,7 +1784,6 @@ public class SubscriptionManager {
* </li> * </li>
* </ul> * </ul>
*/ */
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public List<SubscriptionInfo> getActiveSubscriptionInfoList() { public List<SubscriptionInfo> getActiveSubscriptionInfoList() {
return getActiveSubscriptionInfoList(/* userVisibleonly */true); return getActiveSubscriptionInfoList(/* userVisibleonly */true);
@@ -1989,17 +1987,12 @@ public class SubscriptionManager {
} }
/** /**
* Get the active subscription count.
* *
* Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * @return The current number of active subscriptions.
* or that the calling app has carrier privileges (see
* {@link TelephonyManager#hasCarrierPrivileges}). In the latter case, the count will include
* only those subscriptions accessible to the caller.
* *
* @return the current number of active subscriptions. There is no guarantee the value * @see #getActiveSubscriptionInfoList()
* returned by this method will be the same as the length of the list returned by
* {@link #getActiveSubscriptionInfoList}.
*/ */
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getActiveSubscriptionInfoCount() { public int getActiveSubscriptionInfoCount() {
int result = 0; int result = 0;