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

Commit f9b1e6a1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't check for changeid permissions in system server" am: 79ce5ef0...

Merge "Don't check for changeid permissions in system server" am: 79ce5ef0 am: 0075be3f am: ab9974e2

Change-Id: I9b8844cbde3c42d706c834537a33391f917f986c
parents c8047ec3 ab9974e2
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.Manifest.permission.LOG_COMPAT_CHANGE;
import static android.Manifest.permission.OVERRIDE_COMPAT_CHANGE_CONFIG;
import static android.Manifest.permission.READ_COMPAT_CHANGE_CONFIG;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Process.SYSTEM_UID;

import android.annotation.UserIdInt;
import android.app.ActivityManager;
@@ -326,6 +327,10 @@ public class PlatformCompat extends IPlatformCompat.Stub {
    }

    private void checkCompatChangeLogPermission() throws SecurityException {
        // Don't check for permissions within the system process
        if (Binder.getCallingUid() == SYSTEM_UID) {
            return;
        }
        if (mContext.checkCallingOrSelfPermission(LOG_COMPAT_CHANGE)
                != PERMISSION_GRANTED) {
            throw new SecurityException("Cannot log compat change usage");
@@ -333,6 +338,10 @@ public class PlatformCompat extends IPlatformCompat.Stub {
    }

    private void checkCompatChangeReadPermission() throws SecurityException {
        // Don't check for permissions within the system process
        if (Binder.getCallingUid() == SYSTEM_UID) {
            return;
        }
        if (mContext.checkCallingOrSelfPermission(READ_COMPAT_CHANGE_CONFIG)
                != PERMISSION_GRANTED) {
            throw new SecurityException("Cannot read compat change");
@@ -340,6 +349,10 @@ public class PlatformCompat extends IPlatformCompat.Stub {
    }

    private void checkCompatChangeOverridePermission() throws SecurityException {
        // Don't check for permissions within the system process
        if (Binder.getCallingUid() == SYSTEM_UID) {
            return;
        }
        if (mContext.checkCallingOrSelfPermission(OVERRIDE_COMPAT_CHANGE_CONFIG)
                != PERMISSION_GRANTED) {
            throw new SecurityException("Cannot override compat change");