diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java index 9d20f6d72d03a..6ab11068aac7c 100644 --- a/core/java/android/hardware/input/InputManager.java +++ b/core/java/android/hardware/input/InputManager.java @@ -201,8 +201,6 @@ public final class InputManager { * Prevent touches from being consumed by apps if these touches passed through a non-trusted * window from a different UID and are considered unsafe. * - * TODO(b/158002302): Turn the feature on by default - * * @hide */ @TestApi diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 482f2f07499d4..7f639fff20e6c 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -1518,7 +1518,54 @@ public interface WindowManager extends ViewManager { * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */ public static final int FLAG_NOT_FOCUSABLE = 0x00000008; - /** Window flag: this window can never receive touch events. */ + /** + * Window flag: this window can never receive touch events. + * + *
The intention of this flag is to leave the touch to be handled by some window below + * this window (in Z order). + * + *
Starting from Android {@link Build.VERSION_CODES#S}, for security reasons, touch + * events that pass through windows containing this flag (ie. are within the bounds of the + * window) will only be delivered to the touch-consuming window if one (or more) of the + * items below are true: + *
If none of these cases hold, the touch will not be delivered and a message will be + * logged to logcat.
+ * + * + *The combined obscuring opacity of a set of windows is obtained by combining the + * opacity values of all windows in the set using the associative and commutative operation + * defined as: + *
+ * opacity({A,B}) = 1 - (1 - opacity(A))*(1 - opacity(B))
+ *
+ * where {@code opacity(X)} is the {@link LayoutParams#alpha} of window X. So, for a set + * of windows {@code {W1, .., Wn}}, the combined obscuring opacity will be: + *
+ * opacity({W1, .., Wn}) = 1 - (1 - opacity(W1)) * ... * (1 - opacity(Wn))
+ *
+ */
public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
/** Window flag: even when this window is focusable (its