forked from M66B/cm10-fxp-extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eba_frameworks.patch
68 lines (61 loc) · 3.54 KB
/
eba_frameworks.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
59
60
61
62
63
64
65
66
67
From 56134b8860b702b8036586810d671c653a12a388 Mon Sep 17 00:00:00 2001
From: Michael Bestas <[email protected]>
Date: Sat, 2 Feb 2013 05:53:02 +0200
Subject: [PATCH] Add option to enable/disable Electron Beam Animation (1/2
Frameworks)
Trigger CRT off animation by user preference.
Signed-off-by: Michael Bestas <[email protected]>
Change-Id: Ia57217a37cbe75dcde2f57f89071c7a5b9ded52b
---
.../com/android/server/PowerManagerService.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 588b9f3..7d1fa1d 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -62,6 +62,7 @@ import android.util.Slog;
import android.view.WindowManagerPolicy;
import static android.view.WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR;
import static android.provider.Settings.System.DIM_SCREEN;
+import static android.provider.Settings.System.ELECTRON_BEAM_ANIMATION_OFF;
import static android.provider.Settings.System.SCREEN_BRIGHTNESS;
import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE;
import static android.provider.Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ;
@@ -180,6 +181,8 @@ public class PowerManagerService extends IPowerManager.Stub
// animate screen lights in PowerManager (as opposed to SurfaceFlinger)
boolean mAnimateScreenLights = true;
+ boolean mElectronBeamAnimationOff = false;
+
static final int ANIM_STEPS = 60; // nominal # of frames at 60Hz
// Slower animation for autobrightness changes
static final int AUTOBRIGHTNESS_ANIM_STEPS = 2 * ANIM_STEPS;
@@ -568,8 +571,13 @@ public class PowerManagerService extends IPowerManager.Stub
mWindowScaleAnimation = getFloat(WINDOW_ANIMATION_SCALE, 1.0f);
final float transitionScale = getFloat(TRANSITION_ANIMATION_SCALE, 1.0f);
+
+ mElectronBeamAnimationOff = (Settings.System.getInt(mContext.getContentResolver(),
+ ELECTRON_BEAM_ANIMATION_OFF, 1) != 0) &&
+ mContext.getResources().getBoolean(com.android.internal.R.bool.config_screenOffAnimation);
+
mAnimationSetting = 0;
- if (mWindowScaleAnimation > 0.5f) {
+ if (mElectronBeamAnimationOff) {
mAnimationSetting |= ANIM_SETTING_OFF;
}
if (transitionScale > 0.5f) {
@@ -715,10 +723,12 @@ public class PowerManagerService extends IPowerManager.Stub
+ Settings.System.NAME + "=?) or ("
+ Settings.System.NAME + "=?) or ("
+ Settings.System.NAME + "=?) or ("
+ + Settings.System.NAME + "=?) or ("
+ Settings.System.NAME + "=?)",
new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN, SCREEN_BRIGHTNESS,
SCREEN_BRIGHTNESS_MODE, /*SCREEN_AUTO_BRIGHTNESS_ADJ,*/
- WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE, Settings.System.LIGHTS_CHANGED},
+ WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE, Settings.System.LIGHTS_CHANGED,
+ ELECTRON_BEAM_ANIMATION_OFF},
null);
mSettings = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, mHandler);
SettingsObserver settingsObserver = new SettingsObserver();
--
1.7.9.5