diff --git a/res/values/config.xml b/res/values/config.xml
index 433620d..9d71671 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -709,7 +709,7 @@
     <bool name="default_allow_sensitive_lockscreen_content">true</bool>
 
     <!-- Whether to enable the app battery usage list page feature. -->
-    <bool name="config_app_battery_usage_list_enabled">true</bool>
+    <bool name="config_app_battery_usage_list_enabled">false</bool>
 
     <!-- Whether sim related information is visible to the end user. -->
     <bool name="config_show_sim_info">true</bool>
diff --git a/res/xml/power_usage_summary.xml b/res/xml/power_usage_summary.xml
index e62f5c0..1af8a8c 100644
--- a/res/xml/power_usage_summary.xml
+++ b/res/xml/power_usage_summary.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2023 The Android Open Source Project
+<!-- 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.
@@ -51,6 +51,13 @@
         settings:keywords="@string/keywords_battery_saver"
         settings:controller="com.android.settings.fuelgauge.BatterySaverController" />
 
+    <Preference
+        android:fragment="com.android.settings.fuelgauge.SmartBatterySettings"
+        android:key="smart_battery_manager"
+        android:title="@string/smart_battery_manager_title"
+        settings:controller="com.android.settings.fuelgauge.batterytip.BatteryManagerPreferenceController"
+        settings:keywords="@string/keywords_battery_adaptive_preferences" />
+
     <SwitchPreferenceCompat
         android:key="battery_percentage"
         android:title="@string/battery_percentage"
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
index 0bc6176..a04d8f8 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
@@ -98,6 +98,12 @@
     /** Checks whether we should show usage information by slots or not */
     boolean isChartGraphSlotsEnabled(Context context);
 
+    /** Checks whether adaptive charging feature is supported in this device */
+    boolean isAdaptiveChargingSupported();
+
+    /** Checks whether battery manager feature is supported in this device */
+    boolean isBatteryManagerSupported();
+
     /** Returns {@code true} if current defender mode is extra defend */
     boolean isExtraDefend();
 
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
index a8a2f75..75ebabb 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
@@ -149,6 +149,16 @@
     }
 
     @Override
+    public boolean isAdaptiveChargingSupported() {
+        return false;
+    }
+
+    @Override
+    public boolean isBatteryManagerSupported() {
+        return true;
+    }
+
+    @Override
     public Intent getResumeChargeIntent(boolean isDockDefender) {
         return null;
     }
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java b/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java
new file mode 100644
index 0000000..7448003
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java
@@ -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.batterytip;
+
+import android.app.AppOpsManager;
+import android.content.Context;
+import android.os.UserManager;
+
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settingslib.utils.StringUtil;
+
+/** Preference controller to control the battery manager */
+public class BatteryManagerPreferenceController extends BasePreferenceController {
+    private static final String KEY_BATTERY_MANAGER = "smart_battery_manager";
+
+    private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
+    private AppOpsManager mAppOpsManager;
+    private UserManager mUserManager;
+    private boolean mEnableAppBatteryUsagePage;
+
+    public BatteryManagerPreferenceController(Context context) {
+        super(context, KEY_BATTERY_MANAGER);
+        mPowerUsageFeatureProvider = FeatureFactory.getFeatureFactory()
+                .getPowerUsageFeatureProvider();
+        mAppOpsManager = context.getSystemService(AppOpsManager.class);
+        mUserManager = context.getSystemService(UserManager.class);
+        mEnableAppBatteryUsagePage =
+                mContext.getResources().getBoolean(R.bool.config_app_battery_usage_list_enabled);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (!mPowerUsageFeatureProvider.isBatteryManagerSupported()) {
+            return UNSUPPORTED_ON_DEVICE;
+        }
+        if (!mContext.getResources().getBoolean(R.bool.config_battery_manager_consider_ac)) {
+            return AVAILABLE_UNSEARCHABLE;
+        }
+        return mPowerUsageFeatureProvider.isAdaptiveChargingSupported()
+                ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        if (!mEnableAppBatteryUsagePage) {
+            final int num = BatteryTipUtils.getRestrictedAppsList(mAppOpsManager,
+                    mUserManager).size();
+            updateSummary(preference, num);
+        }
+    }
+
+    @VisibleForTesting
+    void updateSummary(Preference preference, int num) {
+        if (num > 0) {
+            preference.setSummary(StringUtil.getIcuPluralsString(mContext, num,
+                    R.string.battery_manager_app_restricted));
+        } else {
+            preference.setSummary(
+                    mPowerUsageFeatureProvider.isAdaptiveChargingSupported()
+                            ? R.string.battery_manager_summary
+                            : R.string.battery_manager_summary_unsupported);
+        }
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
index 0131330..db4c359 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImplTest.java
@@ -134,6 +134,11 @@
     }
 
     @Test
+    public void testIsAdaptiveChargingSupported_returnFalse() {
+        assertThat(mPowerFeatureProvider.isAdaptiveChargingSupported()).isFalse();
+    }
+
+    @Test
     public void testGetResumeChargeIntentWithoutDockDefender_returnNull() {
         assertThat(mPowerFeatureProvider.getResumeChargeIntent(false)).isNull();
     }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java
new file mode 100644
index 0000000..f7469c7
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.batterytip;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.app.AppOpsManager;
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.Preference;
+
+import com.android.settings.R;
+import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
+import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settings.testutils.shadow.SettingsShadowResources;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(shadows = SettingsShadowResources.class)
+public class BatteryManagerPreferenceControllerTest {
+    private static final int ON = 1;
+    private static final int OFF = 0;
+
+    @Mock
+    private AppOpsManager mAppOpsManager;
+
+    private Context mContext;
+    private Preference mPreference;
+    private FakeFeatureFactory mFeatureFactory;
+    private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
+    private BatteryManagerPreferenceController mController;
+
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getSystemService(AppOpsManager.class)).thenReturn(mAppOpsManager);
+        mFeatureFactory = FakeFeatureFactory.setupForTest();
+        mPreference = new Preference(mContext);
+        mController = new BatteryManagerPreferenceController(mContext);
+        mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
+    }
+
+    @Test
+    public void updateState_smartBatteryWithRestrictApps_showSummary() {
+        mController.updateSummary(mPreference, 2);
+
+        assertThat(mPreference.getSummary()).isEqualTo("2 apps restricted");
+    }
+
+    @Test
+    public void updateState_smartBatteryWithoutRestriction_showSummary() {
+        when(mPowerUsageFeatureProvider.isSmartBatterySupported()).thenReturn(true);
+        Settings.Global.putInt(mContext.getContentResolver(),
+                Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, ON);
+
+        mController.updateState(mPreference);
+
+        assertThat(mPreference.getSummary()).isEqualTo("Detecting when apps drain battery");
+    }
+
+    @Test
+    public void getAvailabilityStatus_supportBatteryManager_showPrefPage() {
+        SettingsShadowResources.overrideResource(
+                R.bool.config_battery_manager_consider_ac, true);
+        when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
+        when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(true);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BatteryManagerPreferenceController.AVAILABLE_UNSEARCHABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_notSupportBatteryManager_notShowPrefPage() {
+        when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(false);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_supportBatteryManagerWithoutAC_notShowPrefPage() {
+        SettingsShadowResources.overrideResource(
+                R.bool.config_battery_manager_consider_ac, true);
+        when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
+        when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(false);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_ignoreBatteryManagerWithoutAC_showPrefPage() {
+        SettingsShadowResources.overrideResource(
+                R.bool.config_battery_manager_consider_ac, false);
+        when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
+        when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(false);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BatteryManagerPreferenceController.AVAILABLE_UNSEARCHABLE);
+    }
+}
