Merge "Don't return hidden subscription in getActiveSubIdList"
am: d2cb5a0608
Change-Id: Ie8d0998a15b2fa905ba5073f47badf51afd1154a
This commit is contained in:
@@ -2088,7 +2088,7 @@ public class SubscriptionManager {
|
|||||||
try {
|
try {
|
||||||
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
||||||
if (iSub != null) {
|
if (iSub != null) {
|
||||||
subId = iSub.getActiveSubIdList();
|
subId = iSub.getActiveSubIdList(/*visibleOnly*/true);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
// ignore it
|
// ignore it
|
||||||
@@ -2874,7 +2874,7 @@ public class SubscriptionManager {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
private boolean shouldHideSubscription(SubscriptionInfo info) {
|
public boolean shouldHideSubscription(SubscriptionInfo info) {
|
||||||
if (info == null) return false;
|
if (info == null) return false;
|
||||||
|
|
||||||
// If hasCarrierPrivileges or canManageSubscription returns true, it means caller
|
// If hasCarrierPrivileges or canManageSubscription returns true, it means caller
|
||||||
@@ -2882,8 +2882,14 @@ public class SubscriptionManager {
|
|||||||
boolean hasCarrierPrivilegePermission = (info.isEmbedded() && canManageSubscription(info))
|
boolean hasCarrierPrivilegePermission = (info.isEmbedded() && canManageSubscription(info))
|
||||||
|| TelephonyManager.from(mContext).hasCarrierPrivileges(info.getSubscriptionId());
|
|| TelephonyManager.from(mContext).hasCarrierPrivileges(info.getSubscriptionId());
|
||||||
|
|
||||||
return (!TextUtils.isEmpty(info.getGroupUuid()) && info.isOpportunistic()
|
return isInvisibleSubscription(info) && !hasCarrierPrivilegePermission;
|
||||||
&& !hasCarrierPrivilegePermission);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static boolean isInvisibleSubscription(SubscriptionInfo info) {
|
||||||
|
return info != null && !TextUtils.isEmpty(info.getGroupUuid()) && info.isOpportunistic();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ interface ISub {
|
|||||||
void clearDefaultsForInactiveSubIds();
|
void clearDefaultsForInactiveSubIds();
|
||||||
|
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
int[] getActiveSubIdList();
|
int[] getActiveSubIdList(boolean visibleOnly);
|
||||||
|
|
||||||
int setSubscriptionProperty(int subId, String propKey, String propValue);
|
int setSubscriptionProperty(int subId, String propKey, String propValue);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user