Merge "[Attempt #2] Block untrusted touches in enforcing mode"

This commit is contained in:
TreeHugger Robot
2021-01-05 23:36:03 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 2 deletions

View File

@@ -195,7 +195,7 @@ public final class InputManager {
*/
@BlockUntrustedTouchesMode
public static final int DEFAULT_BLOCK_UNTRUSTED_TOUCHES_MODE =
BlockUntrustedTouchesMode.PERMISSIVE;
BlockUntrustedTouchesMode.BLOCK;
/**
* Prevent touches from being consumed by apps if these touches passed through a non-trusted

View File

@@ -161,6 +161,9 @@ public class InputManagerService extends IInputManager.Stub
"com.snapchat.android" // b/173297887
};
/** TODO(b/169067926): Remove this. */
private static final boolean UNTRUSTED_TOUCHES_TOAST = false;
// Pointer to native input manager service object.
private final long mPtr;
@@ -2307,7 +2310,8 @@ public class InputManagerService extends IInputManager.Stub
// Native callback
private void notifyUntrustedTouch(String packageName) {
// TODO(b/169067926): Remove toast after gathering feedback on dogfood.
if (ArrayUtils.contains(PACKAGE_BLOCKLIST_FOR_UNTRUSTED_TOUCHES_TOAST, packageName)) {
if (!UNTRUSTED_TOUCHES_TOAST || ArrayUtils.contains(
PACKAGE_BLOCKLIST_FOR_UNTRUSTED_TOUCHES_TOAST, packageName)) {
Log.i(TAG, "Suppressing untrusted touch toast for " + packageName);
return;
}