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

Commit bd174e7b authored by Chen Chen's avatar Chen Chen Committed by Gerrit Code Review
Browse files

Merge "Updateability: Resolve dependency to hidden api in AppOpsManager, use a public Api instead"

parents 02d1d1f8 a9f215cf
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ public final class Utils {
        if (context.checkCallingOrSelfPermission(
                android.Manifest.permission.ACCESS_COARSE_LOCATION)
                        == PackageManager.PERMISSION_GRANTED
                && isAppOppAllowed(appOps, AppOpsManager.OP_FINE_LOCATION, callingPackage)) {
                && isAppOppAllowed(appOps, AppOpsManager.OPSTR_FINE_LOCATION, callingPackage)) {
            return true;
        }

@@ -395,7 +395,7 @@ public final class Utils {
        if (context.checkCallingOrSelfPermission(
                android.Manifest.permission.ACCESS_FINE_LOCATION)
                        == PackageManager.PERMISSION_GRANTED
                && isAppOppAllowed(appOps, AppOpsManager.OP_FINE_LOCATION, callingPackage)) {
                && isAppOppAllowed(appOps, AppOpsManager.OPSTR_FINE_LOCATION, callingPackage)) {
            return true;
        }

@@ -403,7 +403,7 @@ public final class Utils {
        if (context.checkCallingOrSelfPermission(
                android.Manifest.permission.ACCESS_COARSE_LOCATION)
                        == PackageManager.PERMISSION_GRANTED
                && isAppOppAllowed(appOps, AppOpsManager.OP_FINE_LOCATION, callingPackage)) {
                && isAppOppAllowed(appOps, AppOpsManager.OPSTR_FINE_LOCATION, callingPackage)) {
            return true;
        }

@@ -426,7 +426,7 @@ public final class Utils {
        if (context.checkCallingOrSelfPermission(
                android.Manifest.permission.ACCESS_FINE_LOCATION)
                        == PackageManager.PERMISSION_GRANTED
                && isAppOppAllowed(appOps, AppOpsManager.OP_FINE_LOCATION, callingPackage)) {
                && isAppOppAllowed(appOps, AppOpsManager.OPSTR_FINE_LOCATION, callingPackage)) {
            return true;
        }

@@ -462,7 +462,7 @@ public final class Utils {
        return true;
    }

    private static boolean isAppOppAllowed(AppOpsManager appOps, int op, String callingPackage) {
    private static boolean isAppOppAllowed(AppOpsManager appOps, String op, String callingPackage) {
        return appOps.noteOp(op, Binder.getCallingUid(), callingPackage)
                == AppOpsManager.MODE_ALLOWED;
    }