[TelephonyMainline] Make getMergedSubscriberIdsFromGroup as System API and rename it
Bug: 145584030 Test: make Change-Id: I6c077f3bee6bfd4d5b215aca4e9b19b719772b29
This commit is contained in:
@@ -9675,6 +9675,7 @@ package android.telephony {
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
|
||||
method public int getMaxNumberOfSimultaneouslyActiveSims();
|
||||
method public static long getMaxNumberVerificationTimeoutMillis();
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String[] getMergedImsisFromGroup();
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getNetworkCountryIso(int);
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
|
||||
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class DataUsageUtils {
|
||||
}
|
||||
|
||||
final String[] mergedSubscriberIds = telephonyManager.createForSubscriptionId(subId)
|
||||
.getMergedSubscriberIdsFromGroup();
|
||||
.getMergedImsisFromGroup();
|
||||
|
||||
if (ArrayUtils.isEmpty(mergedSubscriberIds)) {
|
||||
Log.i(TAG, "mergedSubscriberIds is null.");
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DataUsageUtilsTest {
|
||||
public void getMobileTemplate_groupUuidNull_returnMobileAll() {
|
||||
when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1);
|
||||
when(mInfo1.getGroupUuid()).thenReturn(null);
|
||||
when(mTelephonyManager.getMergedSubscriberIdsFromGroup())
|
||||
when(mTelephonyManager.getMergedImsisFromGroup())
|
||||
.thenReturn(new String[] {SUBSCRIBER_ID});
|
||||
|
||||
final NetworkTemplate networkTemplate = DataUsageUtils.getMobileTemplate(mContext, SUB_ID);
|
||||
@@ -99,7 +99,7 @@ public class DataUsageUtilsTest {
|
||||
public void getMobileTemplate_groupUuidExist_returnMobileMerged() {
|
||||
when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1);
|
||||
when(mInfo1.getGroupUuid()).thenReturn(mParcelUuid);
|
||||
when(mTelephonyManager.getMergedSubscriberIdsFromGroup())
|
||||
when(mTelephonyManager.getMergedImsisFromGroup())
|
||||
.thenReturn(new String[] {SUBSCRIBER_ID, SUBSCRIBER_ID_2});
|
||||
|
||||
final NetworkTemplate networkTemplate = DataUsageUtils.getMobileTemplate(mContext, SUB_ID);
|
||||
|
||||
@@ -1827,7 +1827,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
||||
}
|
||||
|
||||
String[] mergedSubscriberId = ArrayUtils.defeatNullable(
|
||||
tm.createForSubscriptionId(subId).getMergedSubscriberIdsFromGroup());
|
||||
tm.createForSubscriptionId(subId).getMergedImsisFromGroup());
|
||||
mergedSubscriberIdsList.add(mergedSubscriberId);
|
||||
}
|
||||
|
||||
|
||||
@@ -4173,7 +4173,7 @@ public class TelephonyManager {
|
||||
* The returned set of subscriber IDs will include the subscriber ID corresponding to this
|
||||
* TelephonyManager's subId.
|
||||
*
|
||||
* This is deprecated and {@link #getMergedSubscriberIdsFromGroup()} should be used for data
|
||||
* This is deprecated and {@link #getMergedImsisFromGroup()} should be used for data
|
||||
* usage merging purpose.
|
||||
* TODO: remove this API.
|
||||
*
|
||||
@@ -4194,25 +4194,27 @@ public class TelephonyManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the set of subscriber IDs that should be considered "merged together" for data usage
|
||||
* purposes. Unlike {@link #getMergedSubscriberIds()} this API merge subscriberIds based on
|
||||
* subscription grouping: subscriberId of those in the same group will all be returned.
|
||||
* Return the set of IMSIs that should be considered "merged together" for data usage
|
||||
* purposes. Unlike {@link #getMergedSubscriberIds()} this API merge IMSIs based on
|
||||
* subscription grouping: IMSI of those in the same group will all be returned.
|
||||
* Return the current IMSI if there is no subscription group.
|
||||
*
|
||||
* <p>Requires the calling app to have READ_PRIVILEGED_PHONE_STATE permission.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||
public @Nullable String[] getMergedSubscriberIdsFromGroup() {
|
||||
public @NonNull String[] getMergedImsisFromGroup() {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null) {
|
||||
return telephony.getMergedSubscriberIdsFromGroup(getSubId(), getOpPackageName());
|
||||
return telephony.getMergedImsisFromGroup(getSubId(), getOpPackageName());
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
return null;
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1133,7 +1133,7 @@ interface ITelephony {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
String[] getMergedSubscriberIdsFromGroup(int subId, String callingPackage);
|
||||
String[] getMergedImsisFromGroup(int subId, String callingPackage);
|
||||
|
||||
/**
|
||||
* Override the operator branding for the current ICCID.
|
||||
|
||||
Reference in New Issue
Block a user