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

Commit a51fec90 authored by Arpit Singh's avatar Arpit Singh
Browse files

Rename InputConfig field SENSITIVE_FOR_TRACING to SENSITIVE_FOR_PRIVACY

Making this field more generic to cater for wider use cases. In
addition to input tracing this field will also be used to hide privacy
sensitive input interactions from mirrored displays.

Test: presubmit
Bug: 325252005
Flag: NA
Change-Id: If4bf5aa6ed28f5a976aa9d5aeffb464e2551dfc3
parent b7d2f921
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public final class InputWindowHandle {
            InputConfig.SPY,
            InputConfig.INTERCEPTS_STYLUS,
            InputConfig.CLONE,
            InputConfig.SENSITIVE_FOR_TRACING,
            InputConfig.SENSITIVE_FOR_PRIVACY,
    })
    public @interface InputConfigFlags {}

+4 −3
Original line number Diff line number Diff line
@@ -4365,7 +4365,8 @@ public interface WindowManager extends ViewManager {
        public static final int INPUT_FEATURE_SPY = 1 << 2;

        /**
         * Input feature used to indicate that this window is sensitive for tracing.
         * Input feature used to indicate that this window is privacy sensitive. This may be used
         * to redact input interactions from tracing or screen mirroring.
         * <p>
         * A window that uses {@link LayoutParams#FLAG_SECURE} will automatically be treated as
         * a sensitive for input tracing, but this input feature can be set on windows that don't
@@ -4378,7 +4379,7 @@ public interface WindowManager extends ViewManager {
         *
         * @hide
         */
        public static final int INPUT_FEATURE_SENSITIVE_FOR_TRACING = 1 << 3;
        public static final int INPUT_FEATURE_SENSITIVE_FOR_PRIVACY = 1 << 3;

        /**
         * An internal annotation for flags that can be specified to {@link #inputFeatures}.
@@ -4392,7 +4393,7 @@ public interface WindowManager extends ViewManager {
                INPUT_FEATURE_NO_INPUT_CHANNEL,
                INPUT_FEATURE_DISABLE_USER_ACTIVITY,
                INPUT_FEATURE_SPY,
                INPUT_FEATURE_SENSITIVE_FOR_TRACING,
                INPUT_FEATURE_SENSITIVE_FOR_PRIVACY,
        })
        public @interface InputFeatureFlags {
        }
+6 −6
Original line number Diff line number Diff line
@@ -20,7 +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 android.view.WindowManager.LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_PRIVACY;

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

@@ -79,12 +79,12 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;

import platform.test.runner.parameterized.ParameterizedAndroidJunit4;
import platform.test.runner.parameterized.Parameters;

import java.util.List;
import java.util.concurrent.Executor;

import platform.test.runner.parameterized.ParameterizedAndroidJunit4;
import platform.test.runner.parameterized.Parameters;

@RunWith(ParameterizedAndroidJunit4.class)
@RunWithLooper(setAsMainLooper = true)
@SmallTest
@@ -341,7 +341,7 @@ 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)
                (mLayoutParameters.getValue().inputFeatures & INPUT_FEATURE_SENSITIVE_FOR_PRIVACY)
                        != 0)
                .isTrue();
    }
@@ -353,7 +353,7 @@ 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)
                (mLayoutParameters.getValue().inputFeatures & INPUT_FEATURE_SENSITIVE_FOR_PRIVACY)
                        == 0)
                .isTrue();
    }
+2 −2
Original line number Diff line number Diff line
@@ -412,9 +412,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        }

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

+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ class InputConfigAdapter {
                    LayoutParams.INPUT_FEATURE_SPY,
                    InputConfig.SPY, false /* inverted */),
            new FlagMapping(
                    LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_TRACING,
                    InputConfig.SENSITIVE_FOR_TRACING, false /* inverted */));
                    LayoutParams.INPUT_FEATURE_SENSITIVE_FOR_PRIVACY,
                    InputConfig.SENSITIVE_FOR_PRIVACY, false /* inverted */));

    @InputConfigFlags
    private static final int INPUT_FEATURE_TO_CONFIG_MASK =
Loading