Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +9 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,8 @@ public class SatelliteController extends Handler { @NonNull private static SatelliteController sInstance; @NonNull private final Context mContext; @NonNull private final SatelliteModemInterface mSatelliteModemInterface; @NonNull private SatelliteSessionController mSatelliteSessionController; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) @NonNull protected SatelliteSessionController mSatelliteSessionController; @NonNull private final PointingAppController mPointingAppController; @NonNull private final DatagramController mDatagramController; @NonNull private final ControllerMetricsStats mControllerMetricsStats; Loading Loading @@ -3251,6 +3252,9 @@ public class SatelliteController extends Handler { } mSatelliteSessionController = SatelliteSessionController.make( mContext, getLooper(), supported); logd("create a new SatelliteSessionController due to isSatelliteSupported state has " + "changed to " + supported); if (supported) { registerForSatelliteProvisionStateChanged(); registerForPendingDatagramCount(); Loading Loading @@ -3512,6 +3516,10 @@ public class SatelliteController extends Handler { } } mIsSatelliteSupported = supported; mSatelliteSessionController = SatelliteSessionController.make( mContext, getLooper(), supported); logd("create a new SatelliteSessionController due to isSatelliteSupported state has " + "changed to " + supported); } List<ISatelliteSupportedStateCallback> deadCallersList = new ArrayList<>(); Loading src/java/com/android/internal/telephony/satellite/SatelliteSessionController.java +1 −8 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.SystemProperties; import android.telephony.Rlog; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.SatelliteManager; import android.telephony.satellite.stub.ISatelliteGateway; Loading Loading @@ -163,15 +162,9 @@ public class SatelliteSessionController extends StateMachine { */ public static SatelliteSessionController make( @NonNull Context context, @NonNull Looper looper, boolean isSatelliteSupported) { if (sInstance == null) { if (sInstance == null || isSatelliteSupported != sInstance.mIsSatelliteSupported) { sInstance = new SatelliteSessionController(context, looper, isSatelliteSupported, SatelliteModemInterface.getInstance()); } else { if (isSatelliteSupported != sInstance.mIsSatelliteSupported) { Rlog.e(TAG, "New satellite support state " + isSatelliteSupported + " is different from existing state " + sInstance.mIsSatelliteSupported + ". Ignore the new state."); } } return sInstance; } Loading src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +10 −6 Original line number Diff line number Diff line Loading @@ -1452,6 +1452,11 @@ public class SubscriptionManagerService extends ISub.Stub { if (mSlotIndexToSubId.containsKey(phoneId)) { markSubscriptionsInactive(phoneId); } if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number setNumberFromIms(getSubId(phoneId), new String("")); } } else if (simState == TelephonyManager.SIM_STATE_NOT_READY) { // Check if this is the final state. Only update the subscription if NOT_READY is a // final state. Loading @@ -1464,6 +1469,11 @@ public class SubscriptionManagerService extends ISub.Stub { } else { logl("updateSubscription: UICC app disabled on slot " + phoneId); markSubscriptionsInactive(phoneId); if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number setNumberFromIms(getSubId(phoneId), new String("")); } } } else { String iccId = getIccId(phoneId); Loading Loading @@ -1572,12 +1582,6 @@ public class SubscriptionManagerService extends ISub.Stub { loge("updateSubscription: ICC card is not available."); } if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number // before proceeding with Ims Registration setNumberFromIms(subId, new String("")); } // Attempt to restore SIM specific settings when SIM is loaded. Bundle result = mContext.getContentResolver().call( SubscriptionManager.SIM_INFO_BACKUP_AND_RESTORE_CONTENT_URI, Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ public class SatelliteControllerTest extends TelephonyTest { @Mock private TelephonyConfigUpdateInstallReceiver mMockTelephonyConfigUpdateInstallReceiver; @Mock private SatelliteConfigParser mMockConfigParser; @Mock private SatelliteConfig mMockConfig; @Mock private DemoSimulator mMockDemoSimulator; private Semaphore mIIntegerConsumerSemaphore = new Semaphore(0); private IIntegerConsumer mIIntegerConsumer = new IIntegerConsumer.Stub() { Loading Loading @@ -475,6 +476,7 @@ public class SatelliteControllerTest extends TelephonyTest { replaceInstance(PhoneFactory.class, "sPhones", null, new Phone[]{mPhone, mPhone2}); replaceInstance(TelephonyConfigUpdateInstallReceiver.class, "sReceiverAdaptorInstance", null, mMockTelephonyConfigUpdateInstallReceiver); replaceInstance(DemoSimulator.class, "sInstance", null, mMockDemoSimulator); mServiceState2 = Mockito.mock(ServiceState.class); when(mPhone.getServiceState()).thenReturn(mServiceState); Loading Loading @@ -785,6 +787,7 @@ public class SatelliteControllerTest extends TelephonyTest { setUpResponseForRequestSatelliteEnabled(true, false, false, SATELLITE_RESULT_SUCCESS); mSatelliteControllerUT.requestSatelliteEnabled(SUB_ID, true, false, false, mIIntegerConsumer); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); processAllMessages(); assertTrue(waitForIIntegerConsumerResult(1)); assertEquals(SATELLITE_RESULT_SUCCESS, (long) mIIntegerConsumerResults.get(0)); Loading Loading @@ -1304,6 +1307,7 @@ public class SatelliteControllerTest extends TelephonyTest { .registerForSatelliteModemStateChanged(callback); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); errorCode = mSatelliteControllerUT.registerForSatelliteModemStateChanged( SUB_ID, callback); Loading @@ -1324,7 +1328,7 @@ public class SatelliteControllerTest extends TelephonyTest { .unregisterForSatelliteModemStateChanged(callback); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); mSatelliteControllerUT.unregisterForModemStateChanged(SUB_ID, callback); verify(mMockSatelliteSessionController).unregisterForSatelliteModemStateChanged(callback); } Loading Loading @@ -2250,6 +2254,7 @@ public class SatelliteControllerTest extends TelephonyTest { SATELLITE_MODEM_STATE_CONNECTED); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); clearInvocations(mMockSatelliteSessionController); clearInvocations(mMockDatagramController); sendSatelliteModemStateChangedEvent(SATELLITE_MODEM_STATE_UNAVAILABLE, null); Loading Loading @@ -4502,5 +4507,9 @@ public class SatelliteControllerTest extends TelephonyTest { protected long getElapsedRealtime() { return elapsedRealtime; } void setSatelliteSessionController(SatelliteSessionController satelliteSessionController) { mSatelliteSessionController = satelliteSessionController; } } } Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +9 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,8 @@ public class SatelliteController extends Handler { @NonNull private static SatelliteController sInstance; @NonNull private final Context mContext; @NonNull private final SatelliteModemInterface mSatelliteModemInterface; @NonNull private SatelliteSessionController mSatelliteSessionController; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) @NonNull protected SatelliteSessionController mSatelliteSessionController; @NonNull private final PointingAppController mPointingAppController; @NonNull private final DatagramController mDatagramController; @NonNull private final ControllerMetricsStats mControllerMetricsStats; Loading Loading @@ -3251,6 +3252,9 @@ public class SatelliteController extends Handler { } mSatelliteSessionController = SatelliteSessionController.make( mContext, getLooper(), supported); logd("create a new SatelliteSessionController due to isSatelliteSupported state has " + "changed to " + supported); if (supported) { registerForSatelliteProvisionStateChanged(); registerForPendingDatagramCount(); Loading Loading @@ -3512,6 +3516,10 @@ public class SatelliteController extends Handler { } } mIsSatelliteSupported = supported; mSatelliteSessionController = SatelliteSessionController.make( mContext, getLooper(), supported); logd("create a new SatelliteSessionController due to isSatelliteSupported state has " + "changed to " + supported); } List<ISatelliteSupportedStateCallback> deadCallersList = new ArrayList<>(); Loading
src/java/com/android/internal/telephony/satellite/SatelliteSessionController.java +1 −8 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.SystemProperties; import android.telephony.Rlog; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.SatelliteManager; import android.telephony.satellite.stub.ISatelliteGateway; Loading Loading @@ -163,15 +162,9 @@ public class SatelliteSessionController extends StateMachine { */ public static SatelliteSessionController make( @NonNull Context context, @NonNull Looper looper, boolean isSatelliteSupported) { if (sInstance == null) { if (sInstance == null || isSatelliteSupported != sInstance.mIsSatelliteSupported) { sInstance = new SatelliteSessionController(context, looper, isSatelliteSupported, SatelliteModemInterface.getInstance()); } else { if (isSatelliteSupported != sInstance.mIsSatelliteSupported) { Rlog.e(TAG, "New satellite support state " + isSatelliteSupported + " is different from existing state " + sInstance.mIsSatelliteSupported + ". Ignore the new state."); } } return sInstance; } Loading
src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +10 −6 Original line number Diff line number Diff line Loading @@ -1452,6 +1452,11 @@ public class SubscriptionManagerService extends ISub.Stub { if (mSlotIndexToSubId.containsKey(phoneId)) { markSubscriptionsInactive(phoneId); } if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number setNumberFromIms(getSubId(phoneId), new String("")); } } else if (simState == TelephonyManager.SIM_STATE_NOT_READY) { // Check if this is the final state. Only update the subscription if NOT_READY is a // final state. Loading @@ -1464,6 +1469,11 @@ public class SubscriptionManagerService extends ISub.Stub { } else { logl("updateSubscription: UICC app disabled on slot " + phoneId); markSubscriptionsInactive(phoneId); if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number setNumberFromIms(getSubId(phoneId), new String("")); } } } else { String iccId = getIccId(phoneId); Loading Loading @@ -1572,12 +1582,6 @@ public class SubscriptionManagerService extends ISub.Stub { loge("updateSubscription: ICC card is not available."); } if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) { // Clear the cached Ims phone number // before proceeding with Ims Registration setNumberFromIms(subId, new String("")); } // Attempt to restore SIM specific settings when SIM is loaded. Bundle result = mContext.getContentResolver().call( SubscriptionManager.SIM_INFO_BACKUP_AND_RESTORE_CONTENT_URI, Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ public class SatelliteControllerTest extends TelephonyTest { @Mock private TelephonyConfigUpdateInstallReceiver mMockTelephonyConfigUpdateInstallReceiver; @Mock private SatelliteConfigParser mMockConfigParser; @Mock private SatelliteConfig mMockConfig; @Mock private DemoSimulator mMockDemoSimulator; private Semaphore mIIntegerConsumerSemaphore = new Semaphore(0); private IIntegerConsumer mIIntegerConsumer = new IIntegerConsumer.Stub() { Loading Loading @@ -475,6 +476,7 @@ public class SatelliteControllerTest extends TelephonyTest { replaceInstance(PhoneFactory.class, "sPhones", null, new Phone[]{mPhone, mPhone2}); replaceInstance(TelephonyConfigUpdateInstallReceiver.class, "sReceiverAdaptorInstance", null, mMockTelephonyConfigUpdateInstallReceiver); replaceInstance(DemoSimulator.class, "sInstance", null, mMockDemoSimulator); mServiceState2 = Mockito.mock(ServiceState.class); when(mPhone.getServiceState()).thenReturn(mServiceState); Loading Loading @@ -785,6 +787,7 @@ public class SatelliteControllerTest extends TelephonyTest { setUpResponseForRequestSatelliteEnabled(true, false, false, SATELLITE_RESULT_SUCCESS); mSatelliteControllerUT.requestSatelliteEnabled(SUB_ID, true, false, false, mIIntegerConsumer); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); processAllMessages(); assertTrue(waitForIIntegerConsumerResult(1)); assertEquals(SATELLITE_RESULT_SUCCESS, (long) mIIntegerConsumerResults.get(0)); Loading Loading @@ -1304,6 +1307,7 @@ public class SatelliteControllerTest extends TelephonyTest { .registerForSatelliteModemStateChanged(callback); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); errorCode = mSatelliteControllerUT.registerForSatelliteModemStateChanged( SUB_ID, callback); Loading @@ -1324,7 +1328,7 @@ public class SatelliteControllerTest extends TelephonyTest { .unregisterForSatelliteModemStateChanged(callback); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); mSatelliteControllerUT.unregisterForModemStateChanged(SUB_ID, callback); verify(mMockSatelliteSessionController).unregisterForSatelliteModemStateChanged(callback); } Loading Loading @@ -2250,6 +2254,7 @@ public class SatelliteControllerTest extends TelephonyTest { SATELLITE_MODEM_STATE_CONNECTED); resetSatelliteControllerUTToSupportedAndProvisionedState(); mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController); clearInvocations(mMockSatelliteSessionController); clearInvocations(mMockDatagramController); sendSatelliteModemStateChangedEvent(SATELLITE_MODEM_STATE_UNAVAILABLE, null); Loading Loading @@ -4502,5 +4507,9 @@ public class SatelliteControllerTest extends TelephonyTest { protected long getElapsedRealtime() { return elapsedRealtime; } void setSatelliteSessionController(SatelliteSessionController satelliteSessionController) { mSatelliteSessionController = satelliteSessionController; } } }