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

Commit 7b24b42a authored by sivaramireddy's avatar sivaramireddy Committed by Siva Rami Reddy S (xWF)
Browse files

Update ServiceState Locally during Valid to Invalid SIM in TelephonyRegistry

Bug: 359411995
Flag: EXEMPT bug fix
Test: atest and devicetest
Change-Id: I2d6483da0b7fa35f2936ab689e819282d00c609d
parent 0601fd24
Loading
Loading
Loading
Loading
+33 −27
Original line number Diff line number Diff line
@@ -1732,9 +1732,11 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                // In the future, we can remove this logic for every notification here and add a
                // callback so listeners know when their PhoneStateListener's subId becomes invalid,
                // but for now we use the simplest fix.
                if (validatePhoneId(phoneId) && SubscriptionManager.isValidSubscriptionId(subId)) {
                if (validatePhoneId(phoneId)) {
                    mServiceState[phoneId] = state;

                    if (SubscriptionManager.isValidSubscriptionId(subId)) {

                        for (Record r : mRecords) {
                            if (VDBG) {
                                log("notifyServiceStateForSubscriber: r=" + r + " subId=" + subId
@@ -1748,7 +1750,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                                    ServiceState stateToSend;
                                    if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
                                        stateToSend = new ServiceState(state);
                                } else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
                                    } else if(checkCoarseLocationAccess(
                                            r, Build.VERSION_CODES.Q)) {
                                        stateToSend = state.createLocationInfoSanitizedCopy(false);
                                    } else {
                                        stateToSend = state.createLocationInfoSanitizedCopy(true);
@@ -1764,9 +1767,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                                }
                            }
                        }
                    }
                    else {
                        log("notifyServiceStateForSubscriber: INVALID subId=" +subId);
                    }
                } else {
                    log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId
                            + " or subId=" + subId);
                    log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId);
                }
                handleRemoveListLocked();
            }