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

Commit eb036399 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Support updated rendering of conversation icons." into rvc-dev am: c1f6891e

Change-Id: I1c94629f0d01ada4c0a6444ab11aa685a7414f4b
parents 52be7605 c1f6891e
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -37,14 +37,11 @@ import android.content.pm.PackageManager;
import android.content.pm.ParceledListSlice;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.service.notification.ConversationChannelWrapper;
import android.service.notification.NotifyingApp;
import android.text.format.DateUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
@@ -522,17 +519,17 @@ public class NotificationBackend {
    }

    public Drawable getConversationDrawable(Context context, ShortcutInfo info, String pkg,
            int uid) {
            int uid, boolean important) {
        if (info == null) {
            return null;
        }
        ConversationIconFactory iconFactory = new ConversationIconFactory(context,
                context.getSystemService(LauncherApps.class),
                context.getPackageManager(), IconDrawableFactory.newInstance(context),
                context.getPackageManager(),
                IconDrawableFactory.newInstance(context, false),
                context.getResources().getDimensionPixelSize(
                        R.dimen.conversation_icon_size));
        return new BitmapDrawable(context.getResources(),
                iconFactory.getConversationBitmap(info, pkg, uid));
        return iconFactory.getConversationDrawable(info, pkg, uid, important);
    }

    public void requestPinShortcut(Context context, ShortcutInfo shortcutInfo) {
+2 −1
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ public class AppConversationListPreferenceController extends NotificationPrefere
                conversation.getParentChannelLabel(), conversation.getGroupLabel())
                : conversation.getParentChannelLabel());
        if (si != null) {
            pref.setIcon(mBackend.getConversationDrawable(mContext, si, mAppRow.pkg, mAppRow.uid));
            pref.setIcon(mBackend.getConversationDrawable(mContext, si, mAppRow.pkg, mAppRow.uid,
                    conversation.getNotificationChannel().isImportantConversation()));
        }
        pref.setKey(conversation.getNotificationChannel().getId());

+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen
                    .setHasAppInfoLink(true)
                    .setRecyclerView(mFragment.getListView(), mFragment.getSettingsLifecycle())
                    .done(activity, mContext);

            pref.findViewById(R.id.entity_header).setVisibility(View.VISIBLE);
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ public class ConversationImportantPreferenceController extends NotificationPrefe
        mChannel.setImportantConversation(value);
        if (value && bubbleImportantConversations()) {
            mChannel.setAllowBubbles(true);
            mDependentFieldListener.onFieldValueChanged();
        }
        mDependentFieldListener.onFieldValueChanged();
        saveChannel();

        return true;
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe
        pref.setTitle(getTitle(conversation));
        pref.setSummary(getSummary(conversation));
        pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(),
                conversation.getPkg(), conversation.getUid()));
                conversation.getPkg(), conversation.getUid(),
                conversation.getNotificationChannel().isImportantConversation()));
        pref.setKey(conversation.getNotificationChannel().getId());
        pref.setIntent(getIntent(conversation, pref.getTitle()));

Loading