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

Commit a39a8ac2 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6244512 from f29a3a34 to qt-qpr3-release

Change-Id: I7b5c5f4ffa1e582d200a064efd5af44cc8929788
parents 5490f75c f29a3a34
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -255,18 +255,6 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        }
        }
    }
    }


    @Override
    public void notifyOtaspChanged(Phone sender, int otaspMode) {
        int subId = sender.getSubId();
        try {
            if (mRegistry != null) {
                mRegistry.notifyOtaspChanged(subId, otaspMode);
            }
        } catch (RemoteException ex) {
            // system process is dead
        }
    }

    public void notifyPreciseCallState(Phone sender) {
    public void notifyPreciseCallState(Phone sender) {
        Call ringingCall = sender.getRingingCall();
        Call ringingCall = sender.getRingingCall();
        Call foregroundCall = sender.getForegroundCall();
        Call foregroundCall = sender.getForegroundCall();
+5 −0
Original line number Original line Diff line number Diff line
@@ -3440,6 +3440,11 @@ public class GsmCdmaPhone extends Phone {
        }
        }
    }
    }


    @Override
    public int getOtasp() {
        return mSST.getOtasp();
    }

    @Override
    @Override
    public int getCdmaEriIconIndex() {
    public int getCdmaEriIconIndex() {
        if (isPhoneTypeGsm()) {
        if (isPhoneTypeGsm()) {
+39 −1
Original line number Original line Diff line number Diff line
@@ -380,6 +380,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {


    private final RegistrantList mCellInfoRegistrants = new RegistrantList();
    private final RegistrantList mCellInfoRegistrants = new RegistrantList();


    private final RegistrantList mOtaspRegistrants = new RegistrantList();

    protected Registrant mPostDialHandler;
    protected Registrant mPostDialHandler;


    protected final LocalLog mLocalLog;
    protected final LocalLog mLocalLog;
@@ -2356,7 +2358,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {


    @UnsupportedAppUsage
    @UnsupportedAppUsage
    public void notifyOtaspChanged(int otaspMode) {
    public void notifyOtaspChanged(int otaspMode) {
        mNotifier.notifyOtaspChanged(this, otaspMode);
        mOtaspRegistrants.notifyRegistrants(new AsyncResult(null, otaspMode, null));
    }
    }


    public void notifyVoiceActivationStateChanged(int state) {
    public void notifyVoiceActivationStateChanged(int state) {
@@ -2753,6 +2755,42 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return false;
        return false;
    }
    }


    /**
     * Register for notifications when OTA Service Provisioning mode has changed.
     *
     * <p>The mode is integer. {@link TelephonyManager#OTASP_UNKNOWN}
     * means the value is currently unknown and the system should wait until
     * {@link TelephonyManager#OTASP_NEEDED} or {@link TelephonyManager#OTASP_NOT_NEEDED} is
     * received before making the decision to perform OTASP or not.
     *
     * @param h Handler that receives the notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    public void registerForOtaspChange(Handler h, int what, Object obj) {
        checkCorrectThread(h);
        mOtaspRegistrants.addUnique(h, what, obj);
        // notify first
        new Registrant(h, what, obj).notifyRegistrant(new AsyncResult(null, getOtasp(), null));
    }

    /**
     * Unegister for notifications when OTA Service Provisioning mode has changed.
     * @param h Handler to be removed from the registrant list.
     */
    public void unregisterForOtaspChange(Handler h) {
        mOtaspRegistrants.remove(h);
    }

    /**
     * Returns the current OTA Service Provisioning mode.
     *
     * @see registerForOtaspChange
     */
    public int getOtasp() {
        return TelephonyManager.OTASP_UNKNOWN;
    }

    /**
    /**
     * Register for notifications when CDMA call waiting comes
     * Register for notifications when CDMA call waiting comes
     *
     *
+0 −2
Original line number Original line Diff line number Diff line
@@ -54,8 +54,6 @@ public interface PhoneNotifier {


    void notifyDataActivity(Phone sender);
    void notifyDataActivity(Phone sender);


    void notifyOtaspChanged(Phone sender, int otaspMode);

    void notifyCellInfo(Phone sender, List<CellInfo> cellInfo);
    void notifyCellInfo(Phone sender, List<CellInfo> cellInfo);


    /** Notify of change to PhysicalChannelConfiguration. */
    /** Notify of change to PhysicalChannelConfiguration. */
+0 −11
Original line number Original line Diff line number Diff line
@@ -265,15 +265,4 @@ public class DefaultPhoneNotifierTest extends TelephonyTest {
        assertEquals(3, cellLocationCapture.getValue().getInt("cid"));
        assertEquals(3, cellLocationCapture.getValue().getInt("cid"));
        assertEquals(5, cellLocationCapture.getValue().getInt("psc"));
        assertEquals(5, cellLocationCapture.getValue().getInt("psc"));
    }
    }

    @Test @SmallTest
    public void testNotifyOtaspChanged() throws Exception {
        mDefaultPhoneNotifierUT.notifyOtaspChanged(mPhone, TelephonyManager.OTASP_NEEDED);
        verify(mTelephonyRegisteryMock).notifyOtaspChanged(eq(mPhone.getSubId()),
                eq(TelephonyManager.OTASP_NEEDED));

        mDefaultPhoneNotifierUT.notifyOtaspChanged(mPhone, TelephonyManager.OTASP_UNKNOWN);
        verify(mTelephonyRegisteryMock).notifyOtaspChanged(eq(mPhone.getSubId()),
                eq(TelephonyManager.OTASP_UNKNOWN));
    }
}
}