Replaced Utilities.isNycOrAbove() with version code check.

- Instead of using reflection to check if N is present, we now use
  Build.VERSION.SDK_INT >= Build.VERSION_CODES.N.
- Other places that used reflection to use N APIs have also been
  cleaned up.

Bug: 22942492
Change-Id: Ia7b981cae375e800bcc8f0c54aec48e0c8c076da
This commit is contained in:
Tony Wickham
2016-05-15 16:39:26 -07:00
parent d140f3c77a
commit fd309fbf9f
9 changed files with 40 additions and 73 deletions
@@ -62,7 +62,7 @@ public class PackageManagerHelper {
// 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()) {
if (Utilities.ATLEAST_N) {
return (info.flags & FLAG_SUSPENDED) != 0;
} else {
return false;