Bug:
36598475
Test: Verified for AOSP calculator
Change-Id: I86633a729ae34c621f9026fcf0486f2c0a5c7e4c
// If the app was active in background during the threshold period and was used
// by other packages.
+ // If packageUseInfo is null, it can be said that the package was not used by other
+ // packages.
boolean isActiveInBackgroundAndUsedByOtherPackages = ((currentTimeInMillis
- latestPackageUseTimeInMillis)
< thresholdTimeinMillis)
- && packageUseInfo.isUsedByOtherApps();
+ && (packageUseInfo != null && packageUseInfo.isUsedByOtherApps());
return !isActiveInBackgroundAndUsedByOtherPackages;
}