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

Commit d480015b authored by Shubham Ajmera's avatar Shubham Ajmera Committed by Android (Google) Code Review
Browse files

Merge "Fix: handle null value for packageUsageInfo while deciding unused apps"

parents de303e7e 2e565e6d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -209,10 +209,12 @@ public class PackageManagerServiceUtils {

        // 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;
    }