Merge "Quick fix for possible deadlock in LMS" into rvc-dev am: 45b8146ae8
Change-Id: Ie9f6bf7be41826da6e49044f0d258e4df0a069ce
This commit is contained in:
@@ -2562,7 +2562,9 @@ public class LocationManager {
|
|||||||
mRemoteCancellationSignal = remoteCancellationSignal;
|
mRemoteCancellationSignal = remoteCancellationSignal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void cancel() {
|
public void cancel() {
|
||||||
|
ICancellationSignal cancellationSignal;
|
||||||
|
synchronized (this) {
|
||||||
mExecutor = null;
|
mExecutor = null;
|
||||||
mConsumer = null;
|
mConsumer = null;
|
||||||
|
|
||||||
@@ -2571,13 +2573,17 @@ public class LocationManager {
|
|||||||
mAlarmManager = null;
|
mAlarmManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRemoteCancellationSignal != null) {
|
// ensure only one cancel event will go through
|
||||||
|
cancellationSignal = mRemoteCancellationSignal;
|
||||||
|
mRemoteCancellationSignal = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cancellationSignal != null) {
|
||||||
try {
|
try {
|
||||||
mRemoteCancellationSignal.cancel();
|
cancellationSignal.cancel();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
mRemoteCancellationSignal = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user