diff options
| author | 2023-07-26 20:12:28 +0000 | |
|---|---|---|
| committer | 2023-07-26 20:12:28 +0000 | |
| commit | 0fbf93b9f60cab757cf1e6c2a6bcc0e861ba8f1a (patch) | |
| tree | b1233d35d0a96a0068654128b2956ce909a21890 | |
| parent | 044b07db4d898c98dd4cc3140a44766a76a55223 (diff) | |
| parent | 1f2e080f1b99cd2162f6cb756fd4694fddb05882 (diff) | |
Merge "Disallow loading icon from content URI to PipMenu" into sc-dev am: 1f2e080f1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23423703
Change-Id: I88e56a652244772a9d863531dbab1037405868c6
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 67b1e6dd4cc7..4cbaa348add4 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 @@ -41,6 +41,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; @@ -462,13 +463,19 @@ public class PipMenuView extends FrameLayout { final PipMenuActionView actionView = (PipMenuActionView) mActionsGroup.getChildAt(i); - // 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.setContentDescription(action.getContentDescription()); if (action.isEnabled()) { actionView.setOnClickListener(v -> { |