Handle variable class loader context for system server
Do not dexopt system server dex files which have a variable class-loader context. We could extract them but that will interfer with ZygoteInit code which will try to verify them again. As part of this change, also improve PackageDexOptimizer error handling, logging wtf message when we cannot retrieve the dexoptStatus. Test: manual Bug: 154789494 Change-Id: I8a8181ce637b13e5cab10267c50c0dccb187b15b
This commit is contained in:
@@ -725,6 +725,9 @@ public class PackageDexOptimizer {
|
||||
} catch (IOException ioe) {
|
||||
Slog.w(TAG, "IOException reading apk: " + path, ioe);
|
||||
return DEX_OPT_FAILED;
|
||||
} catch (Exception e) {
|
||||
Slog.wtf(TAG, "Unexpected exception when calling dexoptNeeded on " + path, e);
|
||||
return DEX_OPT_FAILED;
|
||||
}
|
||||
return adjustDexoptNeeded(dexoptNeeded);
|
||||
}
|
||||
|
||||
@@ -548,6 +548,16 @@ public class DexManager {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dexUseInfo.isUnsupportedClassLoaderContext()
|
||||
|| dexUseInfo.isVariableClassLoaderContext()) {
|
||||
String debugMsg = dexUseInfo.isUnsupportedClassLoaderContext()
|
||||
? "unsupported"
|
||||
: "variable";
|
||||
Slog.w(TAG, "Skipping dexopt for system server path loaded with " + debugMsg
|
||||
+ " class loader context: " + dexPath);
|
||||
continue;
|
||||
}
|
||||
|
||||
int newResult = pdo.dexoptSystemServerPath(dexPath, dexUseInfo, overriddenOptions);
|
||||
|
||||
// The end result is:
|
||||
|
||||
Reference in New Issue
Block a user