Merge "Update related UI if battery is not present"

This commit is contained in:
TreeHugger Robot
2020-10-26 04:53:49 +00:00
committed by Android (Google) Code Review
15 changed files with 182 additions and 15 deletions

View File

@@ -46,6 +46,7 @@ public class ShadowUtils {
private static boolean sIsSystemAlertWindowEnabled;
private static boolean sIsVoiceCapable;
private static ArraySet<String> sResultLinks = new ArraySet<>();
private static boolean sIsBatteryPresent;
@Implementation
protected static int enforceSameOwner(Context context, int userId) {
@@ -67,6 +68,7 @@ public class ShadowUtils {
sIsDemoUser = false;
sIsVoiceCapable = false;
sResultLinks = new ArraySet<>();
sIsBatteryPresent = true;
}
public static void setIsDemoUser(boolean isDemoUser) {
@@ -155,4 +157,13 @@ public class ShadowUtils {
public static void setHandledDomains(ArraySet<String> links) {
sResultLinks = links;
}
@Implementation
protected static boolean isBatteryPresent(Context context) {
return sIsBatteryPresent;
}
public static void setIsBatteryPresent(boolean isBatteryPresent) {
sIsBatteryPresent = isBatteryPresent;
}
}