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

Commit 98c16464 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

Change-Id: Ie9f6bf7be41826da6e49044f0d258e4df0a069ce
parents 3878dd4d 45b8146a
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;
            }
        }