Merge "Doze: Use configured doze brightness when pulsing." into lmp-dev
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index f899572..cc77aaa 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -188,9 +188,6 @@
<!-- Doze: should the pickup sensor be used as a pulse signal? -->
<bool name="doze_pulse_on_pick_up">false</bool>
- <!-- Doze: maximum brightness to use when pulsing -->
- <integer name="doze_pulse_brightness">40</integer>
-
<!-- Doze: period of time between pulses (start of pulse) when following the notification light
Format: <under_ms>:<period_ms>,...,<default_ms> -->
<string name="doze_pulse_period_function">60000:10000,300000:30000,1800000:60000,0</string>
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
index 1183582..f411e62 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
@@ -16,9 +16,6 @@
package com.android.systemui.doze;
-import static android.os.PowerManager.BRIGHTNESS_OFF;
-import static android.os.PowerManager.BRIGHTNESS_ON;
-
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@@ -37,7 +34,6 @@
import android.os.Vibrator;
import android.service.dreams.DreamService;
import android.util.Log;
-import android.util.MathUtils;
import android.view.Display;
import com.android.systemui.R;
@@ -68,7 +64,6 @@
private PowerManager mPowerManager;
private PowerManager.WakeLock mWakeLock;
private AlarmManager mAlarmManager;
- private int mMaxBrightness;
private boolean mDreaming;
private boolean mBroadcastReceiverRegistered;
private boolean mDisplayStateSupported;
@@ -91,7 +86,6 @@
pw.print(" mBroadcastReceiverRegistered: "); pw.println(mBroadcastReceiverRegistered);
pw.print(" mSigMotionSensor: "); pw.println(mSigMotionSensor);
pw.print(" mPickupSensor:"); pw.println(mPickupSensor);
- pw.print(" mMaxBrightness: "); pw.println(mMaxBrightness);
pw.print(" mDisplayStateSupported: "); pw.println(mDisplayStateSupported);
pw.print(" mNotificationLightOn: "); pw.println(mNotificationLightOn);
pw.print(" mPowerSaveActive: "); pw.println(mPowerSaveActive);
@@ -123,8 +117,6 @@
final Resources res = mContext.getResources();
mDisplayStateSupported = SystemProperties.getBoolean("doze.display.supported",
res.getBoolean(R.bool.doze_display_state_supported));
- mMaxBrightness = MathUtils.constrain(res.getInteger(R.integer.doze_pulse_brightness),
- BRIGHTNESS_OFF, BRIGHTNESS_ON);
mNotificationPulseIntent = PendingIntent.getBroadcast(mContext, 0,
new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName()),
PendingIntent.FLAG_UPDATE_CURRENT);
@@ -158,7 +150,6 @@
if (DEBUG) Log.d(mTag, "stayAwake millis=" + millis);
mWakeLock.acquire(millis);
setDozeScreenState(mDisplayStateWhenOn);
- setDozeScreenBrightness(mMaxBrightness);
rescheduleOff(millis);
}
}
@@ -295,7 +286,6 @@
public void run() {
if (DEBUG) Log.d(TAG, "Display off");
setDozeScreenState(Display.STATE_OFF);
- setDozeScreenBrightness(PowerManager.BRIGHTNESS_DEFAULT);
}
};