Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 848a8e44 authored by joonhunshin's avatar joonhunshin
Browse files

Change the time of function call to clear IMS phone number

Bug: 335431779
Test: atest ImsPhoneTest, ImsServiceTest
Change-Id: I48d32ea02c207786600c5929162a4a0e467c4bd3
parent 7197c19d
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -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.
@@ -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);
@@ -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,