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

Commit 8451e9a0 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

[DO NOT MERGE][conflict] Merge "Disallow loading icon from content URI to...

[DO NOT MERGE][conflict] Merge "Disallow loading icon from content URI to PipMenu" into rvc-dev am: 5d31bd1c

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



Bug: 293475290
Change-Id: Ic50edc109c89378aacc926b5b56aa142f9a01bbb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b93914a7 5d31bd1c
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -560,13 +561,17 @@ public class PipMenuActivity extends Activity {
                    final RemoteAction action = mActions.get(i);
                    final ImageButton actionView = (ImageButton) 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(this, d -> {
                        if (d != null) {
                              d.setTint(Color.WHITE);
                              actionView.setImageDrawable(d);
                        }
                        }, mHandler);
                    }
                    actionView.setContentDescription(action.getContentDescription());
                    if (action.isEnabled()) {
                        actionView.setOnClickListener(v -> {