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

Commit 326c2e32 authored by Oli Lan's avatar Oli Lan Committed by Automerger Merge Worker
Browse files

Merge "Add a setting to control whether clipboard access notifications are...

Merge "Add a setting to control whether clipboard access notifications are shown." into sc-dev am: 242c7c5f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13828879

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib73a8b611cfa52bda1f286f1ca952c8c53ebdaf7
parents 03b34e01 242c7c5f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -9876,6 +9876,14 @@ public final class Settings {
        public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
                "reminder_exp_learning_event_count";
        /**
         * Whether to show clipboard access notifications.
         *
         * @hide
         */
        public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS =
                "clipboard_show_access_notifications";
        /**
         * These entries are considered common between the personal and the managed profile,
         * since the managed profile doesn't get to change them.
+7 −1
Original line number Diff line number Diff line
@@ -192,6 +192,12 @@ message SecureSettingsProto {
    optional Camera camera = 12;

    optional SettingProto carrier_apps_handled = 13 [ (android.privacy).dest = DEST_AUTOMATIC ];

    message Clipboard {
        optional SettingProto show_access_notifications = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Clipboard clipboard = 89;

    optional SettingProto cmas_additional_broadcast_pkg = 14 [ (android.privacy).dest = DEST_AUTOMATIC ];
    repeated SettingProto completed_categories = 15;
    optional SettingProto connectivity_release_pending_intent_delay_ms = 16 [ (android.privacy).dest = DEST_AUTOMATIC ];
@@ -647,5 +653,5 @@ message SecureSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 89;
    // Next tag = 90;
}
+1 −0
Original line number Diff line number Diff line
@@ -281,5 +281,6 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY,
                new InclusiveFloatRangeValidator(0.0f, 1.0f));
        VALIDATORS.put(Secure.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS, BOOLEAN_VALIDATOR);
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -1990,6 +1990,13 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.CARRIER_APPS_HANDLED,
                SecureSettingsProto.CARRIER_APPS_HANDLED);

        final long clipboardToken = p.start(SecureSettingsProto.CLIPBOARD);
        dumpSetting(s, p,
                Settings.Secure.CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS,
                SecureSettingsProto.Clipboard.SHOW_ACCESS_NOTIFICATIONS);
        p.end(clipboardToken);

        dumpSetting(s, p,
                Settings.Secure.CMAS_ADDITIONAL_BROADCAST_PKG,
                SecureSettingsProto.CMAS_ADDITIONAL_BROADCAST_PKG);
+4 −0
Original line number Diff line number Diff line
@@ -922,6 +922,10 @@ public class ClipboardService extends SystemService {
        if (!mShowAccessNotifications) {
            return;
        }
        if (Settings.Secure.getInt(getContext().getContentResolver(),
                Settings.Secure.CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS, 1) == 0) {
            return;
        }
        // Don't notify if the app accessing the clipboard is the same as the current owner.
        if (UserHandle.isSameApp(uid, clipboard.primaryClipUid)) {
            return;