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

Commit 66a294b6 authored by Bernardo Rufino's avatar Bernardo Rufino Committed by Android (Google) Code Review
Browse files

Merge "Suppress untrusted touches toast for Snapchat"

parents a991db05 0c002a29
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.XmlUtils;
import com.android.server.DisplayThread;
@@ -146,6 +147,16 @@ public class InputManagerService extends IInputManager.Stub

    private static final int DEFAULT_VIBRATION_MAGNITUDE = 192;

    /**
     * We know the issue and are working to fix it, so suppressing the toast to not annoy
     * dogfooders.
     *
     * TODO(b/169067926): Remove this
     */
    private static final String[] PACKAGE_BLOCKLIST_FOR_UNTRUSTED_TOUCHES_TOAST = {
            "com.snapchat.android" // b/173297887
    };

    // Pointer to native input manager service object.
    private final long mPtr;

@@ -2091,6 +2102,10 @@ 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)) {
            Log.i(TAG, "Suppressing untrusted touch toast for " + packageName);
            return;
        }
        DisplayThread.getHandler().post(() ->
                Toast.makeText(mContext,
                        "Touch obscured by " + packageName