summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hai Zhang <zhanghai@google.com> 2019-01-10 14:56:06 -0800
committer Hai Zhang <zhanghai@google.com> 2019-01-11 02:02:11 +0000
commit14ea9efdfefa3bac070260802afb9f68fbd43b23 (patch)
tree08039c506e567d2652cb66583b40b98075054f63
parent1bafe67c7855673c163483bedf8e304b9b75ec44 (diff)
Add ApplicationInfo.isEncrpytionAware() as a system API.
applicationInfo.isDirectBootAware() || applicationInfo.isPartiallyDirectBootAware() was used by Settings to determine whether to show a confirmation message for setting a direct boot unaware app to be some default app (e.g. SMS). Since we are moving default app into roles in PermissionController, we need this as a system API. Bug: 110557011 Bug: 122270890 Test: build Change-Id: I8bfc2b4e07239b6b9b1b9948dede3748b6ae974c
-rw-r--r--api/system-current.txt1
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java10
2 files changed, 10 insertions, 1 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 891e76480640..277b4d07ddf6 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1128,6 +1128,7 @@ package android.content {
package android.content.pm {
public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
+ method public boolean isEncryptionAware();
method public boolean isInstantApp();
field public java.lang.String credentialProtectedDataDir;
field public int targetSandboxVersion;
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 2978058b2848..576466f21bcb 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -1866,7 +1866,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_DIRECT_BOOT_AWARE) != 0;
}
- /** @hide */
+ /**
+ * Check whether the application is encryption aware.
+ *
+ * @see #isDirectBootAware()
+ * @see #isPartiallyDirectBootAware()
+ *
+ * @hide
+ */
+ @SystemApi
public boolean isEncryptionAware() {
return isDirectBootAware() || isPartiallyDirectBootAware();
}