summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2022-12-12 20:24:51 +0000
committer Jiakai Zhang <jiakaiz@google.com> 2022-12-12 20:31:59 +0000
commit9912ac9b910c970e645af6156fbdec09c34d0ef6 (patch)
tree40aace02d04814589b0ea5c1b3af7fd67b0cce22
parentebe0011f41d83b43321c66ed4a06e6f501bd9229 (diff)
Expose ApplicationInfo#HIDDEN_API_*.
These are the return values of PackageState#getHiddenApiEnforcementPolicy(). Bug: 236389629 Test: Presubmit Change-Id: I0a26bbb942b4f774a1b82fb3c43f1c2d551c0ffd
-rw-r--r--core/api/module-lib-current.txt4
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index 98c78fefcc60..314fd03a6991 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -99,6 +99,10 @@ package android.content.pm {
public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
method @NonNull public java.util.List<android.content.pm.SharedLibraryInfo> getSharedLibraryInfos();
+ field public static final int HIDDEN_API_ENFORCEMENT_DEFAULT = -1; // 0xffffffff
+ field public static final int HIDDEN_API_ENFORCEMENT_DISABLED = 0; // 0x0
+ field public static final int HIDDEN_API_ENFORCEMENT_ENABLED = 2; // 0x2
+ field public static final int HIDDEN_API_ENFORCEMENT_JUST_WARN = 1; // 0x1
}
public abstract class PackageManager {
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 2c28268d0772..84811ea304c6 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -1528,12 +1528,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* the application, e.g. the target SDK version.
* @hide
*/
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public static final int HIDDEN_API_ENFORCEMENT_DEFAULT = -1;
/**
* No API enforcement; the app can access the entire internal private API. Only for use by
* system apps.
* @hide
*/
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public static final int HIDDEN_API_ENFORCEMENT_DISABLED = 0;
/**
* No API enforcement, but enable the detection logic and warnings. Observed behaviour is the
@@ -1541,11 +1543,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* APIs are accessed.
* @hide
* */
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public static final int HIDDEN_API_ENFORCEMENT_JUST_WARN = 1;
/**
* Dark grey list enforcement. Enforces the dark grey and black lists
* @hide
*/
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public static final int HIDDEN_API_ENFORCEMENT_ENABLED = 2;
private static final int HIDDEN_API_ENFORCEMENT_MIN = HIDDEN_API_ENFORCEMENT_DEFAULT;