Ignore broadcast intent from additional profile.
- Use isAdditionalProfile() to ignore intent from either work or private profile. Bug: 354828134 Test: atest SettingsRoboTests:com.android.settings.fuelgauge.batteryusage Flag: EXEMPT bug fix Change-Id: Ic0c91d956e4bfcd53576629efab4be847c94155e
This commit is contained in:
@@ -70,6 +70,7 @@ public final class DatabaseUtils {
|
||||
|
||||
/** Clear memory threshold for device booting phase. */
|
||||
private static final long CLEAR_MEMORY_THRESHOLD_MS = Duration.ofMinutes(5).toMillis();
|
||||
|
||||
private static final long CLEAR_MEMORY_DELAYED_MS = Duration.ofSeconds(2).toMillis();
|
||||
private static final long INVALID_TIMESTAMP = 0L;
|
||||
|
||||
@@ -527,9 +528,11 @@ public final class DatabaseUtils {
|
||||
return startCalendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
/** Returns the context with profile parent identity when current user is work profile. */
|
||||
/**
|
||||
* Returns the context with profile parent identity when current user is an additional profile.
|
||||
*/
|
||||
public static Context getParentContext(Context context) {
|
||||
if (com.android.settingslib.fuelgauge.BatteryUtils.isWorkProfile(context)) {
|
||||
if (com.android.settingslib.fuelgauge.BatteryUtils.isAdditionalProfile(context)) {
|
||||
try {
|
||||
return context.createPackageContextAsUser(
|
||||
/* packageName= */ context.getPackageName(),
|
||||
|
Reference in New Issue
Block a user