Don't return hidden subscription in getActiveSubIdList
Now getActiveSubscriptionInfoList will not return hidden subscriptions. And getActiveSubIdList should be consistent with it. In the mean time, internal SubscriptionController API should have a way to specify if caller wants hidden subscriptions or not. Bug: 124690005 Test: manual Change-Id: I46ccae88167c2988d71a6e07da2937bf9644a1f0
This commit is contained in:
committed by
Xiangyu/Malcolm Chen
parent
623a9c6dc7
commit
d91d6b24f8
@@ -3108,10 +3108,6 @@ Lcom/android/internal/telephony/ISms$Stub;-><init>()V
|
|||||||
Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms;
|
Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms;
|
||||||
Lcom/android/internal/telephony/ISub$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
|
Lcom/android/internal/telephony/ISub$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
|
||||||
Lcom/android/internal/telephony/ISub$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISub;
|
Lcom/android/internal/telephony/ISub$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISub;
|
||||||
Lcom/android/internal/telephony/ISub;->getActiveSubIdList()[I
|
|
||||||
Lcom/android/internal/telephony/ISub;->getDefaultDataSubId()I
|
|
||||||
Lcom/android/internal/telephony/ISub;->getDefaultSubId()I
|
|
||||||
Lcom/android/internal/telephony/ISub;->setDefaultDataSubId(I)V
|
|
||||||
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
|
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
|
||||||
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->getDeviceId(Ljava/lang/String;)Ljava/lang/String;
|
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->getDeviceId(Ljava/lang/String;)Ljava/lang/String;
|
||||||
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->isRadioOn(Ljava/lang/String;)Z
|
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->isRadioOn(Ljava/lang/String;)Z
|
||||||
|
|||||||
@@ -2081,7 +2081,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
|
||||||
@@ -2866,7 +2866,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
|
||||||
@@ -2874,8 +2874,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ interface ISub {
|
|||||||
|
|
||||||
void clearDefaultsForInactiveSubIds();
|
void clearDefaultsForInactiveSubIds();
|
||||||
|
|
||||||
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