diff options
author | Jeff Sharkey <jsharkey@android.com> | 2016-07-27 12:53:34 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2016-07-27 14:49:34 -0600 |
commit | 4a8136b51b746961aac6f5ce2459effef8c22680 (patch) | |
tree | 424a0272bd93c9246232522c81fcff253abb20d5 /src/com/android/settings/Utils.java | |
parent | fc86ca6f0d576e79e1c0fcbecb230c6c84690c03 (diff) | |
download | packages_apps_Settings-4a8136b51b746961aac6f5ce2459effef8c22680.tar.gz packages_apps_Settings-4a8136b51b746961aac6f5ce2459effef8c22680.tar.bz2 packages_apps_Settings-4a8136b51b746961aac6f5ce2459effef8c22680.zip |
Warn users when selecting non-Direct Boot apps.
Certain apps like Phone, SMS, Emergency Info, and IME are critical
enough that they ideally need to be runnable before the device is
unlocked after a reboot. Users can still pick non-Direct Boot aware
apps, but this change now warns users that the selected app won't be
runnable until after unlocking.
Bug: 27196876
Change-Id: I0498904d2f664fb41e8c1e6bb30d1cbf437cf4b9
Diffstat (limited to 'src/com/android/settings/Utils.java')
-rw-r--r-- | src/com/android/settings/Utils.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java index 90dd9e0aa0..0725386af7 100644 --- a/src/com/android/settings/Utils.java +++ b/src/com/android/settings/Utils.java @@ -1150,5 +1150,14 @@ public final class Utils extends com.android.settingslib.Utils { } return false; } -} + public static boolean isPackageDirectBootAware(Context context, String packageName) { + try { + final ApplicationInfo ai = context.getPackageManager().getApplicationInfo( + packageName, 0); + return ai.isDirectBootAware() || ai.isPartiallyDirectBootAware(); + } catch (NameNotFoundException ignored) { + } + return false; + } +} |