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

Commit 31262f43 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 sc-dev am: 1f2e080f am: 0fbf93b9

parents 88601d2e 0fbf93b9
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -43,6 +43,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;
@@ -488,6 +489,11 @@ public class PipMenuView extends FrameLayout {
                    final PipMenuActionView actionView =
                            (PipMenuActionView) mActionsGroup.getChildAt(i);

                    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) {
@@ -495,6 +501,7 @@ public class PipMenuView extends FrameLayout {
                                actionView.setImageDrawable(d);
                            }
                        }, mMainHandler);
                    }
                    actionView.setContentDescription(action.getContentDescription());
                    if (action.isEnabled()) {
                        actionView.setOnClickListener(v -> {