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

Commit 2290df31 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Do not use hidden noteOpNoThrow

Use system api version of noteOpNoThrow

Bug: 137202333
Test: unit test
Change-Id: I8ddadaa517b77a911f40d3969b0b0980a87adf9f
parent 20fcf047
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -206,8 +206,8 @@ public final class LocationAccessPolicy {
        if (hasManifestPermission) {
            // Only check the app op if the app has the permission.
            int appOpMode = context.getSystemService(AppOpsManager.class)
                    .noteOpNoThrow(AppOpsManager.permissionToOpCode(permissionToCheck),
                            query.callingUid, query.callingPackage, query.callingFeatureId, null);
                    .noteOpNoThrow(permissionToCheck, query.callingUid, query.callingPackage,
                            query.callingFeatureId, null);
            if (appOpMode == AppOpsManager.MODE_ALLOWED) {
                // If the app did everything right, return without logging.
                return LocationPermissionResult.ALLOWED;
@@ -265,7 +265,7 @@ public final class LocationAccessPolicy {
        // Do the check for fine, then for coarse.
        if (query.minSdkVersionForFine < Integer.MAX_VALUE) {
            LocationPermissionResult resultForFine = checkAppLocationPermissionHelper(
                    context, query, Manifest.permission.ACCESS_FINE_LOCATION);
                    context, query, AppOpsManager.OPSTR_FINE_LOCATION);
            if (resultForFine != null) {
                return resultForFine;
            }
@@ -273,7 +273,7 @@ public final class LocationAccessPolicy {

        if (query.minSdkVersionForCoarse < Integer.MAX_VALUE) {
            LocationPermissionResult resultForCoarse = checkAppLocationPermissionHelper(
                    context, query, Manifest.permission.ACCESS_COARSE_LOCATION);
                    context, query, AppOpsManager.OPSTR_COARSE_LOCATION);
            if (resultForCoarse != null) {
                return resultForCoarse;
            }