Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9aa9611 authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

Introducing DisplayPowerProximityStateController

This is a part of restructuring the way display service
updates the power state of the system. All the proximity related logic
has been abstracted out to a new class. As an attempt to keep this
simple and contained, no new logic has been added.

Bug: 241308364
Test: atest com.android.server.display
Change-Id: I45bb8cff3f6da805a816a9c3eef7428e7f7fbf7d
parent a3608b56
Loading
Loading
Loading
Loading
+48 −321

File changed.

Preview size limit exceeded, changes collapsed.

+476 −0

File added.

Preview size limit exceeded, changes collapsed.

+11 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.hardware.SensorManager;
import android.hardware.display.DisplayManagerInternal.DisplayPowerCallbacks;
import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.test.TestLooper;
import android.util.FloatProperty;
@@ -135,6 +136,16 @@ public final class DisplayPowerController2Test {
                    DisplayPowerCallbacks displayPowerCallbacks) {
                return mWakelockController;
            }

            @Override
            DisplayPowerProximityStateController getDisplayPowerProximityStateController(
                    WakelockController wakelockController, DisplayDeviceConfig displayDeviceConfig,
                    Looper looper, Runnable nudgeUpdatePowerState, int displayId,
                    SensorManager sensorManager) {
                return new DisplayPowerProximityStateController(wakelockController,
                        displayDeviceConfig, looper, nudgeUpdatePowerState, displayId,
                        sensorManager);
            }
        };

        addLocalServiceMock(WindowManagerPolicy.class, mWindowManagerPolicyMock);