Add control for the anomaly detection
Bug: 36924669 Test: RunSettingsRoboTests Change-Id: Id71b1324f567e7aa9b51dc25247fff9151d4e108
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
*/
|
||||
package com.android.settings.fuelgauge;
|
||||
|
||||
import android.app.LoaderManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
@@ -142,6 +144,8 @@ public class PowerUsageSummaryTest {
|
||||
private PowerManager mPowerManager;
|
||||
@Mock
|
||||
private SettingsActivity mSettingsActivity;
|
||||
@Mock
|
||||
private LoaderManager mLoaderManager;
|
||||
|
||||
private List<BatterySipper> mUsageList;
|
||||
private Context mRealContext;
|
||||
@@ -486,6 +490,18 @@ public class PowerUsageSummaryTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testInitAnomalyDetectionIfPossible_detectionEnabled_init() {
|
||||
when(mFeatureFactory.powerUsageFeatureProvider.isAnomalyDetectionEnabled()).thenReturn(
|
||||
true);
|
||||
doReturn(mLoaderManager).when(mFragment).getLoaderManager();
|
||||
|
||||
mFragment.initAnomalyDetectionIfPossible();
|
||||
|
||||
verify(mLoaderManager).initLoader(eq(PowerUsageSummary.ANOMALY_LOADER), eq(Bundle.EMPTY),
|
||||
any());
|
||||
}
|
||||
|
||||
public static class TestFragment extends PowerUsageSummary {
|
||||
|
||||
private Context mContext;
|
||||
|
Reference in New Issue
Block a user