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

Commit 60058085 authored by Arthur Ishiguro's avatar Arthur Ishiguro Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add logic to use system server UID for noteOp call""

parents c6687b4b 2b82359a
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -605,9 +605,6 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
        for (String permission : permissions) {
            int opCode = mAppOpsManager.permissionToOpCode(permission);
            if (opCode != AppOpsManager.OP_NONE) {
                // The noteOp call may check for required permissions. Use the below logic to ensure
                // that the system server permission is enforced at the call.
                long token = Binder.setCallingWorkSourceUid(android.os.Process.myUid());
                try {
                    if (mAppOpsManager.noteOp(opCode, mUid, mPackage, mAttributionTag, noteMessage)
                            != AppOpsManager.MODE_ALLOWED) {
@@ -617,8 +614,6 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
                    Log.e(TAG, "SecurityException: noteOp for pkg " + mPackage + " opcode "
                            + opCode + ": " + e.getMessage());
                    return false;
                } finally {
                    Binder.restoreCallingWorkSource(token);
                }
            }
        }