Loading api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -6252,10 +6252,13 @@ package android.telephony { public class SubscriptionManager { method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int); method public void requestEmbeddedSubscriptionInfoListRefresh(); method public void requestEmbeddedSubscriptionInfoListRefresh(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean); field public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI; field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2 Loading core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -12861,6 +12861,19 @@ public final class Settings { public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", "user_preferred_sub2","user_preferred_sub3"}; /** * Which subscription is enabled for a physical slot. * @hide */ public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot"; /** * Whether corresponding logical modem is enabled for a physical slot. * The value 1 - enable, 0 - disable * @hide */ public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot"; /** * Whether to enable new contacts aggregator or not. * The value 1 - enable, 0 - disable Loading core/tests/coretests/src/android/provider/SettingsBackupTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -505,7 +505,9 @@ public class SettingsBackupTest { Settings.Global.OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION, Settings.Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED, Settings.Global.HIDDEN_API_BLACKLIST_EXEMPTIONS, Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS); Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS, Settings.Global.ENABLED_SUBSCRIPTION_FOR_SLOT, Settings.Global.MODEM_STACK_ENABLED_FOR_SLOT); private static final Set<String> BACKUP_BLACKLISTED_SECURE_SETTINGS = newHashSet( Settings.Secure.ACCESSIBILITY_SOFT_KEYBOARD_MODE, Loading telephony/java/android/telephony/PhoneCapability.java +8 −2 Original line number Diff line number Diff line Loading @@ -33,15 +33,17 @@ public class PhoneCapability implements Parcelable { public final int maxActiveVoiceCalls; public final int maxActiveData; public final int max5G; public final boolean validationBeforeSwitchSupported; public final List<ModemInfo> logicalModemList; public PhoneCapability(int maxActiveVoiceCalls, int maxActiveData, int max5G, List<ModemInfo> logicalModemList) { List<ModemInfo> logicalModemList, boolean validationBeforeSwitchSupported) { this.maxActiveVoiceCalls = maxActiveVoiceCalls; this.maxActiveData = maxActiveData; this.max5G = max5G; // Make sure it's not null. this.logicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList; this.validationBeforeSwitchSupported = validationBeforeSwitchSupported; } @Override Loading @@ -55,13 +57,15 @@ public class PhoneCapability implements Parcelable { maxActiveVoiceCalls = in.readInt(); maxActiveData = in.readInt(); max5G = in.readInt(); validationBeforeSwitchSupported = in.readBoolean(); logicalModemList = new ArrayList<>(); in.readList(logicalModemList, ModemInfo.class.getClassLoader()); } @Override public int hashCode() { return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList); return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, validationBeforeSwitchSupported); } @Override Loading @@ -79,6 +83,7 @@ public class PhoneCapability implements Parcelable { return (maxActiveVoiceCalls == s.maxActiveVoiceCalls && maxActiveData == s.maxActiveData && max5G == s.max5G && validationBeforeSwitchSupported == s.validationBeforeSwitchSupported && logicalModemList.equals(s.logicalModemList)); } Loading @@ -96,6 +101,7 @@ public class PhoneCapability implements Parcelable { dest.writeInt(maxActiveVoiceCalls); dest.writeInt(maxActiveData); dest.writeInt(max5G); dest.writeBoolean(validationBeforeSwitchSupported); dest.writeList(logicalModemList); } Loading telephony/java/android/telephony/SubscriptionManager.java +89 −0 Original line number Diff line number Diff line Loading @@ -2862,6 +2862,95 @@ public class SubscriptionManager { } } /** * Enabled or disable a subscription. This is currently used in the settings page. * * <p> * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required * * @param enable whether user is turning it on or off. * @param subscriptionId Subscription to be enabled or disabled. * It could be a eSIM or pSIM subscription. * * @return whether the operation is successful. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int subscriptionId, boolean enable) { if (VDBG) { logd("setSubscriptionActivated subId= " + subscriptionId + " enable " + enable); } try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { return iSub.setSubscriptionEnabled(enable, subscriptionId); } } catch (RemoteException ex) { // ignore it } return false; } /** * Returns whether the subscription is enabled or not. This is different from activated * or deactivated for two aspects. 1) For when user disables a physical subscription, we * actually disable the modem because we can't switch off the subscription. 2) For eSIM, * user may enable one subscription but the system may activate another temporarily. In this * case, user enabled one is different from current active one. * @param subscriptionId The subscription it asks about. * @return whether it's enabled or not. {@code true} if user set this subscription enabled * earlier, or user never set subscription enable / disable on this slot explicitly, and * this subscription is currently active. Otherwise, it returns {@code false}. * * @hide */ @SystemApi @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int subscriptionId) { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { return iSub.isSubscriptionEnabled(subscriptionId); } } catch (RemoteException ex) { // ignore it } return false; } /** * Get which subscription is enabled on this slot. See {@link #isSubscriptionEnabled(int)} * for more details. * * @param slotIndex which slot it asks about. * @return which subscription is enabled on this slot. If there's no enabled subscription * in this slot, it will return {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}. * * @hide */ @SystemApi @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int slotIndex) { int subId = INVALID_SUBSCRIPTION_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subId = iSub.getEnabledSubscriptionId(slotIndex); } } catch (RemoteException ex) { // ignore it } if (VDBG) logd("getEnabledSubscriptionId, subId = " + subId); return subId; } private interface CallISubMethodHelper { int callMethod(ISub iSub) throws RemoteException; } Loading Loading
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -6252,10 +6252,13 @@ package android.telephony { public class SubscriptionManager { method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int); method public void requestEmbeddedSubscriptionInfoListRefresh(); method public void requestEmbeddedSubscriptionInfoListRefresh(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean); field public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI; field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2 Loading
core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -12861,6 +12861,19 @@ public final class Settings { public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", "user_preferred_sub2","user_preferred_sub3"}; /** * Which subscription is enabled for a physical slot. * @hide */ public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot"; /** * Whether corresponding logical modem is enabled for a physical slot. * The value 1 - enable, 0 - disable * @hide */ public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot"; /** * Whether to enable new contacts aggregator or not. * The value 1 - enable, 0 - disable Loading
core/tests/coretests/src/android/provider/SettingsBackupTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -505,7 +505,9 @@ public class SettingsBackupTest { Settings.Global.OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION, Settings.Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED, Settings.Global.HIDDEN_API_BLACKLIST_EXEMPTIONS, Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS); Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS, Settings.Global.ENABLED_SUBSCRIPTION_FOR_SLOT, Settings.Global.MODEM_STACK_ENABLED_FOR_SLOT); private static final Set<String> BACKUP_BLACKLISTED_SECURE_SETTINGS = newHashSet( Settings.Secure.ACCESSIBILITY_SOFT_KEYBOARD_MODE, Loading
telephony/java/android/telephony/PhoneCapability.java +8 −2 Original line number Diff line number Diff line Loading @@ -33,15 +33,17 @@ public class PhoneCapability implements Parcelable { public final int maxActiveVoiceCalls; public final int maxActiveData; public final int max5G; public final boolean validationBeforeSwitchSupported; public final List<ModemInfo> logicalModemList; public PhoneCapability(int maxActiveVoiceCalls, int maxActiveData, int max5G, List<ModemInfo> logicalModemList) { List<ModemInfo> logicalModemList, boolean validationBeforeSwitchSupported) { this.maxActiveVoiceCalls = maxActiveVoiceCalls; this.maxActiveData = maxActiveData; this.max5G = max5G; // Make sure it's not null. this.logicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList; this.validationBeforeSwitchSupported = validationBeforeSwitchSupported; } @Override Loading @@ -55,13 +57,15 @@ public class PhoneCapability implements Parcelable { maxActiveVoiceCalls = in.readInt(); maxActiveData = in.readInt(); max5G = in.readInt(); validationBeforeSwitchSupported = in.readBoolean(); logicalModemList = new ArrayList<>(); in.readList(logicalModemList, ModemInfo.class.getClassLoader()); } @Override public int hashCode() { return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList); return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, validationBeforeSwitchSupported); } @Override Loading @@ -79,6 +83,7 @@ public class PhoneCapability implements Parcelable { return (maxActiveVoiceCalls == s.maxActiveVoiceCalls && maxActiveData == s.maxActiveData && max5G == s.max5G && validationBeforeSwitchSupported == s.validationBeforeSwitchSupported && logicalModemList.equals(s.logicalModemList)); } Loading @@ -96,6 +101,7 @@ public class PhoneCapability implements Parcelable { dest.writeInt(maxActiveVoiceCalls); dest.writeInt(maxActiveData); dest.writeInt(max5G); dest.writeBoolean(validationBeforeSwitchSupported); dest.writeList(logicalModemList); } Loading
telephony/java/android/telephony/SubscriptionManager.java +89 −0 Original line number Diff line number Diff line Loading @@ -2862,6 +2862,95 @@ public class SubscriptionManager { } } /** * Enabled or disable a subscription. This is currently used in the settings page. * * <p> * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required * * @param enable whether user is turning it on or off. * @param subscriptionId Subscription to be enabled or disabled. * It could be a eSIM or pSIM subscription. * * @return whether the operation is successful. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int subscriptionId, boolean enable) { if (VDBG) { logd("setSubscriptionActivated subId= " + subscriptionId + " enable " + enable); } try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { return iSub.setSubscriptionEnabled(enable, subscriptionId); } } catch (RemoteException ex) { // ignore it } return false; } /** * Returns whether the subscription is enabled or not. This is different from activated * or deactivated for two aspects. 1) For when user disables a physical subscription, we * actually disable the modem because we can't switch off the subscription. 2) For eSIM, * user may enable one subscription but the system may activate another temporarily. In this * case, user enabled one is different from current active one. * @param subscriptionId The subscription it asks about. * @return whether it's enabled or not. {@code true} if user set this subscription enabled * earlier, or user never set subscription enable / disable on this slot explicitly, and * this subscription is currently active. Otherwise, it returns {@code false}. * * @hide */ @SystemApi @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int subscriptionId) { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { return iSub.isSubscriptionEnabled(subscriptionId); } } catch (RemoteException ex) { // ignore it } return false; } /** * Get which subscription is enabled on this slot. See {@link #isSubscriptionEnabled(int)} * for more details. * * @param slotIndex which slot it asks about. * @return which subscription is enabled on this slot. If there's no enabled subscription * in this slot, it will return {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}. * * @hide */ @SystemApi @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int slotIndex) { int subId = INVALID_SUBSCRIPTION_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subId = iSub.getEnabledSubscriptionId(slotIndex); } } catch (RemoteException ex) { // ignore it } if (VDBG) logd("getEnabledSubscriptionId, subId = " + subId); return subId; } private interface CallISubMethodHelper { int callMethod(ISub iSub) throws RemoteException; } Loading