Loading services/core/java/com/android/server/clipboard/ClipboardService.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.provider.Settings; import android.text.TextUtils; import android.text.TextUtils; import android.util.Slog; import android.util.Slog; import android.util.SparseArray; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.view.autofill.AutofillManagerInternal; import android.view.autofill.AutofillManagerInternal; import android.widget.Toast; import android.widget.Toast; Loading Loading @@ -274,6 +275,9 @@ public class ClipboardService extends SystemService { /** Package of the app that set {@link #primaryClip}. */ /** Package of the app that set {@link #primaryClip}. */ String mPrimaryClipPackage; String mPrimaryClipPackage; /** Uids that have already triggered a toast notification for {@link #primaryClip} */ final SparseBooleanArray mNotifiedUids = new SparseBooleanArray(); final HashSet<String> activePermissionOwners final HashSet<String> activePermissionOwners = new HashSet<String>(); = new HashSet<String>(); Loading Loading @@ -649,6 +653,7 @@ public class ClipboardService extends SystemService { return; return; } } clipboard.primaryClip = clip; clipboard.primaryClip = clip; clipboard.mNotifiedUids.clear(); if (clip != null) { if (clip != null) { clipboard.primaryClipUid = uid; clipboard.primaryClipUid = uid; clipboard.mPrimaryClipPackage = sourcePackage; clipboard.mPrimaryClipPackage = sourcePackage; Loading Loading @@ -939,6 +944,11 @@ public class ClipboardService extends SystemService { && mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId)) { && mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId)) { return; return; } } // Don't notify if already notified for this uid and clip. if (clipboard.mNotifiedUids.get(uid)) { return; } clipboard.mNotifiedUids.put(uid, true); // Retrieve the app label of the source of the clip data // Retrieve the app label of the source of the clip data CharSequence sourceAppLabel = null; CharSequence sourceAppLabel = null; Loading Loading
services/core/java/com/android/server/clipboard/ClipboardService.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.provider.Settings; import android.text.TextUtils; import android.text.TextUtils; import android.util.Slog; import android.util.Slog; import android.util.SparseArray; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.view.autofill.AutofillManagerInternal; import android.view.autofill.AutofillManagerInternal; import android.widget.Toast; import android.widget.Toast; Loading Loading @@ -274,6 +275,9 @@ public class ClipboardService extends SystemService { /** Package of the app that set {@link #primaryClip}. */ /** Package of the app that set {@link #primaryClip}. */ String mPrimaryClipPackage; String mPrimaryClipPackage; /** Uids that have already triggered a toast notification for {@link #primaryClip} */ final SparseBooleanArray mNotifiedUids = new SparseBooleanArray(); final HashSet<String> activePermissionOwners final HashSet<String> activePermissionOwners = new HashSet<String>(); = new HashSet<String>(); Loading Loading @@ -649,6 +653,7 @@ public class ClipboardService extends SystemService { return; return; } } clipboard.primaryClip = clip; clipboard.primaryClip = clip; clipboard.mNotifiedUids.clear(); if (clip != null) { if (clip != null) { clipboard.primaryClipUid = uid; clipboard.primaryClipUid = uid; clipboard.mPrimaryClipPackage = sourcePackage; clipboard.mPrimaryClipPackage = sourcePackage; Loading Loading @@ -939,6 +944,11 @@ public class ClipboardService extends SystemService { && mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId)) { && mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId)) { return; return; } } // Don't notify if already notified for this uid and clip. if (clipboard.mNotifiedUids.get(uid)) { return; } clipboard.mNotifiedUids.put(uid, true); // Retrieve the app label of the source of the clip data // Retrieve the app label of the source of the clip data CharSequence sourceAppLabel = null; CharSequence sourceAppLabel = null; Loading