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

Commit d608fcc4 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Use Runnables in android/Telecom correctly

Updates Telecom to use the new android.telecom.Runnable changes in
frameworks/base.

Bug: 26571395
Test: All affected tests pass
Change-Id: I401e5d0a53e7aa13b8190960898797386717e2ac
parent fbe4cadf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public class BluetoothManager {

    private BluetoothHeadsetProxy mBluetoothHeadset;
    private long mBluetoothConnectionRequestTime;
    private final Runnable mBluetoothConnectionTimeout = new Runnable("BM.cBA") {
    private final Runnable mBluetoothConnectionTimeout = new Runnable("BM.cBA", null /*lock*/) {
        @Override
        public void loggedRun() {
            if (!isBluetoothAudioConnected()) {
@@ -134,7 +134,7 @@ public class BluetoothManager {
        }
    };

    private final Runnable mRetryConnectAudio = new Runnable("BM.rCA") {
    private final Runnable mRetryConnectAudio = new Runnable("BM.rCA", null /*lock*/) {
        @Override
        public void loggedRun() {
            Log.i(this, "Retrying connecting to bluetooth audio.");
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public class CallerInfoLookupHelper {
            }
        }

        mHandler.post(new Runnable("CILH.sL") {
        mHandler.post(new Runnable("CILH.sL", mLock) {
            @Override
            public void loggedRun() {
                Session continuedSession = Log.createSubsession();
@@ -163,7 +163,7 @@ public class CallerInfoLookupHelper {
    }

    private void startPhotoLookup(final Uri handle, final Uri contactPhotoUri) {
        mHandler.post(new Runnable("CILH.sPL") {
        mHandler.post(new Runnable("CILH.sPL", mLock) {
            @Override
            public void loggedRun() {
                Session continuedSession = Log.createSubsession();
+8 −13
Original line number Diff line number Diff line
@@ -446,16 +446,13 @@ public class CallsManager extends Call.ListenerBase

            mDtmfLocalTonePlayer.playTone(call, nextChar);

            // TODO: Create a LockedRunnable class that does the synchronization automatically.
            mStopTone = new Runnable("CM.oPDC") {
            mStopTone = new Runnable("CM.oPDC", mLock) {
                @Override
                public void loggedRun() {
                    synchronized (mLock) {
                    // Set a timeout to stop the tone in case there isn't another tone to
                    // follow.
                    mDtmfLocalTonePlayer.stopTone(call);
                }
                }
            };
            mHandler.postDelayed(mStopTone.prepare(),
                    Timeouts.getDelayBetweenDtmfTonesMillis(mContext.getContentResolver()));
@@ -508,16 +505,14 @@ public class CallsManager extends Call.ListenerBase
    @Override
    public boolean onCanceledViaNewOutgoingCallBroadcast(final Call call) {
        mPendingCallsToDisconnect.add(call);
        mHandler.postDelayed(new Runnable("CM.oCVNOCB") {
        mHandler.postDelayed(new Runnable("CM.oCVNOCB", mLock) {
            @Override
            public void loggedRun() {
                synchronized (mLock) {
                if (mPendingCallsToDisconnect.remove(call)) {
                    Log.i(this, "Delayed disconnection of call: %s", call);
                    call.disconnect();
                }
            }
            }
        }.prepare(), Timeouts.getNewOutgoingCallCancelMillis(mContext.getContentResolver()));

        return true;
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ final class CreateConnectionTimeout extends Runnable {

    CreateConnectionTimeout(Context context, PhoneAccountRegistrar phoneAccountRegistrar,
            ConnectionServiceWrapper service, Call call) {
        super("CCT");
        super("CCT", null /*lock*/);
        mContext = context;
        mPhoneAccountRegistrar = phoneAccountRegistrar;
        mConnectionService = service;
+4 −6
Original line number Diff line number Diff line
@@ -606,16 +606,14 @@ public final class InCallController extends CallsManagerListenerBase {
             *  give them enough time to process all the pending messages.
             */
            Handler handler = new Handler(Looper.getMainLooper());
            handler.postDelayed(new Runnable("ICC.oCR") {
            handler.postDelayed(new Runnable("ICC.oCR", mLock) {
                @Override
                public void loggedRun() {
                    synchronized (mLock) {
                    // Check again to make sure there are no active calls.
                    if (mCallsManager.getCalls().isEmpty()) {
                        unbindFromServices();
                    }
                }
                }
            }.prepare(), Timeouts.getCallRemoveUnbindInCallServicesDelay(
                            mContext.getContentResolver()));
        }
Loading