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

Commit d6ff657b authored by jackqdyulei's avatar jackqdyulei Committed by android-build-merger
Browse files

Init BatteryUtils in constructor

am: 116fec5b

Change-Id: I74636f77f8ee44576894ed25eb48212386f8ee40
parents d83e5198 116fec5b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public class BackgroundCheckAction extends AnomalyAction {
        super(context);
        mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        mActionMetricKey = MetricsProto.MetricsEvent.ACTION_APP_BACKGROUND_CHECK;
        mBatteryUtils = BatteryUtils.getInstance(context);
    }

    @Override
+7 −0
Original line number Diff line number Diff line
@@ -94,4 +94,11 @@ public class BackgroundCheckActionTest {

        assertThat(mBackgroundCheckAction.isActionActive(mAnomaly)).isFalse();
    }

    @Test
    public void testConstructor_batteryUtilsNotNull() {
        mBackgroundCheckAction = new BackgroundCheckAction(mContext);

        assertThat(mBackgroundCheckAction.mBatteryUtils).isNotNull();
    }
}