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

Commit c5d1950f authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Logging prox sensor entry point and screen state"

parents 761b3329 5854384a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.doze;

import android.os.Handler;
import android.util.Log;
import android.view.Display;

import com.android.systemui.statusbar.phone.DozeParameters;
@@ -25,6 +26,10 @@ import com.android.systemui.statusbar.phone.DozeParameters;
 * Controls the screen when dozing.
 */
public class DozeScreenState implements DozeMachine.Part {

    private static final boolean DEBUG = DozeService.DEBUG;
    private static final String TAG = "DozeScreenState";

    private final DozeMachine.Service mDozeService;
    private final Handler mHandler;
    private final Runnable mApplyPendingScreenState = this::applyPendingScreenState;
@@ -79,6 +84,7 @@ public class DozeScreenState implements DozeMachine.Part {

    private void applyScreenState(int screenState) {
        if (screenState != Display.STATE_UNKNOWN) {
            if (DEBUG) Log.d(TAG, "setDozeScreenState(" + screenState + ")");
            mDozeService.setDozeScreenState(screenState);
            mPendingScreenState = Display.STATE_UNKNOWN;
        }
+2 −0
Original line number Diff line number Diff line
@@ -255,6 +255,8 @@ public class DozeSensors {

        @Override
        public void onSensorChanged(SensorEvent event) {
            if (DEBUG) Log.d(TAG, "onSensorChanged " + event);

            mCurrentlyFar = event.values[0] >= event.sensor.getMaximumRange();
            mProxCallback.accept(mCurrentlyFar);