Jon West | f17c532 | 2018-08-13 17:59:16 -0400 | [diff] [blame^] | 1 | From 119c6b1f3ca9e359544f5623261368e93d067418 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ricardo Cerqueira <cyanogenmod@cerqueira.org> |
| 3 | Date: Fri, 23 Nov 2012 14:23:16 +0000 |
| 4 | Subject: [PATCH 14/14] Revert "Reintroduce button-backlight (and respective |
| 5 | inactivity timeout)" |
| 6 | |
| 7 | This reverts commit 035ecde36847f70c7499d576afe1dfa9e130ec8f. |
| 8 | --- |
| 9 | .../server/display/DisplayPowerController.java | 11 ----------- |
| 10 | .../com/android/server/power/PowerManagerService.java | 10 ---------- |
| 11 | 2 files changed, 21 deletions(-) |
| 12 | |
| 13 | diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java |
| 14 | index 0b2f487840b..99412c56b27 100644 |
| 15 | --- a/services/core/java/com/android/server/display/DisplayPowerController.java |
| 16 | +++ b/services/core/java/com/android/server/display/DisplayPowerController.java |
| 17 | @@ -20,7 +20,6 @@ import android.app.ActivityManager; |
| 18 | import com.android.internal.app.IBatteryStats; |
| 19 | import com.android.server.LocalServices; |
| 20 | import com.android.server.am.BatteryStatsService; |
| 21 | -import com.android.server.lights.LightsManager; |
| 22 | import com.android.server.policy.WindowManagerPolicy; |
| 23 | |
| 24 | import android.animation.Animator; |
| 25 | @@ -142,9 +141,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call |
| 26 | // Battery stats. |
| 27 | private final IBatteryStats mBatteryStats; |
| 28 | |
| 29 | - // The lights service. |
| 30 | - private final LightsManager mLights; |
| 31 | - |
| 32 | // The sensor manager. |
| 33 | private final SensorManager mSensorManager; |
| 34 | |
| 35 | @@ -378,7 +374,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call |
| 36 | mCallbacks = callbacks; |
| 37 | |
| 38 | mBatteryStats = BatteryStatsService.getService(); |
| 39 | - mLights = LocalServices.getService(LightsManager.class); |
| 40 | mSensorManager = sensorManager; |
| 41 | mWindowManagerPolicy = LocalServices.getService(WindowManagerPolicy.class); |
| 42 | mBlanker = blanker; |
| 43 | @@ -774,12 +769,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call |
| 44 | // Use zero brightness when screen is off. |
| 45 | if (state == Display.STATE_OFF) { |
| 46 | brightness = PowerManager.BRIGHTNESS_OFF; |
| 47 | - mLights.getLight(LightsManager.LIGHT_ID_BUTTONS).setBrightness(brightness); |
| 48 | - } |
| 49 | - |
| 50 | - // Disable button lights when dozing |
| 51 | - if (state == Display.STATE_DOZE || state == Display.STATE_DOZE_SUSPEND) { |
| 52 | - mLights.getLight(LightsManager.LIGHT_ID_BUTTONS).setBrightness(PowerManager.BRIGHTNESS_OFF); |
| 53 | } |
| 54 | |
| 55 | // Always use the VR brightness when in the VR state. |
| 56 | diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java |
| 57 | index 4d7c6d24509..a3986fda989 100644 |
| 58 | --- a/services/core/java/com/android/server/power/PowerManagerService.java |
| 59 | +++ b/services/core/java/com/android/server/power/PowerManagerService.java |
| 60 | @@ -222,8 +222,6 @@ public final class PowerManagerService extends SystemService |
| 61 | // Persistent property for last reboot reason |
| 62 | private static final String LAST_REBOOT_PROPERTY = "persist.sys.boot.reason"; |
| 63 | |
| 64 | - private static final int BUTTON_ON_DURATION = 5 * 1000; |
| 65 | - |
| 66 | private final Context mContext; |
| 67 | private final ServiceThread mHandlerThread; |
| 68 | private final PowerManagerHandler mHandler; |
| 69 | @@ -244,7 +242,6 @@ public final class PowerManagerService extends SystemService |
| 70 | private SettingsObserver mSettingsObserver; |
| 71 | private DreamManagerInternal mDreamManager; |
| 72 | private Light mAttentionLight; |
| 73 | - private Light mButtonsLight; |
| 74 | |
| 75 | private final Object mLock = LockGuard.installNewLock(LockGuard.INDEX_POWER); |
| 76 | |
| 77 | @@ -773,7 +770,6 @@ public final class PowerManagerService extends SystemService |
| 78 | |
| 79 | mLightsManager = getLocalService(LightsManager.class); |
| 80 | mAttentionLight = mLightsManager.getLight(LightsManager.LIGHT_ID_ATTENTION); |
| 81 | - mButtonsLight = mLightsManager.getLight(LightsManager.LIGHT_ID_BUTTONS); |
| 82 | |
| 83 | // Initialize display power management. |
| 84 | mDisplayManagerInternal.initPowerManagement( |
| 85 | @@ -1964,12 +1960,6 @@ public final class PowerManagerService extends SystemService |
| 86 | nextTimeout = mLastUserActivityTime |
| 87 | + screenOffTimeout - screenDimDuration; |
| 88 | if (now < nextTimeout) { |
| 89 | - if (now > mLastUserActivityTime + BUTTON_ON_DURATION) { |
| 90 | - mButtonsLight.setBrightness(0); |
| 91 | - } else { |
| 92 | - mButtonsLight.setBrightness(mDisplayPowerRequest.screenBrightness); |
| 93 | - nextTimeout = now + BUTTON_ON_DURATION; |
| 94 | - } |
| 95 | mUserActivitySummary = USER_ACTIVITY_SCREEN_BRIGHT; |
| 96 | } else { |
| 97 | nextTimeout = mLastUserActivityTime + screenOffTimeout; |
| 98 | -- |
| 99 | 2.17.1 |
| 100 | |