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
This commit is contained in:
Hai Zhang
2019-01-10 14:56:06 -08:00
parent 1bafe67c78
commit 14ea9efdfe
2 changed files with 10 additions and 1 deletions

View File

@@ -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;

View File

@@ -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();
}