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

Commit 4ec5b2f0 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Quick fix for possible deadlock in LMS" into rvc-dev am: 45b8146a am: 98c16464

Change-Id: I9ef9324125f29405b985b88167fe18e0cb37e748
parents 47521236 98c16464
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -2562,7 +2562,9 @@ public class LocationManager {
            mRemoteCancellationSignal = remoteCancellationSignal;
        }

        public synchronized void cancel() {
        public void cancel() {
            ICancellationSignal cancellationSignal;
            synchronized (this) {
                mExecutor = null;
                mConsumer = null;

@@ -2571,13 +2573,17 @@ public class LocationManager {
                    mAlarmManager = null;
                }

            if (mRemoteCancellationSignal != null) {
                // ensure only one cancel event will go through
                cancellationSignal = mRemoteCancellationSignal;
                mRemoteCancellationSignal = null;
            }

            if (cancellationSignal != null) {
                try {
                    mRemoteCancellationSignal.cancel();
                    cancellationSignal.cancel();
                } catch (RemoteException e) {
                    // ignore
                }
                mRemoteCancellationSignal = null;
            }
        }