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

Commit affd2de8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Return false instead of throwing SecurityException for revoked case" into main

parents 0cf54548 fa17ec99
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ public final class TelephonyPermissions {
        // We have READ_PHONE_STATE permission, so return true as long as the AppOps bit hasn't been
        // revoked.
        AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        return appOps.noteOp(AppOpsManager.OPSTR_READ_PHONE_STATE, uid, callingPackage,
        return appOps.noteOpNoThrow(AppOpsManager.OPSTR_READ_PHONE_STATE, uid, callingPackage,
                callingFeatureId, null) == AppOpsManager.MODE_ALLOWED;
    }

@@ -249,7 +249,7 @@ public final class TelephonyPermissions {
        // We have READ_PHONE_STATE permission, so return true as long as the AppOps bit hasn't been
        // revoked.
        AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        return appOps.noteOp(AppOpsManager.OPSTR_READ_PHONE_STATE, uid, callingPackage,
        return appOps.noteOpNoThrow(AppOpsManager.OPSTR_READ_PHONE_STATE, uid, callingPackage,
                callingFeatureId, null) == AppOpsManager.MODE_ALLOWED;
    }

@@ -521,7 +521,7 @@ public final class TelephonyPermissions {
        // We have READ_CALL_LOG permission, so return true as long as the AppOps bit hasn't been
        // revoked.
        AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        return appOps.noteOp(AppOpsManager.OPSTR_READ_CALL_LOG, uid, callingPackage,
        return appOps.noteOpNoThrow(AppOpsManager.OPSTR_READ_CALL_LOG, uid, callingPackage,
                callingPackageName, null) == AppOpsManager.MODE_ALLOWED;
    }