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

Commit 82ceb1c3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add additional logging for region sampling helper" into rvc-dev am:...

Merge "Add additional logging for region sampling helper" into rvc-dev am: f83fb7e2 am: 2d3bbfc6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11937066

Change-Id: I93fe97f260a799a99d345ba86acfaab1a85fd493
parents 3fd6d2c7 2d3bbfc6
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
@@ -140,6 +140,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;
@@ -573,6 +574,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);
@@ -1217,6 +1219,7 @@ public class NavigationBarView extends FrameLayout implements
        dumpButton(pw, "a11y", getAccessibilityButton());

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

        if (mNavigationInflaterView != null) {
            mNavigationInflaterView.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 {