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

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

Merge "Workaround undocumented AppOps behavior" into sc-v2-dev am: ef968723

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

Change-Id: I5f488b93d7f84298afc9874f179eefa2bb4920b4
parents 0cc8467c ef968723
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -131,8 +131,8 @@ public class GeofenceManager extends
            return mPermitted;
        }

        boolean onLocationPermissionsChanged(String packageName) {
            if (getIdentity().getPackageName().equals(packageName)) {
        boolean onLocationPermissionsChanged(@Nullable String packageName) {
            if (packageName == null || getIdentity().getPackageName().equals(packageName)) {
                return onLocationPermissionsChanged();
            }

@@ -242,7 +242,7 @@ public class GeofenceManager extends
            mLocationPermissionsListener =
            new LocationPermissionsHelper.LocationPermissionsListener() {
                @Override
                public void onLocationPermissionsChanged(String packageName) {
                public void onLocationPermissionsChanged(@Nullable String packageName) {
                    GeofenceManager.this.onLocationPermissionsChanged(packageName);
                }

@@ -494,7 +494,7 @@ public class GeofenceManager extends
        updateRegistrations(registration -> registration.getIdentity().getUserId() == userId);
    }

    void onLocationPermissionsChanged(String packageName) {
    void onLocationPermissionsChanged(@Nullable String packageName) {
        updateRegistrations(registration -> registration.onLocationPermissionsChanged(packageName));
    }

+4 −4
Original line number Diff line number Diff line
@@ -119,8 +119,8 @@ public abstract class GnssListenerMultiplexer<TRequest, TListener extends IInter
         */
        protected void onGnssListenerUnregister() {}

        boolean onLocationPermissionsChanged(String packageName) {
            if (getIdentity().getPackageName().equals(packageName)) {
        boolean onLocationPermissionsChanged(@Nullable String packageName) {
            if (packageName == null || getIdentity().getPackageName().equals(packageName)) {
                return onLocationPermissionsChanged();
            }

@@ -197,7 +197,7 @@ public abstract class GnssListenerMultiplexer<TRequest, TListener extends IInter
            mLocationPermissionsListener =
            new LocationPermissionsHelper.LocationPermissionsListener() {
                @Override
                public void onLocationPermissionsChanged(String packageName) {
                public void onLocationPermissionsChanged(@Nullable String packageName) {
                    GnssListenerMultiplexer.this.onLocationPermissionsChanged(packageName);
                }

@@ -390,7 +390,7 @@ public abstract class GnssListenerMultiplexer<TRequest, TListener extends IInter
        updateRegistrations(registration -> registration.getIdentity().getUserId() == userId);
    }

    private void onLocationPermissionsChanged(String packageName) {
    private void onLocationPermissionsChanged(@Nullable String packageName) {
        updateRegistrations(registration -> registration.onLocationPermissionsChanged(packageName));
    }

+4 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.location.injector;

import static com.android.server.location.LocationPermissions.PERMISSION_NONE;

import android.annotation.Nullable;
import android.location.util.identity.CallerIdentity;

import com.android.server.location.LocationPermissions;
@@ -36,9 +37,10 @@ public abstract class LocationPermissionsHelper {
    public interface LocationPermissionsListener {

        /**
         * Called when something has changed about location permissions for the given package.
         * Called when something has changed about location permissions for the given package. A
         * null package indicates this affects every package.
         */
        void onLocationPermissionsChanged(String packageName);
        void onLocationPermissionsChanged(@Nullable String packageName);

        /**
         * Called when something has changed about location permissions for the given uid.
+4 −4
Original line number Diff line number Diff line
@@ -528,8 +528,8 @@ public class LocationProviderManager extends
        }

        @GuardedBy("mLock")
        final boolean onLocationPermissionsChanged(String packageName) {
            if (getIdentity().getPackageName().equals(packageName)) {
        final boolean onLocationPermissionsChanged(@Nullable String packageName) {
            if (packageName == null || getIdentity().getPackageName().equals(packageName)) {
                return onLocationPermissionsChanged();
            }

@@ -1373,7 +1373,7 @@ public class LocationProviderManager extends
    private final LocationPermissionsListener mLocationPermissionsListener =
            new LocationPermissionsListener() {
                @Override
                public void onLocationPermissionsChanged(String packageName) {
                public void onLocationPermissionsChanged(@Nullable String packageName) {
                    LocationProviderManager.this.onLocationPermissionsChanged(packageName);
                }

@@ -2366,7 +2366,7 @@ public class LocationProviderManager extends
        }
    }

    private void onLocationPermissionsChanged(String packageName) {
    private void onLocationPermissionsChanged(@Nullable String packageName) {
        synchronized (mLock) {
            updateRegistrations(
                    registration -> registration.onLocationPermissionsChanged(packageName));