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

Commit b0ade8d3 authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

Label emulator clipboards with `SUPPRESS_CLIPBOARD_OVERLAY`



Emulator QA found this popup too noisy
to be useful.

Bug: 222604628
Test: boot the emulator, copy on the host
Test: check if there is no popup in the guest
Change-Id: I46323732a64202dabdd3a43bf17df7e7f3f9dd9c
Merged-In: I46323732a64202dabdd3a43bf17df7e7f3f9dd9c
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
parent 869e4d4f
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.clipboard;


import android.annotation.Nullable;
import android.annotation.Nullable;
import android.content.ClipData;
import android.content.ClipData;
import android.os.PersistableBundle;
import android.os.SystemProperties;
import android.os.SystemProperties;
import android.system.ErrnoException;
import android.system.ErrnoException;
import android.system.Os;
import android.system.Os;
@@ -137,6 +138,9 @@ class EmulatorClipboardMonitor implements Consumer<ClipData> {
                    final ClipData clip = new ClipData("host clipboard",
                    final ClipData clip = new ClipData("host clipboard",
                                                       new String[]{"text/plain"},
                                                       new String[]{"text/plain"},
                                                       new ClipData.Item(str));
                                                       new ClipData.Item(str));
                    final PersistableBundle bundle = new PersistableBundle();
                    bundle.putBoolean("com.android.systemui.SUPPRESS_CLIPBOARD_OVERLAY", true);
                    clip.getDescription().setExtras(bundle);


                    if (LOG_CLIBOARD_ACCESS) {
                    if (LOG_CLIBOARD_ACCESS) {
                        Slog.i(TAG, "Setting the guest clipboard to '" + str + "'");
                        Slog.i(TAG, "Setting the guest clipboard to '" + str + "'");