Merge "Test for null package in isEnabledAndMatches()" into sc-dev
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