Loading src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +0 −52 Original line number Diff line number Diff line Loading @@ -398,11 +398,6 @@ public class SubscriptionManagerService extends ISub.Stub { public void onUiccApplicationsEnabledChanged(int subId) {} } /** DeviceConfig key for whether work profile telephony feature is enabled. */ private static final String KEY_ENABLE_WORK_PROFILE_TELEPHONY = "enable_work_profile_telephony"; /** {@code true} if the work profile telephony feature is enabled otherwise {@code false}. */ private boolean mIsWorkProfileTelephonyEnabled = false; /** * The constructor * Loading Loading @@ -479,15 +474,6 @@ public class SubscriptionManagerService extends ISub.Stub { mSimState = new int[mTelephonyManager.getSupportedModemCount()]; Arrays.fill(mSimState, TelephonyManager.SIM_STATE_UNKNOWN); mIsWorkProfileTelephonyEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_TELEPHONY, KEY_ENABLE_WORK_PROFILE_TELEPHONY, false); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_TELEPHONY, mHandler::post, properties -> { if (TextUtils.equals(DeviceConfig.NAMESPACE_TELEPHONY, properties.getNamespace())) { onDeviceConfigChanged(); } }); // Create a separate thread for subscription database manager. The database will be updated // from a different thread. HandlerThread handlerThread = new HandlerThread(LOG_TAG); Loading Loading @@ -794,16 +780,6 @@ public class SubscriptionManagerService extends ISub.Stub { return iccidList; } /** * Enable or disable work profile telephony feature. * @param isWorkProfileTelephonyEnabled - {@code true} if the work profile telephony feature * is enabled otherwise {@code false}. */ @VisibleForTesting public void setWorkProfileTelephonyEnabled(boolean isWorkProfileTelephonyEnabled) { mIsWorkProfileTelephonyEnabled = isWorkProfileTelephonyEnabled; } /** * Set the subscription carrier id. * Loading Loading @@ -3576,11 +3552,6 @@ public class SubscriptionManagerService extends ISub.Stub { public UserHandle getSubscriptionUserHandle(int subId) { enforcePermissions("getSubscriptionUserHandle", Manifest.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION); if (!mIsWorkProfileTelephonyEnabled) { return null; } long token = Binder.clearCallingIdentity(); try { SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager Loading Loading @@ -3619,10 +3590,6 @@ public class SubscriptionManagerService extends ISub.Stub { enforcePermissions("isSubscriptionAssociatedWithUser", Manifest.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION); if (!mIsWorkProfileTelephonyEnabled) { return true; } long token = Binder.clearCallingIdentity(); try { // Return true if there are no subscriptions on the device. Loading Loading @@ -3677,10 +3644,6 @@ public class SubscriptionManagerService extends ISub.Stub { return new ArrayList<>(); } if (!mIsWorkProfileTelephonyEnabled) { return subInfoList; } List<SubscriptionInfo> subscriptionsAssociatedWithUser = new ArrayList<>(); List<SubscriptionInfo> subscriptionsWithNoAssociation = new ArrayList<>(); for (SubscriptionInfo subInfo : subInfoList) { Loading Loading @@ -3887,21 +3850,6 @@ public class SubscriptionManagerService extends ISub.Stub { }); } /** * Listener to update cached flag values from DeviceConfig. */ private void onDeviceConfigChanged() { boolean isWorkProfileTelephonyEnabled = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_TELEPHONY, KEY_ENABLE_WORK_PROFILE_TELEPHONY, false); if (isWorkProfileTelephonyEnabled != mIsWorkProfileTelephonyEnabled) { log("onDeviceConfigChanged: isWorkProfileTelephonyEnabled " + "changed from " + mIsWorkProfileTelephonyEnabled + " to " + isWorkProfileTelephonyEnabled); mIsWorkProfileTelephonyEnabled = isWorkProfileTelephonyEnabled; } } /** * Get the calling package(s). * Loading tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -212,8 +212,6 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { setIdentifierAccess(false); setPhoneNumberAccess(PackageManager.PERMISSION_DENIED); mSubscriptionManagerServiceUT.setWorkProfileTelephonyEnabled(true); logd("SubscriptionManagerServiceTest -Setup!"); } Loading Loading
src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +0 −52 Original line number Diff line number Diff line Loading @@ -398,11 +398,6 @@ public class SubscriptionManagerService extends ISub.Stub { public void onUiccApplicationsEnabledChanged(int subId) {} } /** DeviceConfig key for whether work profile telephony feature is enabled. */ private static final String KEY_ENABLE_WORK_PROFILE_TELEPHONY = "enable_work_profile_telephony"; /** {@code true} if the work profile telephony feature is enabled otherwise {@code false}. */ private boolean mIsWorkProfileTelephonyEnabled = false; /** * The constructor * Loading Loading @@ -479,15 +474,6 @@ public class SubscriptionManagerService extends ISub.Stub { mSimState = new int[mTelephonyManager.getSupportedModemCount()]; Arrays.fill(mSimState, TelephonyManager.SIM_STATE_UNKNOWN); mIsWorkProfileTelephonyEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_TELEPHONY, KEY_ENABLE_WORK_PROFILE_TELEPHONY, false); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_TELEPHONY, mHandler::post, properties -> { if (TextUtils.equals(DeviceConfig.NAMESPACE_TELEPHONY, properties.getNamespace())) { onDeviceConfigChanged(); } }); // Create a separate thread for subscription database manager. The database will be updated // from a different thread. HandlerThread handlerThread = new HandlerThread(LOG_TAG); Loading Loading @@ -794,16 +780,6 @@ public class SubscriptionManagerService extends ISub.Stub { return iccidList; } /** * Enable or disable work profile telephony feature. * @param isWorkProfileTelephonyEnabled - {@code true} if the work profile telephony feature * is enabled otherwise {@code false}. */ @VisibleForTesting public void setWorkProfileTelephonyEnabled(boolean isWorkProfileTelephonyEnabled) { mIsWorkProfileTelephonyEnabled = isWorkProfileTelephonyEnabled; } /** * Set the subscription carrier id. * Loading Loading @@ -3576,11 +3552,6 @@ public class SubscriptionManagerService extends ISub.Stub { public UserHandle getSubscriptionUserHandle(int subId) { enforcePermissions("getSubscriptionUserHandle", Manifest.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION); if (!mIsWorkProfileTelephonyEnabled) { return null; } long token = Binder.clearCallingIdentity(); try { SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager Loading Loading @@ -3619,10 +3590,6 @@ public class SubscriptionManagerService extends ISub.Stub { enforcePermissions("isSubscriptionAssociatedWithUser", Manifest.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION); if (!mIsWorkProfileTelephonyEnabled) { return true; } long token = Binder.clearCallingIdentity(); try { // Return true if there are no subscriptions on the device. Loading Loading @@ -3677,10 +3644,6 @@ public class SubscriptionManagerService extends ISub.Stub { return new ArrayList<>(); } if (!mIsWorkProfileTelephonyEnabled) { return subInfoList; } List<SubscriptionInfo> subscriptionsAssociatedWithUser = new ArrayList<>(); List<SubscriptionInfo> subscriptionsWithNoAssociation = new ArrayList<>(); for (SubscriptionInfo subInfo : subInfoList) { Loading Loading @@ -3887,21 +3850,6 @@ public class SubscriptionManagerService extends ISub.Stub { }); } /** * Listener to update cached flag values from DeviceConfig. */ private void onDeviceConfigChanged() { boolean isWorkProfileTelephonyEnabled = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_TELEPHONY, KEY_ENABLE_WORK_PROFILE_TELEPHONY, false); if (isWorkProfileTelephonyEnabled != mIsWorkProfileTelephonyEnabled) { log("onDeviceConfigChanged: isWorkProfileTelephonyEnabled " + "changed from " + mIsWorkProfileTelephonyEnabled + " to " + isWorkProfileTelephonyEnabled); mIsWorkProfileTelephonyEnabled = isWorkProfileTelephonyEnabled; } } /** * Get the calling package(s). * Loading
tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -212,8 +212,6 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { setIdentifierAccess(false); setPhoneNumberAccess(PackageManager.PERMISSION_DENIED); mSubscriptionManagerServiceUT.setWorkProfileTelephonyEnabled(true); logd("SubscriptionManagerServiceTest -Setup!"); } Loading