Add null pointer check to getStopped

PackageSetting is not guaranteed to be non-null which caused test
failures. This adds a null check.

Bug: 184936704
Test: presubmit
Change-Id: Ie58ffa0d9abde5417e4db48389e526eaf43e0cf6
This commit is contained in:
Kevin Han
2021-04-21 13:00:31 -07:00
parent d560996d0f
commit 2e1192c4eb

View File

@@ -23444,7 +23444,7 @@ public class PackageManagerService extends IPackageManager.Stub
// writer
synchronized (mLock) {
final PackageSetting ps = mSettings.getPackageLPr(packageName);
if (ps.getStopped(userId) && !stopped) {
if (ps != null && ps.getStopped(userId) && !stopped) {
shouldUnhibernate = true;
}
if (!shouldFilterApplicationLocked(ps, callingUid, userId)