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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user