Merge "Crash if lock isn't held when it should be. This will help track down any errors." into rvc-dev am: a785db5363
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11709586 Change-Id: Ie0755b48fbbe7d5172a72a9df4ff8a0b7c2935d3
This commit is contained in:
@@ -67,6 +67,7 @@ import android.location.LocationProvider;
|
||||
import android.location.LocationRequest;
|
||||
import android.location.LocationTime;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.Handler;
|
||||
@@ -1697,6 +1698,9 @@ public class LocationManagerService extends ILocationManager.Stub {
|
||||
* Note: must be constructed with lock held.
|
||||
*/
|
||||
private UpdateRecord(String provider, LocationRequest request, Receiver receiver) {
|
||||
if (Build.IS_DEBUGGABLE) {
|
||||
Preconditions.checkState(Thread.holdsLock(mLock));
|
||||
}
|
||||
mExpirationRealtimeMs = request.getExpirationRealtimeMs(SystemClock.elapsedRealtime());
|
||||
mProvider = provider;
|
||||
mRealRequest = request;
|
||||
@@ -1734,6 +1738,10 @@ public class LocationManagerService extends ILocationManager.Stub {
|
||||
* Method to be called when a record will no longer be used.
|
||||
*/
|
||||
private void disposeLocked(boolean removeReceiver) {
|
||||
if (Build.IS_DEBUGGABLE) {
|
||||
Preconditions.checkState(Thread.holdsLock(mLock));
|
||||
}
|
||||
|
||||
CallerIdentity identity = mReceiver.mCallerIdentity;
|
||||
mRequestStatistics.stopRequesting(identity.packageName, identity.featureId, mProvider);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user