Merge "Null check package for DexOptHelper"
This commit is contained in:
@@ -293,7 +293,8 @@ final class DexOptHelper {
|
||||
public ArraySet<String> getOptimizablePackages() {
|
||||
ArraySet<String> pkgs = new ArraySet<>();
|
||||
mPm.forEachPackageState(packageState -> {
|
||||
if (mPm.mPackageDexOptimizer.canOptimizePackage(packageState.getPkg())) {
|
||||
final AndroidPackage pkg = packageState.getPkg();
|
||||
if (pkg != null && mPm.mPackageDexOptimizer.canOptimizePackage(pkg)) {
|
||||
pkgs.add(packageState.getPackageName());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -182,7 +182,7 @@ public class PackageDexOptimizer {
|
||||
mInjector = injector;
|
||||
}
|
||||
|
||||
boolean canOptimizePackage(AndroidPackage pkg) {
|
||||
boolean canOptimizePackage(@NonNull AndroidPackage pkg) {
|
||||
// We do not dexopt a package with no code.
|
||||
// Note that the system package is marked as having no code, however we can
|
||||
// still optimize it via dexoptSystemServerPath.
|
||||
|
||||
Reference in New Issue
Block a user