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

Commit 3ee9080f authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix incorrect icon greying on pre-N system

The flag we check for package suspension is reused by a hidden constant
prior to N, so the flag should only be checked on N or later system.

Bug: 28390176
Change-Id: Ia28f62991cc2cd1b5d2cc27a5f11f7edca0ba02b
parent e81ba18a
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.launcher3.util;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

import com.android.launcher3.Utilities;

/**
 * Utility methods using package manager
 */
@@ -57,6 +59,13 @@ public class PackageManagerHelper {
    }

    public static boolean isAppSuspended(ApplicationInfo info) {
        // The value of FLAG_SUSPENDED was reused by a hidden constant
        // ApplicationInfo.FLAG_PRIVILEGED prior to N, so only check for suspended flag on N
        // or later.
        if (Utilities.isNycOrAbove()) {
            return (info.flags & FLAG_SUSPENDED) != 0;
        } else {
            return false;
        }
    }
}