forked from M66B/cm10-fxp-extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eba.patch
59 lines (52 loc) · 2.92 KB
/
eba.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 7993d74083045d7fc10adcecd60db96779311983 Mon Sep 17 00:00:00 2001
From: Sravan Kumar Ambapuram <[email protected]>
Date: Mon, 30 Jul 2012 15:35:17 -0700
Subject: [PATCH] Triggering EarlySuspend based on BackLight brightness
EarlySuspend is triggered currently based on just timeout. Due to this,
backlight brightness is not coming down to zero.
Change-Id: If89ec6650308109630dbb7ee1be0b96df4ed3534
CRs-Fixed: 381087
Allowing display turning off animation before Early suspend.
This change passes display turning off information to
animation call so that display off animation can be played
before early suspend call.
Reverted two and three changes in the below list with this patch.
Changes introduced in previous patch were:
1.Send early suspend call after display baclklight off
2.All animations off once display goes to dim.
3.Removed duration to turn off screen as i don't see this in ICS.
Change-Id: Id411fe2c4d4fd219fc198405d6c2f221a87874ff
---
services/java/com/android/server/PowerManagerService.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 4b6b935..17805cf 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -2381,6 +2381,14 @@ public class PowerManagerService extends IPowerManager.Stub
Message msg = mScreenBrightnessHandler
.obtainMessage(ANIMATE_LIGHTS, mask, newValue);
mScreenBrightnessHandler.sendMessageDelayed(msg, delay);
+ } else {
+ final boolean doScreenAnimation = (mask & (SCREEN_BRIGHT_BIT | SCREEN_ON_BIT)) != 0;
+ final boolean turnOff = currentValue == PowerManager.BRIGHTNESS_OFF;
+ if (turnOff && doScreenAnimation) {
+ // Cancel all pending animations since we're turning off
+ mScreenBrightnessHandler.removeCallbacksAndMessages(null);
+ screenOffFinishedAnimatingLocked(mScreenOffReason);
+ }
}
}
}
@@ -2444,9 +2452,6 @@ public class PowerManagerService extends IPowerManager.Stub
final boolean doScreenAnim = (mask & (SCREEN_BRIGHT_BIT | SCREEN_ON_BIT)) != 0;
final boolean turningOff = endValue == PowerManager.BRIGHTNESS_OFF;
if (turningOff && doScreenAnim) {
- // Cancel all pending animations since we're turning off
- mScreenBrightnessHandler.removeCallbacksAndMessages(null);
- screenOffFinishedAnimatingLocked(mScreenOffReason);
duration = 200; // TODO: how long should this be?
}
if (doScreenAnim) {
--
1.7.10.4