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

Commit 07a3663d authored by Matt Casey's avatar Matt Casey
Browse files

Add clipboard toast suppression permission.

Grant that permission to SystemUI so that the clipboard overlay doesn't
generate a toast.

Test: Manual verification that toast is suppressed only after sysui
      requests the permission.
Test: atest ClipboardManagerTest
Bug: 216143343

Change-Id: Ia527a5d878f026b7939042b4b675037482846fbb
parent c1e962bc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5923,6 +5923,10 @@
         <p>Not for use by third-party applications. -->
    <permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND"
        android:protectionLevel="signature" />
    <!-- @hide Permission that suppresses the notification when the clipboard is accessed.
         <p>Not for use by third-party applications. -->
    <permission android:name="android.permission.SUPPRESS_CLIPBOARD_ACCESS_NOTIFICATION"
                android:protectionLevel="signature" />

    <!-- @SystemApi Allows modifying accessibility state.
         @hide -->
+1 −0
Original line number Diff line number Diff line
@@ -308,6 +308,7 @@

    <!-- To change system language (HDMI CEC) -->
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.SUPPRESS_CLIPBOARD_ACCESS_NOTIFICATION" />

    <protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" />
    <protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" />
+4 −0
Original line number Diff line number Diff line
@@ -1090,6 +1090,10 @@ public class ClipboardService extends SystemService {
                && mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId)) {
            return;
        }
        if (mPm.checkPermission(Manifest.permission.SUPPRESS_CLIPBOARD_ACCESS_NOTIFICATION,
                callingPackage) == PackageManager.PERMISSION_GRANTED) {
            return;
        }
        // Don't notify if already notified for this uid and clip.
        if (clipboard.mNotifiedUids.get(uid)) {
            return;