From 14ea9efdfefa3bac070260802afb9f68fbd43b23 Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Thu, 10 Jan 2019 14:56:06 -0800 Subject: [PATCH] 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 --- api/system-current.txt | 1 + core/java/android/content/pm/ApplicationInfo.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api/system-current.txt b/api/system-current.txt index 891e76480640a..277b4d07ddf6a 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 2978058b28488..576466f21bcb7 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(); }