• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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.parsing.pkg;
18 
19 import android.annotation.Nullable;
20 import android.content.pm.ApplicationInfo;
21 import android.content.pm.PackageInfo;
22 
23 /**
24  * Methods that normal consumers should not have access to. This usually means the field is stateful
25  * or deprecated and should be access through {@link AndroidPackageUtils} or a system manager
26  * class.
27  * <p>
28  * This is a separate interface, not implemented by the base {@link AndroidPackage} because Java
29  * doesn't support non-public interface methods. The class must be cast to this interface.
30  * <p>
31  * Because they exist in different packages, some methods are duplicated from
32  * android.content.pm.parsing.ParsingPackageHidden.
33  */
34 interface AndroidPackageHidden {
35 
36     /**
37      * @see ApplicationInfo#primaryCpuAbi
38      */
39     @Nullable
getPrimaryCpuAbi()40     String getPrimaryCpuAbi();
41 
42     /**
43      * @see ApplicationInfo#seInfo
44      * TODO: This field is deriveable and might not have to be cached here.
45      */
46     @Nullable
getSeInfo()47     String getSeInfo();
48 
49     /**
50      * @see ApplicationInfo#secondaryCpuAbi
51      */
52     @Nullable
getSecondaryCpuAbi()53     String getSecondaryCpuAbi();
54 
55     /**
56      * @see PackageInfo#versionCode
57      * @see ApplicationInfo#versionCode
58      */
59     @Deprecated
getVersionCode()60     int getVersionCode();
61 
62     /**
63      * @see PackageInfo#versionCodeMajor
64      */
getVersionCodeMajor()65     int getVersionCodeMajor();
66 
67     // TODO(b/135203078): Hide and enforce going through PackageInfoUtils
toAppInfoWithoutState()68     ApplicationInfo toAppInfoWithoutState();
69 }
70