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

Commit 657d50ab authored by Winson Chung's avatar Winson Chung
Browse files

Add additional logging for region sampling helper

Change-Id: Icb2759d56fb98a2e961195c601b9b5dc7aff1450
Bug: 158666327
Test: adb shell dumpsys activity service SystemUIService
parent 68e33e03
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ public final class NavigationBarTransitions extends BarTransitions implements
    }

    private final NavigationBarView mView;
    private final IStatusBarService mBarService;
    private final LightBarTransitionsController mLightTransitionsController;
    private final boolean mAllowAutoDimWallpaperNotVisible;
    private boolean mWallpaperVisible;
@@ -82,8 +81,6 @@ public final class NavigationBarTransitions extends BarTransitions implements
    public NavigationBarTransitions(NavigationBarView view, CommandQueue commandQueue) {
        super(view, R.drawable.nav_background);
        mView = view;
        mBarService = IStatusBarService.Stub.asInterface(
                ServiceManager.getService(Context.STATUS_BAR_SERVICE));
        mLightTransitionsController = new LightBarTransitionsController(
                view.getContext(), this, commandQueue);
        mAllowAutoDimWallpaperNotVisible = view.getContext().getResources()
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ public class NavigationBarView extends FrameLayout implements
    private boolean mInCarMode = false;
    private boolean mDockedStackExists;
    private boolean mImeVisible;
    private boolean mScreenOn = true;

    private final SparseArray<ButtonDispatcher> mButtonDispatchers = new SparseArray<>();
    private final ContextualButtonGroup mContextualButtonGroup;
@@ -562,6 +563,7 @@ public class NavigationBarView extends FrameLayout implements

    /** To be called when screen lock/unlock state changes */
    public void onScreenStateChanged(boolean isScreenOn) {
        mScreenOn = isScreenOn;
        if (isScreenOn) {
            if (isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode)) {
                mRegionSamplingHelper.start(mSamplingBounds);
@@ -1199,6 +1201,7 @@ public class NavigationBarView extends FrameLayout implements
        dumpButton(pw, "a11y", getAccessibilityButton());

        pw.println("    }");
        pw.println("    mScreenOn: " + mScreenOn);

        mContextualButtonGroup.dump(pw);
        mRecentsOnboarding.dump(pw);
+8 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ public class RegionSamplingHelper implements View.OnAttachStateChangeListener,
    private final View mSampledView;

    private final CompositionSamplingListener mSamplingListener;
    private final Runnable mUpdateSamplingListener = this::updateSamplingListener;

    /**
     * The requested sampling bounds that we want to sample from
@@ -59,6 +58,7 @@ public class RegionSamplingHelper implements View.OnAttachStateChangeListener,
    private float mLastMedianLuma;
    private float mCurrentMedianLuma;
    private boolean mWaitingOnDraw;
    private boolean mIsDestroyed;

    // Passing the threshold of this luminance value will make the button black otherwise white
    private final float mLuminanceThreshold;
@@ -130,6 +130,7 @@ public class RegionSamplingHelper implements View.OnAttachStateChangeListener,
    void stopAndDestroy() {
        stop();
        mSamplingListener.destroy();
        mIsDestroyed = true;
    }

    @Override
@@ -229,12 +230,17 @@ public class RegionSamplingHelper implements View.OnAttachStateChangeListener,
        pw.println("  sampleView isAttached: " + mSampledView.isAttachedToWindow());
        pw.println("  sampleView isScValid: " + (mSampledView.isAttachedToWindow()
                ? mSampledView.getViewRootImpl().getSurfaceControl().isValid()
                : "false"));
                : "notAttached"));
        pw.println("  mSamplingEnabled: " + mSamplingEnabled);
        pw.println("  mSamplingListenerRegistered: " + mSamplingListenerRegistered);
        pw.println("  mSamplingRequestBounds: " + mSamplingRequestBounds);
        pw.println("  mRegisteredSamplingBounds: " + mRegisteredSamplingBounds);
        pw.println("  mLastMedianLuma: " + mLastMedianLuma);
        pw.println("  mCurrentMedianLuma: " + mCurrentMedianLuma);
        pw.println("  mWindowVisible: " + mWindowVisible);
        pw.println("  mWaitingOnDraw: " + mWaitingOnDraw);
        pw.println("  mRegisteredStopLayer: " + mRegisteredStopLayer);
        pw.println("  mIsDestroyed: " + mIsDestroyed);
    }

    public interface SamplingCallback {