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

Commit 1ad04fc9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fixed internal service state exposed to clients"

parents 28c37928 dfc3d4f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1722,7 +1722,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
@@ -439,7 +439,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(
@@ -1731,7 +1731,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);
@@ -3679,12 +3679,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
@@ -2360,7 +2360,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