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
(cherry picked from commit 3ee9080fb47ecb3ecb003519faf24394b8c4761e)
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index d034572..08e8e86 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -19,6 +19,8 @@
 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 static boolean isAppSuspended(ApplicationInfo info) {
-        return (info.flags & FLAG_SUSPENDED) != 0;
+        // 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;
+        }
     }
 }