Loading services/core/java/com/android/server/clipboard/ClipboardService.java +28 −26 Original line number Diff line number Diff line Loading @@ -950,6 +950,7 @@ public class ClipboardService extends SystemService { } clipboard.mNotifiedUids.put(uid, true); Binder.withCleanCallingIdentity(() -> { // Retrieve the app label of the source of the clip data CharSequence sourceAppLabel = null; if (clipboard.mPrimaryClipPackage != null) { Loading @@ -969,15 +970,16 @@ public class ClipboardService extends SystemService { message = getContext().getString( R.string.pasted_from_app, callingAppLabel, sourceAppLabel); } else { message = getContext().getString(R.string.pasted_from_clipboard, callingAppLabel); message = getContext().getString( R.string.pasted_from_clipboard, callingAppLabel); } Slog.i(TAG, message); Binder.withCleanCallingIdentity(() -> Toast.makeText(getContext(), UiThread.get().getLooper(), message, Toast.LENGTH_SHORT) .show()); Toast.makeText( getContext(), UiThread.get().getLooper(), message, Toast.LENGTH_SHORT) .show(); } catch (PackageManager.NameNotFoundException e) { // do nothing } }); } } Loading
services/core/java/com/android/server/clipboard/ClipboardService.java +28 −26 Original line number Diff line number Diff line Loading @@ -950,6 +950,7 @@ public class ClipboardService extends SystemService { } clipboard.mNotifiedUids.put(uid, true); Binder.withCleanCallingIdentity(() -> { // Retrieve the app label of the source of the clip data CharSequence sourceAppLabel = null; if (clipboard.mPrimaryClipPackage != null) { Loading @@ -969,15 +970,16 @@ public class ClipboardService extends SystemService { message = getContext().getString( R.string.pasted_from_app, callingAppLabel, sourceAppLabel); } else { message = getContext().getString(R.string.pasted_from_clipboard, callingAppLabel); message = getContext().getString( R.string.pasted_from_clipboard, callingAppLabel); } Slog.i(TAG, message); Binder.withCleanCallingIdentity(() -> Toast.makeText(getContext(), UiThread.get().getLooper(), message, Toast.LENGTH_SHORT) .show()); Toast.makeText( getContext(), UiThread.get().getLooper(), message, Toast.LENGTH_SHORT) .show(); } catch (PackageManager.NameNotFoundException e) { // do nothing } }); } }