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

Commit 74d41538 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fixed internal service state exposed to clients" am: 1ad04fc9

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1823712

Change-Id: I14e9562030793a9692425e293e4e2c68db56784e
parents 9a17e0f0 1ad04fc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1731,7 +1731,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * version scoped to their packages
     */
    protected void notifyServiceStateChangedP(ServiceState ss) {
        AsyncResult ar = new AsyncResult(null, ss, null);
        AsyncResult ar = new AsyncResult(null, new ServiceState(ss), null);
        mServiceStateRegistrants.notifyRegistrants(ar);

        mNotifier.notifyServiceState(this);
+3 −8
Original line number Diff line number Diff line
@@ -440,7 +440,7 @@ public class ServiceStateTracker extends Handler {
                // just went from invalid to valid subId, so notify with current service
                // state in case our service state was never broadcasted (we don't notify
                // service states when the subId is invalid)
                mPhone.notifyServiceStateChanged(mSS);
                mPhone.notifyServiceStateChanged(mPhone.getServiceState());
            }

            boolean restoreSelection = !context.getResources().getBoolean(
@@ -1732,7 +1732,7 @@ public class ServiceStateTracker extends Handler {
                    mPhone.notifyPhysicalChannelConfig(list);
                    // Notify NR frequency, NR connection status or bandwidths changed.
                    if (hasChanged) {
                        mPhone.notifyServiceStateChanged(mSS);
                        mPhone.notifyServiceStateChanged(mPhone.getServiceState());
                        TelephonyMetrics.getInstance().writeServiceStateChanged(
                                mPhone.getPhoneId(), mSS);
                        mPhone.getVoiceCallSessionStats().onServiceStateChanged(mSS);
@@ -3720,12 +3720,7 @@ public class ServiceStateTracker extends Handler {
        }

        ServiceState oldMergedSS = new ServiceState(mPhone.getServiceState());

        // swap mSS and mNewSS to put new state in mSS
        ServiceState tss = mSS;
        mSS = mNewSS;
        mNewSS = tss;
        // clean slate for next time
        mSS = new ServiceState(mNewSS);
        mNewSS.setStateOutOfService();

        mCellIdentity = primaryCellIdentity;
+1 −1
Original line number Diff line number Diff line
@@ -2362,7 +2362,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                ServiceStateTracker.EVENT_POLL_STATE_CS_CELLULAR_REGISTRATION,
                new AsyncResult(sst.mPollingContext, voiceResult, null)));
        waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
        assertTrue(Arrays.equals(new int[0], sst.mSS.getCellBandwidths()));
        assertEquals(0, sst.mSS.getCellBandwidths().length);
    }

    @Test