diff --git a/res/xml/power_usage_summary.xml b/res/xml/power_usage_summary.xml
index 21a836d..c7cf873 100644
--- a/res/xml/power_usage_summary.xml
+++ b/res/xml/power_usage_summary.xml
@@ -26,6 +26,7 @@
         android:title="@string/summary_placeholder"
         android:selectable="false"
         android:paddingBottom="0px"
+        android:persistent="false"
         settings:controller="com.android.settings.fuelgauge.BatteryHeaderPreferenceController" />
 
     <com.android.settings.fuelgauge.BatteryHeaderTextPreference
diff --git a/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt b/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt
new file mode 100644
index 0000000..2a9b0e8
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt
@@ -0,0 +1,95 @@
+/*
+ * 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.fuelgauge
+
+import android.content.Context
+import androidx.annotation.VisibleForTesting
+import androidx.preference.Preference
+import com.android.settings.R
+import com.android.settings.fuelgauge.BatteryBroadcastReceiver.BatteryUpdateType.BATTERY_NOT_PRESENT
+import com.android.settingslib.Utils
+import com.android.settingslib.fuelgauge.BatteryUtils
+import com.android.settingslib.metadata.PreferenceLifecycleContext
+import com.android.settingslib.metadata.PreferenceLifecycleProvider
+import com.android.settingslib.metadata.PreferenceMetadata
+import com.android.settingslib.preference.PreferenceBinding
+import com.android.settingslib.widget.UsageProgressBarPreference
+
+// LINT.IfChange
+class BatteryHeaderPreference :
+    PreferenceMetadata,
+    PreferenceBinding,
+    PreferenceLifecycleProvider {
+
+    @VisibleForTesting
+    var batteryBroadcastReceiver: BatteryBroadcastReceiver? = null
+
+    override val key: String
+        get() = KEY
+
+    override val title: Int
+        get() = R.string.summary_placeholder
+
+    override fun createWidget(context: Context) = UsageProgressBarPreference(context)
+
+    override fun bind(preference: Preference, metadata: PreferenceMetadata) {
+        super.bind(preference, metadata)
+        preference.isSelectable = false
+        if (preference is UsageProgressBarPreference) {
+            quickUpdateHeaderPreference(preference)
+        }
+    }
+
+    override fun isIndexable(context: Context) = false
+
+    override fun onCreate(context: PreferenceLifecycleContext) {
+        super.onCreate(context)
+        batteryBroadcastReceiver = BatteryBroadcastReceiver(context).apply {
+            setBatteryChangedListener {
+                if (it != BATTERY_NOT_PRESENT) {
+                    context.notifyPreferenceChange(KEY)
+                }
+            }
+        }
+    }
+
+    override fun onStart(context: PreferenceLifecycleContext) {
+        super.onStart(context)
+        batteryBroadcastReceiver?.register();
+    }
+
+    override fun onStop(context: PreferenceLifecycleContext) {
+        super.onStop(context)
+        batteryBroadcastReceiver?.unRegister();
+    }
+
+    companion object {
+        private const val KEY = "battery_header"
+        private const val BATTERY_MAX_LEVEL: Long = 100L
+
+        private fun quickUpdateHeaderPreference(preference: UsageProgressBarPreference) {
+            val batteryIntent = BatteryUtils.getBatteryIntent(preference.context) ?: return
+            val batteryLevel: Int = Utils.getBatteryLevel(batteryIntent)
+            preference.apply {
+                setUsageSummary(com.android.settings.Utils.formatPercentage(batteryLevel))
+                setPercent(batteryLevel.toLong(), BATTERY_MAX_LEVEL)
+                setBottomSummary("")
+            }
+        }
+    }
+}
+// LINT.ThenChange(BatteryHeaderPreferenceController.java)
diff --git a/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
index 18c0f01..adcd7d1 100644
--- a/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
@@ -34,6 +34,7 @@
 import com.android.settingslib.Utils;
 import com.android.settingslib.widget.UsageProgressBarPreference;
 
+// LINT.IfChange
 /** Controller that update the battery header view */
 public class BatteryHeaderPreferenceController extends BasePreferenceController
         implements PreferenceControllerMixin, LifecycleEventObserver {
@@ -113,3 +114,4 @@
         return com.android.settings.Utils.formatPercentage(batteryLevel);
     }
 }
+// LINT.ThenChange(BatteryHeaderPreference.kt)
diff --git a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageSummaryScreen.kt b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageSummaryScreen.kt
index b397bf3..9ff46b9 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageSummaryScreen.kt
+++ b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageSummaryScreen.kt
@@ -19,6 +19,7 @@
 import com.android.settings.R
 import com.android.settings.display.BatteryPercentageSwitchPreference
 import com.android.settings.flags.Flags
+import com.android.settings.fuelgauge.BatteryHeaderPreference
 import com.android.settingslib.metadata.PreferenceAvailabilityProvider
 import com.android.settingslib.metadata.PreferenceIconProvider
 import com.android.settingslib.metadata.ProvidePreferenceScreen
@@ -53,8 +54,10 @@
             R.drawable.ic_settings_battery_white
         }
 
-    override fun getPreferenceHierarchy(context: Context) =
-        preferenceHierarchy(this) { +BatteryPercentageSwitchPreference() }
+    override fun getPreferenceHierarchy(context: Context) = preferenceHierarchy(this) {
+        +BatteryHeaderPreference()
+        +BatteryPercentageSwitchPreference()
+    }
 
     companion object {
         const val KEY = "power_usage_summary_screen"
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
index a4b8b29..44d386f 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceControllerTest.java
@@ -48,6 +48,7 @@
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
+// LINT.IfChange
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {ShadowEntityHeaderController.class, ShadowUtils.class})
 public class BatteryHeaderPreferenceControllerTest {
@@ -164,3 +165,4 @@
         return com.android.settings.Utils.formatPercentage(BATTERY_LEVEL);
     }
 }
+// LINT.ThenChange(BatteryHeaderPreferenceTest.java)
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceTest.kt b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceTest.kt
new file mode 100644
index 0000000..27e14c8
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceTest.kt
@@ -0,0 +1,85 @@
+/*
+ * 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.fuelgauge
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.ContextWrapper
+import android.content.Intent
+import android.content.IntentFilter
+import android.os.BatteryManager.EXTRA_LEVEL
+import android.os.BatteryManager.EXTRA_SCALE
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.settingslib.metadata.PreferenceLifecycleContext
+import com.android.settingslib.preference.createAndBindWidget
+import com.android.settingslib.widget.UsageProgressBarPreference
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+
+// LINT.IfChange
+@RunWith(AndroidJUnit4::class)
+class BatteryHeaderPreferenceTest {
+    private val mockLifecycleContext = mock<PreferenceLifecycleContext>()
+    private val mockBatteryBroadcastReceiver = mock<BatteryBroadcastReceiver>()
+    private val batteryHeaderPreference = BatteryHeaderPreference()
+
+    private val context: Context =
+        object : ContextWrapper(ApplicationProvider.getApplicationContext()) {
+            override fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?) =
+                Intent(Intent.ACTION_BATTERY_CHANGED)
+                    .putExtra(EXTRA_LEVEL, 60)
+                    .putExtra(EXTRA_SCALE, 100)
+        }
+
+    @Test
+    fun createAndBindWidget_selectableIsFalse() {
+        val usageProgressBarPreference =
+            batteryHeaderPreference.createAndBindWidget<UsageProgressBarPreference>(context)
+
+        assertThat(usageProgressBarPreference.isSelectable).isFalse()
+    }
+
+    @Test
+    fun onCreate_createBatteryBroadcastReceiver() {
+        batteryHeaderPreference.onCreate(mockLifecycleContext)
+
+        assertThat(batteryHeaderPreference.batteryBroadcastReceiver).isNotNull()
+    }
+
+    @Test
+    fun onStart_invokeRegisterMethod() {
+        batteryHeaderPreference.batteryBroadcastReceiver = mockBatteryBroadcastReceiver
+
+        batteryHeaderPreference.onStart(mockLifecycleContext)
+
+        verify(mockBatteryBroadcastReceiver).register()
+    }
+
+    @Test
+    fun onStop_invokeUnRegisterMethod() {
+        batteryHeaderPreference.batteryBroadcastReceiver = mockBatteryBroadcastReceiver
+
+        batteryHeaderPreference.onStop(mockLifecycleContext)
+
+        verify(mockBatteryBroadcastReceiver).unRegister()
+    }
+}
+// LINT.ThenChange(BatteryHeaderPreferenceControllerTest.java)
