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

Commit c04835b4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "URI parsing permission for SystemUI" into rvc-dev am: 6d0bd16d am:...

Merge "URI parsing permission for SystemUI" into rvc-dev am: 6d0bd16d am: e1fb16c1 am: 4c1c33f1

Change-Id: Ie57443b76a62fecf28f265d64db0e68d5879bc02
parents f0390859 4c1c33f1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.systemui.bubbles;

import android.app.Notification;
import android.content.Context;
import android.content.Intent;
import android.content.pm.LauncherApps;
import android.content.pm.ShortcutInfo;
import android.graphics.Bitmap;
@@ -59,6 +60,12 @@ public class BubbleIconFactory extends BaseIconFactory {
        } else {
            Icon ic = metadata.getBubbleIcon();
            if (ic != null) {
                if (ic.getType() == Icon.TYPE_URI
                        || ic.getType() == Icon.TYPE_URI_ADAPTIVE_BITMAP) {
                    context.grantUriPermission(context.getPackageName(),
                            ic.getUri(),
                            Intent.FLAG_GRANT_READ_URI_PERMISSION);
                }
                return ic.loadDrawable(context);
            }
            return null;
+13 −3
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.NonNull;
import android.app.Notification;
import android.app.Person;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutInfo;
@@ -33,6 +34,7 @@ import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.AsyncTask;
import android.os.Parcelable;
import android.service.notification.StatusBarNotification;
@@ -246,9 +248,17 @@ public class BubbleViewInfoTask extends AsyncTask<Void, Void, BubbleViewInfoTask
                    bubbleMessage.senderName = sender != null
                            ? sender.getName()
                            : null;
                    bubbleMessage.senderAvatar = sender != null && sender.getIcon() != null
                            ? sender.getIcon().loadDrawable(context)
                            : null;

                    bubbleMessage.senderAvatar = null;
                    if (sender != null && sender.getIcon() != null) {
                        if (sender.getIcon().getType() == Icon.TYPE_URI
                                || sender.getIcon().getType() == Icon.TYPE_URI_ADAPTIVE_BITMAP) {
                            context.grantUriPermission(context.getPackageName(),
                                    sender.getIcon().getUri(),
                                    Intent.FLAG_GRANT_READ_URI_PERMISSION);
                        }
                        bubbleMessage.senderAvatar = sender.getIcon().loadDrawable(context);
                    }
                    return bubbleMessage;
                }
            } else if (Notification.InboxStyle.class.equals(style)) {