Merge "Fix battery saver slider is not displaying"

This commit is contained in:
Raff Tsai
2020-01-04 22:15:47 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.UserHandle;
import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.text.TextUtils;
@@ -186,7 +187,8 @@ public class BatterySaverUtils {
}
private static void setBatterySaverConfirmationAcknowledged(Context context) {
Secure.putInt(context.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, 1);
Secure.putIntForUser(context.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, 1,
UserHandle.USER_CURRENT);
}
/**

View File

@@ -585,10 +585,10 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
resolver,
Global.LOW_POWER_MODE_TRIGGER_LEVEL,
batterySaverTriggerLevel);
Secure.putInt(
Secure.putIntForUser(
resolver,
Secure.LOW_POWER_WARNING_ACKNOWLEDGED,
1);
1, UserHandle.USER_CURRENT);
});
} else {
d.setTitle(R.string.battery_saver_confirmation_title);