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

Commit 1427b33d authored by Cheney Ni's avatar Cheney Ni
Browse files

Revert "Do not use hidden noteOpNoThrow"

This reverts commit 2290df31.

Bug: 145257921
Reason for revert: Droidcop-triggered revert due to breakage, bug 145257921.

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


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