diff --git a/res/values/strings.xml b/res/values/strings.xml
index 73a3b55..fc0ee78 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2836,6 +2836,10 @@
     <string name="dark_ui_bedtime_footer_summary">Dark theme is currently following your Bedtime mode schedule</string>
     <!-- Dark UI screen footer action text shown when the when Dark theme turns on/off automatically according to a user bedtime schedule. [CHAR LIMIT=NONE] -->
     <string name="dark_ui_bedtime_footer_action">Bedtime mode settings</string>
+    <!-- Even Dimmer setting title. Allows device to reduce brightness even further than standard range. [CHAR LIMIT=NONE] -->
+    <string name="even_dimmer_display_title">Even Dimmer</string>
+    <!-- Even Dimmer setting summary. [CHAR LIMIT=NONE] -->
+    <string name="even_dimmer_display_summary">Allow device to go dimmer than usual</string>
 
 
     <!-- Sound & display settings screen, setting option name to change screen timeout -->
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index 2df360d..5b4bee8 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -36,6 +36,11 @@
             android:title="@string/auto_brightness_title"
             android:fragment="com.android.settings.display.AutoBrightnessSettings"
             settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"/>
+        <SwitchPreferenceCompat
+            android:key="even_dimmer_activated"
+            android:title="@string/even_dimmer_display_title"
+            android:summary="@string/even_dimmer_display_summary"
+            settings:controller="com.android.settings.display.EvenDimmerPreferenceController"/>
     </PreferenceCategory>
 
     <PreferenceCategory
diff --git a/src/com/android/settings/display/EvenDimmerPreferenceController.java b/src/com/android/settings/display/EvenDimmerPreferenceController.java
new file mode 100644
index 0000000..b86c845
--- /dev/null
+++ b/src/com/android/settings/display/EvenDimmerPreferenceController.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.display;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.provider.Settings;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import com.android.server.display.feature.flags.Flags;
+import com.android.settings.R;
+import com.android.settings.core.TogglePreferenceController;
+
+/**
+ * Controller for the settings toggle which allows screen brightness to go even dimmer than usual.
+ *
+ */
+public class EvenDimmerPreferenceController extends TogglePreferenceController {
+
+    private static final String TAG = "EvenDimmerPreferenceController";
+
+    private final Resources mResources;
+
+    public EvenDimmerPreferenceController(@NonNull Context context, @NonNull String key) {
+        super(context, key);
+        mResources = context.getResources();
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        // enable based on flag and config.xml
+        final boolean enabledInConfig = mResources.getBoolean(
+                com.android.internal.R.bool.config_evenDimmerEnabled);
+        return (Flags.evenDimmer() && enabledInConfig) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public boolean isChecked() {
+        return getEvenDimmerActivated();
+    }
+
+    @Override
+    public boolean setChecked(boolean isChecked) {
+        final float enabled = getAvailabilityStatus() == AVAILABLE && isChecked ? 1 : 0;
+        Log.i(TAG, "setChecked to : " + enabled);
+
+        return Settings.Secure.putFloat(
+                mContext.getContentResolver(), Settings.Secure.EVEN_DIMMER_ACTIVATED, enabled);
+    }
+
+    @Override
+    public int getSliceHighlightMenuRes() {
+        return R.string.menu_key_display;
+    }
+
+    private boolean getEvenDimmerActivated() {
+        return Settings.Secure.getFloat(mContext.getContentResolver(),
+                Settings.Secure.EVEN_DIMMER_ACTIVATED, 0) == 1;
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/display/EvenDimmerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/EvenDimmerPreferenceControllerTest.java
new file mode 100644
index 0000000..a3cf151
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/display/EvenDimmerPreferenceControllerTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.display;
+
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.platform.test.annotations.RequiresFlagsDisabled;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.provider.Settings;
+
+import com.android.server.display.feature.flags.Flags;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+
+@RunWith(RobolectricTestRunner.class)
+public class EvenDimmerPreferenceControllerTest {
+
+    private EvenDimmerPreferenceController mController;
+    @Mock
+    private Context mContext;
+    @Mock
+    private Resources mResources;
+
+    @Rule
+    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        when(mContext.getResources()).thenReturn(mResources);
+        mController = new EvenDimmerPreferenceController(mContext, "key");
+    }
+
+    @RequiresFlagsDisabled(Flags.FLAG_EVEN_DIMMER)
+    @Test
+    public void testGetAvailabilityStatus_flagOffconfigTrue() {
+        when(mContext.getResources()).thenReturn(mResources);
+        when(mResources.getBoolean(
+                com.android.internal.R.bool.config_evenDimmerEnabled)).thenReturn(true);
+        // setup
+        mController = new EvenDimmerPreferenceController(mContext, "key");
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @RequiresFlagsDisabled(Flags.FLAG_EVEN_DIMMER)
+    @Test
+    public void testGetCheckedStatus_setTrue() throws Settings.SettingNotFoundException {
+        // setup
+        mController = new EvenDimmerPreferenceController(mContext, "key");
+        mController.setChecked(true);
+
+        assertThat(Settings.Secure.getFloat(mContext.getContentResolver(),
+                Settings.Secure.EVEN_DIMMER_ACTIVATED)).isEqualTo(0.0f); // false
+    }
+
+    @RequiresFlagsEnabled(Flags.FLAG_EVEN_DIMMER)
+    @Test
+    public void testGetAvailabilityStatus_flagOnConfigTrue() {
+        when(mContext.getResources()).thenReturn(mResources);
+        when(mResources.getBoolean(
+                com.android.internal.R.bool.config_evenDimmerEnabled)).thenReturn(true);
+        // setup
+        mController = new EvenDimmerPreferenceController(mContext, "key");
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_EVEN_DIMMER)
+    public void testSetChecked_enable() throws Settings.SettingNotFoundException {
+        mController.setChecked(true);
+        assertThat(Settings.Secure.getFloat(mContext.getContentResolver(),
+                Settings.Secure.EVEN_DIMMER_ACTIVATED)).isEqualTo(1.0f); // true
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_EVEN_DIMMER)
+    public void testSetChecked_disable() throws Settings.SettingNotFoundException {
+        mController.setChecked(false);
+        assertThat(Settings.Secure.getFloat(mContext.getContentResolver(),
+                Settings.Secure.EVEN_DIMMER_ACTIVATED)).isEqualTo(0.0f); // false
+    }
+}
