diff --git a/src/com/android/settings/fuelgauge/BatterySettingsFeatureProvider.java b/src/com/android/settings/fuelgauge/BatterySettingsFeatureProvider.java
index cc333a5..62be5df 100644
--- a/src/com/android/settings/fuelgauge/BatterySettingsFeatureProvider.java
+++ b/src/com/android/settings/fuelgauge/BatterySettingsFeatureProvider.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 
+import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
 
 import java.util.List;
@@ -35,5 +36,9 @@
     boolean isBatteryInfoEnabled(Context context);
 
     /** A way to add more battery tip detectors. */
-    void addBatteryTipDetector(Context context, List<BatteryTip> tips, BatteryInfo batteryInfo);
+    void addBatteryTipDetector(
+            Context context,
+            List<BatteryTip> batteryTips,
+            BatteryInfo batteryInfo,
+            BatteryTipPolicy batteryTipPolicy);
 }
diff --git a/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImpl.java
index f974b9d..f398373 100644
--- a/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImpl.java
+++ b/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImpl.java
@@ -18,6 +18,8 @@
 
 import android.content.Context;
 
+import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
+import com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetector;
 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
 
 import java.util.List;
@@ -42,5 +44,10 @@
 
     @Override
     public void addBatteryTipDetector(
-            Context context, List<BatteryTip> tips, BatteryInfo batteryInfo) {}
+            Context context,
+            List<BatteryTip> batteryTips,
+            BatteryInfo batteryInfo,
+            BatteryTipPolicy batteryTipPolicy) {
+        batteryTips.add(new LowBatteryDetector(context, batteryTipPolicy, batteryInfo).detect());
+    }
 }
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryTipLoader.java b/src/com/android/settings/fuelgauge/batterytip/BatteryTipLoader.java
index 5352105..d68bf39 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryTipLoader.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryTipLoader.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.os.BatteryUsageStats;
-import android.os.PowerManager;
 
 import androidx.annotation.VisibleForTesting;
 
@@ -27,7 +26,6 @@
 import com.android.settings.fuelgauge.batterytip.detectors.BatteryDefenderDetector;
 import com.android.settings.fuelgauge.batterytip.detectors.HighUsageDetector;
 import com.android.settings.fuelgauge.batterytip.detectors.IncompatibleChargerDetector;
-import com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetector;
 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.utils.AsyncLoaderCompat;
@@ -56,19 +54,18 @@
     @Override
     public List<BatteryTip> loadInBackground() {
         final List<BatteryTip> tips = new ArrayList<>();
-        final BatteryTipPolicy policy = new BatteryTipPolicy(getContext());
+        final BatteryTipPolicy batteryTipPolicy = new BatteryTipPolicy(getContext());
         final BatteryInfo batteryInfo = mBatteryUtils.getBatteryInfo(TAG);
         final Context context = getContext().getApplicationContext();
-        final boolean isPowerSaveMode =
-                context.getSystemService(PowerManager.class).isPowerSaveMode();
 
-        tips.add(new LowBatteryDetector(context, policy, batteryInfo, isPowerSaveMode).detect());
-        tips.add(new HighUsageDetector(context, policy, mBatteryUsageStats, batteryInfo).detect());
+        tips.add(
+                new HighUsageDetector(context, batteryTipPolicy, mBatteryUsageStats, batteryInfo)
+                        .detect());
         tips.add(new BatteryDefenderDetector(batteryInfo, context).detect());
         tips.add(new IncompatibleChargerDetector(context).detect());
         FeatureFactory.getFeatureFactory()
                 .getBatterySettingsFeatureProvider()
-                .addBatteryTipDetector(context, tips, batteryInfo);
+                .addBatteryTipDetector(context, tips, batteryInfo, batteryTipPolicy);
         Collections.sort(tips);
         return tips;
     }
diff --git a/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetector.java b/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetector.java
index 1ce5a8e..b1a1562 100644
--- a/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetector.java
+++ b/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetector.java
@@ -17,6 +17,7 @@
 package com.android.settings.fuelgauge.batterytip.detectors;
 
 import android.content.Context;
+import android.os.PowerManager;
 
 import com.android.settings.fuelgauge.BatteryInfo;
 import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
@@ -26,37 +27,33 @@
 /** Detect whether the battery is too low */
 public class LowBatteryDetector implements BatteryTipDetector {
     private final BatteryInfo mBatteryInfo;
-    private final BatteryTipPolicy mPolicy;
+    private final BatteryTipPolicy mBatteryTipPolicy;
     private final boolean mIsPowerSaveMode;
     private final int mWarningLevel;
 
     public LowBatteryDetector(
-            Context context,
-            BatteryTipPolicy policy,
-            BatteryInfo batteryInfo,
-            boolean isPowerSaveMode) {
-        mPolicy = policy;
+            Context context, BatteryTipPolicy batteryTipPolicy, BatteryInfo batteryInfo) {
+        mBatteryTipPolicy = batteryTipPolicy;
         mBatteryInfo = batteryInfo;
         mWarningLevel =
                 context.getResources()
                         .getInteger(com.android.internal.R.integer.config_lowBatteryWarningLevel);
-        mIsPowerSaveMode = isPowerSaveMode;
+        mIsPowerSaveMode = context.getSystemService(PowerManager.class).isPowerSaveMode();
     }
 
     @Override
     public BatteryTip detect() {
         final boolean lowBattery = mBatteryInfo.batteryLevel <= mWarningLevel;
-        final boolean lowBatteryEnabled = mPolicy.lowBatteryEnabled && !mIsPowerSaveMode;
+        final boolean lowBatteryEnabled = mBatteryTipPolicy.lowBatteryEnabled && !mIsPowerSaveMode;
         final boolean dischargingLowBatteryState =
-                mPolicy.testLowBatteryTip || (mBatteryInfo.discharging && lowBattery);
-
-        int state = BatteryTip.StateType.INVISIBLE;
+                mBatteryTipPolicy.testLowBatteryTip || (mBatteryInfo.discharging && lowBattery);
 
         // Show it as new if in test or in discharging low battery state,
         // dismiss it if battery saver is on or disabled by config.
-        if (lowBatteryEnabled && dischargingLowBatteryState) {
-            state = BatteryTip.StateType.NEW;
-        }
+        final int state =
+                lowBatteryEnabled && dischargingLowBatteryState
+                        ? BatteryTip.StateType.NEW
+                        : BatteryTip.StateType.INVISIBLE;
 
         return new LowBatteryTip(state, mIsPowerSaveMode);
     }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImplTest.java
index 554227e..14ba337 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsFeatureProviderImplTest.java
@@ -22,11 +22,17 @@
 
 import androidx.test.core.app.ApplicationProvider;
 
+import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
+import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
+import com.android.settings.fuelgauge.batterytip.tips.LowBatteryTip;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
 
+import java.util.ArrayList;
+
 @RunWith(RobolectricTestRunner.class)
 public class BatterySettingsFeatureProviderImplTest {
     private BatterySettingsFeatureProviderImpl mImpl;
@@ -52,4 +58,15 @@
     public void isBatteryInfoEnabled_returnFalse() {
         assertThat(mImpl.isBatteryInfoEnabled(mContext)).isFalse();
     }
+
+    @Test
+    public void addBatteryTipDetector_containsLowBatteryTip() {
+        var tips = new ArrayList<BatteryTip>();
+
+        mImpl.addBatteryTipDetector(
+                mContext, tips, new BatteryInfo(), new BatteryTipPolicy(mContext));
+
+        var expectedResult = tips.stream().anyMatch(tip -> tip instanceof LowBatteryTip);
+        assertThat(expectedResult).isTrue();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetectorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetectorTest.java
index 8e3de7c..c5897f2 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetectorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/LowBatteryDetectorTest.java
@@ -19,20 +19,25 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.Mockito.spy;
+import static org.robolectric.Shadows.shadowOf;
 
 import android.content.Context;
+import android.os.PowerManager;
+
+import androidx.test.core.app.ApplicationProvider;
 
 import com.android.settings.fuelgauge.BatteryInfo;
 import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
 import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
 
 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.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
 import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
 import org.robolectric.util.ReflectionHelpers;
 
 import java.util.concurrent.TimeUnit;
@@ -40,73 +45,79 @@
 @RunWith(RobolectricTestRunner.class)
 public class LowBatteryDetectorTest {
 
+    @Rule public MockitoRule mockitoRule = MockitoJUnit.rule();
+
     @Mock private BatteryInfo mBatteryInfo;
-    private BatteryTipPolicy mPolicy;
+
+    private BatteryTipPolicy mBatteryTipPolicy;
     private LowBatteryDetector mLowBatteryDetector;
     private Context mContext;
+    private PowerManager mPowerManager;
 
     @Before
     public void setUp() {
-        MockitoAnnotations.initMocks(this);
+        mContext = ApplicationProvider.getApplicationContext();
+        mBatteryTipPolicy = spy(new BatteryTipPolicy(mContext));
 
-        mPolicy = spy(new BatteryTipPolicy(RuntimeEnvironment.application));
-        mContext = RuntimeEnvironment.application;
-        ReflectionHelpers.setField(mPolicy, "lowBatteryEnabled", true);
+        mPowerManager = mContext.getSystemService(PowerManager.class);
+        shadowOf(mPowerManager).setIsPowerSaveMode(false);
+
+        ReflectionHelpers.setField(mBatteryTipPolicy, "lowBatteryEnabled", true);
         mBatteryInfo.discharging = true;
 
-        mLowBatteryDetector =
-                new LowBatteryDetector(
-                        mContext, mPolicy, mBatteryInfo, false /* isPowerSaveMode */);
+        mLowBatteryDetector = new LowBatteryDetector(mContext, mBatteryTipPolicy, mBatteryInfo);
     }
 
     @Test
-    public void testDetect_disabledByPolicy_tipInvisible() {
-        ReflectionHelpers.setField(mPolicy, "lowBatteryEnabled", false);
-        mLowBatteryDetector =
-                new LowBatteryDetector(mContext, mPolicy, mBatteryInfo, true /* isPowerSaveMode */);
+    public void detect_disabledByPolicy_tipInvisible() {
+        ReflectionHelpers.setField(mBatteryTipPolicy, "lowBatteryEnabled", false);
+        shadowOf(mPowerManager).setIsPowerSaveMode(true);
+        mLowBatteryDetector = new LowBatteryDetector(mContext, mBatteryTipPolicy, mBatteryInfo);
 
         assertThat(mLowBatteryDetector.detect().isVisible()).isFalse();
     }
 
     @Test
-    public void testDetect_enabledByTest_tipNew() {
-        ReflectionHelpers.setField(mPolicy, "testLowBatteryTip", true);
+    public void detect_enabledByTest_tipNew() {
+        ReflectionHelpers.setField(mBatteryTipPolicy, "testLowBatteryTip", true);
 
         assertThat(mLowBatteryDetector.detect().getState()).isEqualTo(BatteryTip.StateType.NEW);
     }
 
     @Test
-    public void testDetect_lowBattery_tipNew() {
+    public void detect_lowBattery_tipNew() {
         mBatteryInfo.batteryLevel = 20;
         mBatteryInfo.remainingTimeUs = TimeUnit.DAYS.toMillis(1);
+
         assertThat(mLowBatteryDetector.detect().getState()).isEqualTo(BatteryTip.StateType.NEW);
     }
 
     @Test
-    public void testDetect_batterySaverOn_tipInvisible() {
-        mLowBatteryDetector =
-                new LowBatteryDetector(mContext, mPolicy, mBatteryInfo, true /* isPowerSaveMode */);
+    public void detect_batterySaverOn_tipInvisible() {
+        shadowOf(mPowerManager).setIsPowerSaveMode(true);
+        mLowBatteryDetector = new LowBatteryDetector(mContext, mBatteryTipPolicy, mBatteryInfo);
 
         assertThat(mLowBatteryDetector.detect().getState())
                 .isEqualTo(BatteryTip.StateType.INVISIBLE);
     }
 
     @Test
-    public void testDetect_charging_tipInvisible() {
+    public void detect_charging_tipInvisible() {
         mBatteryInfo.discharging = false;
 
         assertThat(mLowBatteryDetector.detect().isVisible()).isFalse();
     }
 
     @Test
-    public void testDetect_lowTimeEstimation_tipInvisible() {
+    public void detect_lowTimeEstimation_tipInvisible() {
         mBatteryInfo.batteryLevel = 50;
         mBatteryInfo.remainingTimeUs = TimeUnit.MINUTES.toMillis(1);
+
         assertThat(mLowBatteryDetector.detect().isVisible()).isFalse();
     }
 
     @Test
-    public void testDetect_noEarlyWarning_tipInvisible() {
+    public void detect_noEarlyWarning_tipInvisible() {
         mBatteryInfo.remainingTimeUs = TimeUnit.DAYS.toMicros(1);
         mBatteryInfo.batteryLevel = 100;
 
