Merge "Test for null package in isEnabledAndMatches()" into sc-dev am: 6c83011d9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14668164 Change-Id: I1cf751780b9c770f3d623582ba0eb6918d3cf5aa
This commit is contained in:
@@ -26547,11 +26547,17 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(188814480) should be able to remove the NPE check when snapshot
|
||||||
|
// "recursion" is fixed.
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabledAndMatches(ParsedMainComponent component, int flags, int userId) {
|
public boolean isEnabledAndMatches(ParsedMainComponent component, int flags, int userId) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
AndroidPackage pkg = getPackage(component.getPackageName());
|
AndroidPackage pkg = getPackage(component.getPackageName());
|
||||||
return mSettings.isEnabledAndMatchLPr(pkg, component, flags, userId);
|
if (pkg == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return mSettings.isEnabledAndMatchLPr(pkg, component, flags, userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user