1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.pm.pkg; 18 19 import android.annotation.NonNull; 20 import android.annotation.Nullable; 21 import android.annotation.SystemApi; 22 import android.processor.immutability.Immutable; 23 24 import com.android.internal.R; 25 26 import java.util.List; 27 28 /** 29 * Representation of the parsed state of a single split APK. Note this includes the base.apk. 30 * 31 * The information here is very minimal, mostly used for loading a specific class, and most 32 * important state is collected across all splits for a package into the parent 33 * {@link AndroidPackage} values. 34 * 35 * @hide 36 */ 37 @SystemApi(client = SystemApi.Client.SYSTEM_SERVER) 38 @Immutable 39 public interface AndroidPackageSplit { 40 41 /** 42 * @return The unique name given to the split, or null if this is the base. 43 */ 44 @Nullable getName()45 String getName(); 46 47 /** 48 * @return Physical location of the split APK on disk, pointing to a single file with the .apk 49 * extension. 50 */ 51 @NonNull getPath()52 String getPath(); 53 54 /** 55 * @see R.styleable#AndroidManifest_revisionCode 56 */ getRevisionCode()57 int getRevisionCode(); 58 59 /** 60 * @see R.styleable#AndroidManifestApplication_hasCode 61 */ isHasCode()62 boolean isHasCode(); 63 64 /** 65 * @see R.styleable#AndroidManifestApplication_classLoader 66 */ 67 @Nullable getClassLoaderName()68 String getClassLoaderName(); 69 70 /** 71 * @see R.styleable#AndroidManifestUsesSplit 72 */ 73 @NonNull getDependencies()74 List<AndroidPackageSplit> getDependencies(); 75 } 76