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:
Dan Sandler
2020-02-19 14:58:08 -05:00
parent 490eba353b
commit f9a8552f74
8 changed files with 23 additions and 15 deletions

View File

@@ -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);