|
30 | 30 | import android.hardware.SensorManager; |
31 | 31 | import android.hardware.SystemSensorManager; |
32 | 32 | import android.hardware.display.DisplayManager; |
33 | | -import android.os.AsyncTask; |
34 | 33 | import android.os.Handler; |
35 | 34 | import android.os.Looper; |
36 | 35 | import android.os.Message; |
|
44 | 43 | import android.view.Display; |
45 | 44 |
|
46 | 45 | import java.io.PrintWriter; |
47 | | -import java.util.concurrent.Executor; |
48 | 46 |
|
49 | 47 | /** |
50 | 48 | * Controls the power state of the display. |
@@ -161,9 +159,6 @@ final class DisplayPowerController { |
161 | 159 | // Notifier for sending asynchronous notifications. |
162 | 160 | private final Notifier mNotifier; |
163 | 161 |
|
164 | | - // A suspend blocker. |
165 | | - private final SuspendBlocker mSuspendBlocker; |
166 | | - |
167 | 162 | // The display blanker. |
168 | 163 | private final DisplayBlanker mDisplayBlanker; |
169 | 164 |
|
@@ -339,12 +334,11 @@ final class DisplayPowerController { |
339 | 334 | * Creates the display power controller. |
340 | 335 | */ |
341 | 336 | public DisplayPowerController(Looper looper, Context context, Notifier notifier, |
342 | | - LightsService lights, TwilightService twilight, SuspendBlocker suspendBlocker, |
| 337 | + LightsService lights, TwilightService twilight, |
343 | 338 | DisplayBlanker displayBlanker, |
344 | 339 | Callbacks callbacks, Handler callbackHandler) { |
345 | 340 | mHandler = new DisplayControllerHandler(looper); |
346 | 341 | mNotifier = notifier; |
347 | | - mSuspendBlocker = suspendBlocker; |
348 | 342 | mDisplayBlanker = displayBlanker; |
349 | 343 | mCallbacks = callbacks; |
350 | 344 | mCallbackHandler = callbackHandler; |
@@ -513,14 +507,10 @@ private void sendUpdatePowerStateLocked() { |
513 | 507 | } |
514 | 508 |
|
515 | 509 | private void initialize() { |
516 | | - final Executor executor = AsyncTask.THREAD_POOL_EXECUTOR; |
517 | 510 | Display display = mDisplayManager.getDisplay(Display.DEFAULT_DISPLAY); |
518 | 511 | mPowerState = new DisplayPowerState( |
519 | | - new ElectronBeam(display), |
520 | | - new PhotonicModulator(executor, |
521 | | - mLights.getLight(LightsService.LIGHT_ID_BACKLIGHT), |
522 | | - mSuspendBlocker), |
523 | | - mDisplayBlanker); |
| 512 | + new ElectronBeam(display), mDisplayBlanker, |
| 513 | + mLights.getLight(LightsService.LIGHT_ID_BACKLIGHT)); |
524 | 514 |
|
525 | 515 | mElectronBeamOnAnimator = ObjectAnimator.ofFloat( |
526 | 516 | mPowerState, DisplayPowerState.ELECTRON_BEAM_LEVEL, 0.0f, 1.0f); |
|
0 commit comments