diff options
| author | 2023-07-25 22:33:41 +0000 | |
|---|---|---|
| committer | 2023-07-25 22:33:41 +0000 | |
| commit | 8ffe0b3304293b07e3dc3ad3fbafcc6dcad6b9de (patch) | |
| tree | bb91641ee48a5727d45abd6f8f61b14e6e4e9c80 | |
| parent | ff5384f85c807a98fd972f6538a8bfe4be3618b6 (diff) | |
| parent | b986ddc4606f7c3a5893117c6288ef9bbe50a877 (diff) | |
Merge "Disallow loading icon from content URI to PipMenu" into tm-dev am: b986ddc460
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23436487
Change-Id: I51c1cd63c129a9d7e3cec03869af372afd3da9d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java index 6390c8984dac..47e7d80d50e3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java @@ -45,6 +45,7 @@ import android.content.Intent; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -509,13 +510,19 @@ public class PipMenuView extends FrameLayout { final boolean isCloseAction = mCloseAction != null && Objects.equals( mCloseAction.getActionIntent(), action.getActionIntent()); - // TODO: Check if the action drawable has changed before we reload it - action.getIcon().loadDrawableAsync(mContext, d -> { - if (d != null) { - d.setTint(Color.WHITE); - actionView.setImageDrawable(d); - } - }, mMainHandler); + final int iconType = action.getIcon().getType(); + if (iconType == Icon.TYPE_URI || iconType == Icon.TYPE_URI_ADAPTIVE_BITMAP) { + // Disallow loading icon from content URI + actionView.setImageDrawable(null); + } else { + // TODO: Check if the action drawable has changed before we reload it + action.getIcon().loadDrawableAsync(mContext, d -> { + if (d != null) { + d.setTint(Color.WHITE); + actionView.setImageDrawable(d); + } + }, mMainHandler); + } actionView.setCustomCloseBackgroundVisibility( isCloseAction ? View.VISIBLE : View.GONE); actionView.setContentDescription(action.getContentDescription()); |