Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +4 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,7 @@ public class GsmCdmaPhone extends Phone { mSubscriptionManagerService.registerCallback(new SubscriptionManagerServiceCallback( this::post) { @Override public void onUiccApplicationsEnabled(int subId) { public void onUiccApplicationsEnabledChanged(int subId) { reapplyUiccAppsEnablementIfNeeded(ENABLE_UICC_APPS_MAX_RETRIES); } }); Loading Loading @@ -4471,6 +4471,7 @@ public class GsmCdmaPhone extends Phone { " mTelecomVoiceServiceStateOverride=" + mTelecomVoiceServiceStateOverride + "(" + ServiceState.rilServiceStateToString(mTelecomVoiceServiceStateOverride) + ")"); pw.println(" mUiccApplicationsEnabled=" + mUiccApplicationsEnabled); pw.flush(); try { mCallWaitingController.dump(pw); Loading Loading @@ -4883,6 +4884,8 @@ public class GsmCdmaPhone extends Phone { // If no card is present or we don't have mUiccApplicationsEnabled yet, do nothing. if (slot == null || slot.getCardState() != IccCardStatus.CardState.CARDSTATE_PRESENT || mUiccApplicationsEnabled == null) { loge("reapplyUiccAppsEnablementIfNeeded: slot state=" + (slot != null ? slot.getCardState() : null)); return; } Loading src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java +0 −16 Original line number Diff line number Diff line Loading @@ -553,14 +553,6 @@ public class SubscriptionDatabaseManager extends Handler { * @param subId The subscription id. */ public abstract void onSubscriptionChanged(int subId); /** * Called when {@link SubscriptionInfoInternal#areUiccApplicationsEnabled()} * changed. * * @param subId The subscription id. */ public abstract void onUiccApplicationsEnabled(int subId); } /** Loading Loading @@ -918,10 +910,6 @@ public class SubscriptionDatabaseManager extends Handler { mAllSubscriptionInfoInternalCache.put(id, builder.build()); mCallback.invokeFromExecutor(() -> mCallback.onSubscriptionChanged(subId)); if (columnName.equals(SimInfo.COLUMN_UICC_APPLICATIONS_ENABLED)) { mCallback.invokeFromExecutor(() -> mCallback.onUiccApplicationsEnabled(subId)); } } } } Loading Loading @@ -956,10 +944,6 @@ public class SubscriptionDatabaseManager extends Handler { if (updateDatabase(subId, createDeltaContentValues(oldSubInfo, newSubInfo)) > 0) { mAllSubscriptionInfoInternalCache.put(subId, newSubInfo); mCallback.invokeFromExecutor(() -> mCallback.onSubscriptionChanged(subId)); if (oldSubInfo.areUiccApplicationsEnabled() != newSubInfo.areUiccApplicationsEnabled()) { mCallback.invokeFromExecutor(() -> mCallback.onUiccApplicationsEnabled(subId)); } } } finally { mReadWriteLock.writeLock().unlock(); Loading src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +15 −19 Original line number Diff line number Diff line Loading @@ -379,7 +379,7 @@ public class SubscriptionManagerService extends ISub.Stub { * * @param subId The subscription id. */ public void onUiccApplicationsEnabled(int subId) {} public void onUiccApplicationsEnabledChanged(int subId) {} } /** DeviceConfig key for whether work profile telephony feature is enabled. */ Loading Loading @@ -515,23 +515,6 @@ public class SubscriptionManagerService extends ISub.Stub { && telephonyRegistryManager != null) { telephonyRegistryManager.notifyOpportunisticSubscriptionInfoChanged(); } // TODO: Call TelephonyMetrics.updateActiveSubscriptionInfoList when active // subscription changes. } /** * Called when {@link SubscriptionInfoInternal#areUiccApplicationsEnabled()} * changed. * * @param subId The subscription id. */ @Override public void onUiccApplicationsEnabled(int subId) { log("onUiccApplicationsEnabled: subId=" + subId); mSubscriptionManagerServiceCallbacks.forEach( callback -> callback.invokeFromExecutor( () -> callback.onUiccApplicationsEnabled(subId))); } }); Loading Loading @@ -3199,7 +3182,20 @@ public class SubscriptionManagerService extends ISub.Stub { final long identity = Binder.clearCallingIdentity(); try { SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager .getSubscriptionInfoInternal(subId); if (subInfo == null) { throw new IllegalArgumentException("setUiccApplicationsEnabled: Subscription " + "doesn't exist. subId=" + subId); } if (subInfo.areUiccApplicationsEnabled() != enabled) { mSubscriptionDatabaseManager.setUiccApplicationsEnabled(subId, enabled); mSubscriptionManagerServiceCallbacks.forEach( callback -> callback.invokeFromExecutor( () -> callback.onUiccApplicationsEnabledChanged(subId))); } } finally { Binder.restoreCallingIdentity(identity); } Loading tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +12 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -1259,11 +1260,20 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { mSubscriptionManagerServiceUT.setUiccApplicationsEnabled(false, 1); processAllMessages(); verify(mMockedSubscriptionManagerServiceCallback).onSubscriptionChanged(eq(1)); verify(mMockedSubscriptionManagerServiceCallback).onUiccApplicationsEnabledChanged(eq(1)); SubscriptionInfoInternal subInfo = mSubscriptionManagerServiceUT .getSubscriptionInfoInternal(1); assertThat(subInfo).isNotNull(); assertThat(subInfo.areUiccApplicationsEnabled()).isFalse(); Mockito.clearInvocations(mMockedSubscriptionManagerServiceCallback); mSubscriptionManagerServiceUT.setUiccApplicationsEnabled(false, 1); processAllMessages(); verify(mMockedSubscriptionManagerServiceCallback, never()).onSubscriptionChanged(eq(1)); verify(mMockedSubscriptionManagerServiceCallback, never()) .onUiccApplicationsEnabledChanged(eq(1)); } @Test Loading Loading @@ -2020,9 +2030,9 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { SubscriptionManagerServiceCallback callback = new SubscriptionManagerServiceCallback(Runnable::run) { @Override public void onUiccApplicationsEnabled(int subId) { public void onUiccApplicationsEnabledChanged(int subId) { latch.countDown(); logd("testOnSubscriptionChanged: onUiccApplicationsEnabled"); logd("testOnSubscriptionChanged: onUiccApplicationsEnabledChanged"); } }; mSubscriptionManagerServiceUT.registerCallback(callback); Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +4 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,7 @@ public class GsmCdmaPhone extends Phone { mSubscriptionManagerService.registerCallback(new SubscriptionManagerServiceCallback( this::post) { @Override public void onUiccApplicationsEnabled(int subId) { public void onUiccApplicationsEnabledChanged(int subId) { reapplyUiccAppsEnablementIfNeeded(ENABLE_UICC_APPS_MAX_RETRIES); } }); Loading Loading @@ -4471,6 +4471,7 @@ public class GsmCdmaPhone extends Phone { " mTelecomVoiceServiceStateOverride=" + mTelecomVoiceServiceStateOverride + "(" + ServiceState.rilServiceStateToString(mTelecomVoiceServiceStateOverride) + ")"); pw.println(" mUiccApplicationsEnabled=" + mUiccApplicationsEnabled); pw.flush(); try { mCallWaitingController.dump(pw); Loading Loading @@ -4883,6 +4884,8 @@ public class GsmCdmaPhone extends Phone { // If no card is present or we don't have mUiccApplicationsEnabled yet, do nothing. if (slot == null || slot.getCardState() != IccCardStatus.CardState.CARDSTATE_PRESENT || mUiccApplicationsEnabled == null) { loge("reapplyUiccAppsEnablementIfNeeded: slot state=" + (slot != null ? slot.getCardState() : null)); return; } Loading
src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java +0 −16 Original line number Diff line number Diff line Loading @@ -553,14 +553,6 @@ public class SubscriptionDatabaseManager extends Handler { * @param subId The subscription id. */ public abstract void onSubscriptionChanged(int subId); /** * Called when {@link SubscriptionInfoInternal#areUiccApplicationsEnabled()} * changed. * * @param subId The subscription id. */ public abstract void onUiccApplicationsEnabled(int subId); } /** Loading Loading @@ -918,10 +910,6 @@ public class SubscriptionDatabaseManager extends Handler { mAllSubscriptionInfoInternalCache.put(id, builder.build()); mCallback.invokeFromExecutor(() -> mCallback.onSubscriptionChanged(subId)); if (columnName.equals(SimInfo.COLUMN_UICC_APPLICATIONS_ENABLED)) { mCallback.invokeFromExecutor(() -> mCallback.onUiccApplicationsEnabled(subId)); } } } } Loading Loading @@ -956,10 +944,6 @@ public class SubscriptionDatabaseManager extends Handler { if (updateDatabase(subId, createDeltaContentValues(oldSubInfo, newSubInfo)) > 0) { mAllSubscriptionInfoInternalCache.put(subId, newSubInfo); mCallback.invokeFromExecutor(() -> mCallback.onSubscriptionChanged(subId)); if (oldSubInfo.areUiccApplicationsEnabled() != newSubInfo.areUiccApplicationsEnabled()) { mCallback.invokeFromExecutor(() -> mCallback.onUiccApplicationsEnabled(subId)); } } } finally { mReadWriteLock.writeLock().unlock(); Loading
src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +15 −19 Original line number Diff line number Diff line Loading @@ -379,7 +379,7 @@ public class SubscriptionManagerService extends ISub.Stub { * * @param subId The subscription id. */ public void onUiccApplicationsEnabled(int subId) {} public void onUiccApplicationsEnabledChanged(int subId) {} } /** DeviceConfig key for whether work profile telephony feature is enabled. */ Loading Loading @@ -515,23 +515,6 @@ public class SubscriptionManagerService extends ISub.Stub { && telephonyRegistryManager != null) { telephonyRegistryManager.notifyOpportunisticSubscriptionInfoChanged(); } // TODO: Call TelephonyMetrics.updateActiveSubscriptionInfoList when active // subscription changes. } /** * Called when {@link SubscriptionInfoInternal#areUiccApplicationsEnabled()} * changed. * * @param subId The subscription id. */ @Override public void onUiccApplicationsEnabled(int subId) { log("onUiccApplicationsEnabled: subId=" + subId); mSubscriptionManagerServiceCallbacks.forEach( callback -> callback.invokeFromExecutor( () -> callback.onUiccApplicationsEnabled(subId))); } }); Loading Loading @@ -3199,7 +3182,20 @@ public class SubscriptionManagerService extends ISub.Stub { final long identity = Binder.clearCallingIdentity(); try { SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager .getSubscriptionInfoInternal(subId); if (subInfo == null) { throw new IllegalArgumentException("setUiccApplicationsEnabled: Subscription " + "doesn't exist. subId=" + subId); } if (subInfo.areUiccApplicationsEnabled() != enabled) { mSubscriptionDatabaseManager.setUiccApplicationsEnabled(subId, enabled); mSubscriptionManagerServiceCallbacks.forEach( callback -> callback.invokeFromExecutor( () -> callback.onUiccApplicationsEnabledChanged(subId))); } } finally { Binder.restoreCallingIdentity(identity); } Loading
tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +12 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -1259,11 +1260,20 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { mSubscriptionManagerServiceUT.setUiccApplicationsEnabled(false, 1); processAllMessages(); verify(mMockedSubscriptionManagerServiceCallback).onSubscriptionChanged(eq(1)); verify(mMockedSubscriptionManagerServiceCallback).onUiccApplicationsEnabledChanged(eq(1)); SubscriptionInfoInternal subInfo = mSubscriptionManagerServiceUT .getSubscriptionInfoInternal(1); assertThat(subInfo).isNotNull(); assertThat(subInfo.areUiccApplicationsEnabled()).isFalse(); Mockito.clearInvocations(mMockedSubscriptionManagerServiceCallback); mSubscriptionManagerServiceUT.setUiccApplicationsEnabled(false, 1); processAllMessages(); verify(mMockedSubscriptionManagerServiceCallback, never()).onSubscriptionChanged(eq(1)); verify(mMockedSubscriptionManagerServiceCallback, never()) .onUiccApplicationsEnabledChanged(eq(1)); } @Test Loading Loading @@ -2020,9 +2030,9 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { SubscriptionManagerServiceCallback callback = new SubscriptionManagerServiceCallback(Runnable::run) { @Override public void onUiccApplicationsEnabled(int subId) { public void onUiccApplicationsEnabledChanged(int subId) { latch.countDown(); logd("testOnSubscriptionChanged: onUiccApplicationsEnabled"); logd("testOnSubscriptionChanged: onUiccApplicationsEnabledChanged"); } }; mSubscriptionManagerServiceUT.registerCallback(callback); Loading