* ApplicationInfo will be null in this case, skip the legacyApp
check to avoid crashing of system_server.
Change-Id: Ifcbc2528a6d0e9e6bd5df1ad4fcd8d65341ce052
}
boolean legacyApp = false;
- if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {
- legacyApp = true;
- } else if ("com.google.android.apps.enterprise.dmagent".equals(ai.packageName)
- && ai.versionCode == 697) {
- // TODO: STOPSHIP remove this (revert ag/895987) once a new prebuilt is dropped
- legacyApp = true;
+ if (ai != null) {
+ if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {
+ legacyApp = true;
+ } else if ("com.google.android.apps.enterprise.dmagent".equals(ai.packageName)
+ && ai.versionCode == 697) {
+ // TODO: STOPSHIP remove this (revert ag/895987) once a new prebuilt is dropped
+ legacyApp = true;
+ }
}
final int rawStatus = getEncryptionStatus();