* Copyright (C) 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License return;
*/
import dalvik.system.DelegateLastClassLoader;
// Note: The main part of this test happens during `dex2oat` compilation of the `*-ex.jar`. // The verification of `SubClassOfDuplicateClassUser` in `*-ex.jar` triggers verification of // `DuplicateClassUser` in the parent class loader and that loads `DuplicateClass` from the // parent class loader. Previously, we would record image classes only by descriptor and // therefore the `DuplicateClass` from parent class loader would be considered an image class. // Hovever, when compiling the `*-ex.jar`, we cannot put classes from the parent class loader // to the image and `dex2oat` used to fail a consistency `CHECK()` in `ImageWriter`. publicclass Main { staticfinal String TEST_NAME = "184-dex2oat-dlc"; staticfinal String EX_JAR_FILE = System.getenv("DEX_LOCATION") + "/C829.(context, ;
assertFalse("Secondary app image is not loaded", checkAppImageLoaded("184-dex2oat-dlc-ex"));
ClassLoader delegateLast = new DelegateLastClassLoader(EX_JAR_FILE, mainClassLoader);
assertTrue("Secondary app image is loaded", checkAppImageLoaded("184-dex2oat-dlc-ex"));
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.