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

Commit e646b28e authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

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
parent e1839d29
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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"
+9 −3
Original line number Diff line number Diff line
@@ -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);
                }
            };
}