Add conversations image to People DND setting page

Previously the image was only on the Conversations settings page, but it
should also be included on the People settings page too.

Test: manual
Bug: 151845457
Change-Id: I99af85b3dcc266a1a5743755fe3cb31fc16ccfba
This commit is contained in:
Beverly
2020-04-02 12:06:49 -04:00
committed by Beverly Tai
parent e1839d2955
commit e646b28e26
2 changed files with 15 additions and 3 deletions

View File

@@ -25,6 +25,12 @@
android:key="zen_mode_settings_category_conversations"
android:title="@string/zen_mode_conversations_section_title">
<!-- Senders image -->
<com.android.settingslib.widget.LayoutPreference
android:key="zen_mode_conversations_image"
android:layout="@layout/zen_mode_senders_overlay_image"
android:selectable="false"/>
<Preference
android:key="zen_mode_conversations"
android:title="@string/zen_mode_conversations_title"

View File

@@ -25,6 +25,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.android.settings.R;
import com.android.settings.notification.NotificationBackend;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -47,12 +48,16 @@ public class ZenModePeopleSettings extends ZenModeSettingsBase implements Indexa
app = null;
}
return buildPreferenceControllers(
context, getSettingsLifecycle(), app, this, getFragmentManager());
context, getSettingsLifecycle(), app, this, getFragmentManager(),
new NotificationBackend());
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
Lifecycle lifecycle, Application app, Fragment host, FragmentManager fragmentManager) {
Lifecycle lifecycle, Application app, Fragment host, FragmentManager fragmentManager,
NotificationBackend notificationBackend) {
List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new ZenModeConversationsImagePreferenceController(context,
"zen_mode_conversations_image", lifecycle, notificationBackend));
controllers.add(new ZenModeConversationsPreferenceController(context,
"zen_mode_conversations", lifecycle));
controllers.add(new ZenModeCallsPreferenceController(context, lifecycle,
@@ -83,7 +88,8 @@ public class ZenModePeopleSettings extends ZenModeSettingsBase implements Indexa
@Override
public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null, null, null);
return buildPreferenceControllers(context, null, null, null,
null, null);
}
};
}