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

Commit 874fd364 authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix logcat view layout warnings

The one-handed bouncer was requesting layout via setLayoutParams() on
each onLayout pass, which was spamming logcat with warnings. Be more
selective about when to request an update.

Fixes: 224965291
Test: check logcat
Change-Id: Ib5afe3cd07180dd1b7ec1641367a6e114c094d56
parent 8e98ddc6
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ public class KeyguardSecurityContainer extends FrameLayout {
    private SwipeListener mSwipeListener;
    private ViewMode mViewMode = new DefaultViewMode();
    private @Mode int mCurrentMode = MODE_DEFAULT;
    private int mWidth = -1;

    private final WindowInsetsAnimation.Callback mWindowInsetsAnimationCallback =
            new WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) {
@@ -649,10 +650,12 @@ public class KeyguardSecurityContainer extends FrameLayout {
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);

        // After a layout pass, we need to re-place the inner bouncer, as our bounds may have
        // changed.
        int width = right - left;
        if (changed && mWidth != width) {
            mWidth = width;
            mViewMode.updateSecurityViewLocation();
        }
    }

    @Override
    protected void onConfigurationChanged(Configuration config) {