summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jacqueline Bronger <bronger@google.com> 2023-06-01 10:45:12 +0200
committer Jacqueline Bronger <bronger@google.com> 2023-09-25 09:48:22 +0000
commitbdc1c02d5a7105bca9bb10b13bddfbf1bb4c2edd (patch)
tree36f9b01470598afed7c93ec52e027a592e2d326d
parent3d5051963366ee0ea51a28b8eabbbac1eb425fa9 (diff)
TV PiP: don't load app provided icon from URI
Bug: 278246687 Test: manually, with the PoC app attached to the bug Change-Id: I7fdcab6774bdeba27f11caa4a1262d07fc8536e2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java
index 931cf0cee28c..c6c9b3562308 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java
@@ -94,6 +94,10 @@ public class TvWindowMenuActionButton extends RelativeLayout {
mCurrentIcon = icon;
// Remove old image while waiting for the new one to load.
mIconImageView.setImageDrawable(null);
+ if (icon.getType() == Icon.TYPE_URI || icon.getType() == Icon.TYPE_URI_ADAPTIVE_BITMAP) {
+ // Disallow loading icon from content URI
+ return;
+ }
icon.loadDrawableAsync(mContext, d -> {
// The image hasn't been set any other way and the drawable belongs to the most
// recently set Icon.