Support updated rendering of conversation icons.
Note that changes to channel settings now generate onResume() for all available controllers to ensure they get the updated drawable. Bug: 149747760 Change-Id: I3f73c025b1d32194e3d5147d03cb781e370f2a1b Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.notification"
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import com.android.settings.applications.AppInfoBase;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.notification.NotificationBackend;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.notification.ConversationIconFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -204,7 +205,8 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
mContext, mPkg, mUid, mChannel.getConversationId());
|
||||
if (mConversationInfo != null) {
|
||||
mConversationDrawable = mBackend.getConversationDrawable(
|
||||
mContext, mConversationInfo, mAppRow.pkg, mAppRow.uid);
|
||||
mContext, mConversationInfo, mAppRow.pkg, mAppRow.uid,
|
||||
mChannel.isImportantConversation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,6 +331,12 @@ abstract public class NotificationSettings extends DashboardFragment {
|
||||
|
||||
protected class DependentFieldListener {
|
||||
protected void onFieldValueChanged() {
|
||||
// Reload the conversation drawable, which shows some channel/conversation state
|
||||
if (mConversationDrawable != null && mConversationDrawable
|
||||
instanceof ConversationIconFactory.ConversationIconDrawable) {
|
||||
((ConversationIconFactory.ConversationIconDrawable) mConversationDrawable)
|
||||
.setImportant(mChannel.isImportantConversation());
|
||||
}
|
||||
final PreferenceScreen screen = getPreferenceScreen();
|
||||
for (NotificationPreferenceController controller : mControllers) {
|
||||
controller.displayPreference(screen);
|
||||
|
||||
Reference in New Issue
Block a user