Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +14 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -513,6 +514,11 @@ public class PipMenuView extends FrameLayout { final boolean isCloseAction = mCloseAction != null && Objects.equals( mCloseAction.getActionIntent(), action.getActionIntent()); 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) { Loading @@ -520,6 +526,7 @@ public class PipMenuView extends FrameLayout { actionView.setImageDrawable(d); } }, mMainHandler); } actionView.setCustomCloseBackgroundVisibility( isCloseAction ? View.VISIBLE : View.GONE); actionView.setContentDescription(action.getContentDescription()); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +14 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -513,6 +514,11 @@ public class PipMenuView extends FrameLayout { final boolean isCloseAction = mCloseAction != null && Objects.equals( mCloseAction.getActionIntent(), action.getActionIntent()); 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) { Loading @@ -520,6 +526,7 @@ public class PipMenuView extends FrameLayout { actionView.setImageDrawable(d); } }, mMainHandler); } actionView.setCustomCloseBackgroundVisibility( isCloseAction ? View.VISIBLE : View.GONE); actionView.setContentDescription(action.getContentDescription()); Loading