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

Commit 96da3cb0 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Lockscreen bouncer: Always set INPUT_FEATURE_SENSITIVE_FOR_TRACING

The bouncer should always be treated as a sensitve window so that
interactions do now show up in the input trace, regardless of when
FLAG_SECURE is set. It should not be a sensitive window when the bouncer
is not showing.

Flag: None
Bug: 210460522
Test: manual
Test: atest NotificationShadeWindowControllerImplTest
Change-Id: I43555af2a0282d07ad01d08a0ab03a688ad3f836
parent 9ebd6860
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -416,6 +416,12 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        } else {
            mLpChanged.flags &= ~LayoutParams.FLAG_SECURE;
        }

        if (state.bouncerShowing) {
            mLpChanged.inputFeatures |= LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_TRACING;
        } else {
            mLpChanged.inputFeatures &= ~LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_TRACING;
        }
    }

    protected boolean isDebuggable() {
+9 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_TRACING;

import static com.google.common.truth.Truth.assertThat;

@@ -436,6 +437,10 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {

        verify(mWindowManager).updateViewLayout(any(), mLayoutParameters.capture());
        assertThat((mLayoutParameters.getValue().flags & FLAG_SECURE) != 0).isTrue();
        assertThat(
                (mLayoutParameters.getValue().inputFeatures & INPUT_FEATURE_SENSITIVE_FOR_TRACING)
                        != 0)
                .isTrue();
    }

    @Test
@@ -444,6 +449,10 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {

        verify(mWindowManager).updateViewLayout(any(), mLayoutParameters.capture());
        assertThat((mLayoutParameters.getValue().flags & FLAG_SECURE) == 0).isTrue();
        assertThat(
                (mLayoutParameters.getValue().inputFeatures & INPUT_FEATURE_SENSITIVE_FOR_TRACING)
                        == 0)
                .isTrue();
    }

    @Test