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

Commit 24cd7b03 authored by Todd Kennedy's avatar Todd Kennedy Committed by Android Git Automerger
Browse files

am f29c4a07: Merge "Add getPackageImportance() system API" into mnc-dev

* commit 'f29c4a07':
  Add getPackageImportance() system API
parents e5ab13b6 f29c4a07
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ package android {
    field public static final java.lang.String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES";
    field public static final java.lang.String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
    field public static final java.lang.String GET_APP_OPS_STATS = "android.permission.GET_APP_OPS_STATS";
    field public static final java.lang.String GET_PACKAGE_IMPORTANCE = "android.permission.GET_PACKAGE_IMPORTANCE";
    field public static final java.lang.String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE";
    field public static final deprecated java.lang.String GET_TASKS = "android.permission.GET_TASKS";
    field public static final java.lang.String GET_TOP_ACTIVITY_INFO = "android.permission.GET_TOP_ACTIVITY_INFO";
+5 −0
Original line number Diff line number Diff line
@@ -1340,6 +1340,11 @@
        android:description="@string/permdesc_killBackgroundProcesses"
        android:protectionLevel="normal" />

    <!-- @SystemApi @hide Allows an application to retrieve a package's importance.
         This permission is not available to third party applications. -->
    <permission android:name="android.permission.GET_PACKAGE_IMPORTANCE"
        android:protectionLevel="signature|system" />

    <!-- ================================== -->
    <!-- Permissions affecting the display of other applications  -->
    <!-- ================================== -->
+2 −0
Original line number Diff line number Diff line
@@ -3589,6 +3589,8 @@ public final class ActivityManagerService extends ActivityManagerNative
    @Override
    public int getPackageProcessState(String packageName) {
        enforceCallingPermission(android.Manifest.permission.GET_PACKAGE_IMPORTANCE,
                "getPackageProcessState");
        int procState = ActivityManager.PROCESS_STATE_NONEXISTENT;
        synchronized (this) {
            for (int i=mLruProcesses.size()-1; i>=0; i--) {