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

Commit c923ec0f authored by Hall Liu's avatar Hall Liu
Browse files

Revert "[Telephony] PhoneStateListener redesign"

Revert submission 12947610-PhoneStateListener_Redesign

Reason for revert: Multiple test failures: b/173726360, b/173724464, b/173722831
Reverted Changes:
Id69d2b2e7:[Telephony] PhoneStateListener redesign - remove L...
I210f371ed:[Telephony] PhoneStateListener redesign - cts test...
I97e93707f:[Telephony] PhoneStateListener redesign - cts test...
Ibdbaa7d65:[Telephony] PhoneStateListener redesign - cts test...
I5ed16d700:[Telephony] PhoneStateListener redesign - cts test...
I40cc4c234:[Telephony] PhoneStateListener redesign for new ev...
Idd69f5e48:[Telephony] PhoneStateListener redesign
I827471472:[Telephony] PhoneStateListener redesign - cts test...

Change-Id: If26b84e4c80964fbf10b37ebc8123dc2981baa12
parent ccd0aae7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -237,10 +237,10 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    @Override
    public void notifyPhysicalChannelConfig(Phone sender,
    public void notifyPhysicalChannelConfiguration(Phone sender,
                                                   List<PhysicalChannelConfig> configs) {
        int subId = sender.getSubId();
        mTelephonyRegistryMgr.notifyPhysicalChannelConfigForSubscriber(subId, configs);
        mTelephonyRegistryMgr.notifyPhysicalChannelConfigurationForSubscriber(subId, configs);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -2624,7 +2624,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    /** Notify {@link PhysicalChannelConfig} changes. */
    public void notifyPhysicalChannelConfig(List<PhysicalChannelConfig> configs) {
    public void notifyPhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) {
        mPhysicalChannelConfigRegistrants.notifyRegistrants(new AsyncResult(null, configs, null));
    }

+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public interface PhoneNotifier {
    /** Notify barring info has changed */
    void notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo);

    /** Notify PhysicalChannelConfig has changed. */
    void notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs);
    /** Notify of change to PhysicalChannelConfiguration. */
    void notifyPhysicalChannelConfiguration(Phone sender, List<PhysicalChannelConfig> configs);

}
+1 −1
Original line number Diff line number Diff line
@@ -1655,7 +1655,7 @@ public class ServiceStateTracker extends Handler {
                        log("EVENT_PHYSICAL_CHANNEL_CONFIG: size=" + list.size() + " list="
                                + list);
                    }
                    mPhone.notifyPhysicalChannelConfig(list);
                    mPhone.notifyPhysicalChannelConfiguration(list);
                    mLastPhysicalChannelConfigList = list;
                    boolean hasChanged = false;
                    if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) {
+29 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ public class PhoneStateListenerTest extends TelephonyTest {
    private boolean mUserMobileDataState = false;
    private EmergencyNumber mCalledEmergencyNumber;
    private EmergencyNumber mTextedEmergencyNumber;
    private List<PhysicalChannelConfig> mPhysicalChannelConfigs;


    @Before
    public void setUp() throws Exception {
@@ -75,6 +77,12 @@ public class PhoneStateListenerTest extends TelephonyTest {
                logd("OutgoingSmsEmergencyNumber Changed");
                mTextedEmergencyNumber = emergencyNumber;
            }

            @Override
            public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) {
                logd("PhysicalChannelConfig Changed");
                mPhysicalChannelConfigs = configs;
            }
        };
        processAllMessages();
    }
@@ -158,4 +166,25 @@ public class PhoneStateListenerTest extends TelephonyTest {

        assertTrue(mTextedEmergencyNumber.equals(emergencyNumber));
    }

    @Test @SmallTest
    public void testTriggerPhysicalChannelConfigurationChanged() throws Exception {
        Field field = PhoneStateListener.class.getDeclaredField("callback");
        field.setAccessible(true);

        assertNull(mPhysicalChannelConfigs);

        PhysicalChannelConfig config = new PhysicalChannelConfig.Builder()
                .setCellConnectionStatus(PhysicalChannelConfig.CONNECTION_PRIMARY_SERVING)
                .setCellBandwidthDownlinkKhz(20000 /* bandwidth */)
                .build();

        List<PhysicalChannelConfig> configs = Collections.singletonList(config);

        ((IPhoneStateListener) field.get(mPhoneStateListenerUT))
                .onPhysicalChannelConfigurationChanged(configs);
        processAllMessages();

        assertTrue(mPhysicalChannelConfigs.equals(configs));
    }
}
Loading