privatestaticvoid test(ClassLoader loader, boolean expectedHasVdexFile, boolean expectedBackedByOat, boolean invokeMethod) throws Exception { // If ART created a vdex file, it must have verified all the classes. // That happens if and only if we expect a vdex at the end of the test but // do not expect it to have been loaded. boolean expectedClassesVerified = expectedHasVdexFile && !expectedBackedByOat;
// Feature is disabled in debuggable mode because runtime threads are not // allowed to load classes. boolean featureEnabled = !isDebuggable();
// SDK version not set. Background verification job should not have run // and vdex should not have been created.
test(singleLoader(), /*hasVdex*/ false, /*backedByOat*/ false, /*invokeMethod*/ true);
// Feature only enabled for target SDK version Q and later.
setTargetSdkVersion(/* Q */ 29);
// SDK version directory is now set. Background verification job should have run, // should have verified classes and written results to a vdex.
test(singleLoader(), /*hasVdex*/ featureEnabled, /*backedByOat*/ false, /*invokeMethod*/ true);
test(singleLoader(), /*hasVdex*/ featureEnabled, /*backedByOat*/ featureEnabled, /*invokeMethod*/ true);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.