Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 409a6b7b authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "Disallow loading icon from content URI to PipMenu" into udc-dev am:...

Merge "Disallow loading icon from content URI to PipMenu" into udc-dev am: 4020882d am: 83feb9b9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23475236



Change-Id: Idc7a4060d1bf6c4a6170019043eebae0937554c4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a035b6e0 83feb9b9
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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) {
@@ -520,6 +526,7 @@ public class PipMenuView extends FrameLayout {
                                actionView.setImageDrawable(d);
                            }
                        }, mMainHandler);
                    }
                    actionView.setCustomCloseBackgroundVisibility(
                            isCloseAction ? View.VISIBLE : View.GONE);
                    actionView.setContentDescription(action.getContentDescription());