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

Commit bbe4381b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Crash if lock isn't held when it should be. This will help track down...

Merge "Crash if lock isn't held when it should be. This will help track down any errors." into rvc-dev am: a785db53 am: fc60e98b am: fdf86170 am: 2d745961

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11709586

Change-Id: Icb00b9f2723d4dc2f0abb3bdece655ef0d8a8d86
parents cc2a07ca 2d745961
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import android.location.LocationTime;
import android.location.util.identity.CallerIdentity;
import android.location.util.identity.CallerIdentity.PermissionLevel;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Handler;
@@ -1679,6 +1680,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;
@@ -1716,6 +1720,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.attributionTag,
                    mProvider);