Hide misc in battery settings

Hide it in any condition:
1. both in app usage list and device usage list
2. in all targets(i.e. user, userdebug..)

Bug: 62422405
Test: RunSettingsRoboTests
Change-Id: I36bd043942ce7e2353163868bf6d86f422f8e7ee
This commit is contained in:
jackqdyulei
2017-06-26 10:36:05 -07:00
parent d793590678
commit d856294bf1
2 changed files with 33 additions and 25 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.fuelgauge;
import java.util.List;
import android.app.LoaderManager;
import android.content.Context;
import android.content.Intent;
@@ -511,6 +512,27 @@ public class PowerUsageSummaryTest {
assertThat(preference.showAnomalyIcon()).isTrue();
}
@Test
public void testShouldHideSipper_typeOvercounted_returnTrue() {
mNormalBatterySipper.drainType = BatterySipper.DrainType.OVERCOUNTED;
assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isTrue();
}
@Test
public void testShouldHideSipper_typeUnaccounted_returnTrue() {
mNormalBatterySipper.drainType = BatterySipper.DrainType.UNACCOUNTED;
assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isTrue();
}
@Test
public void testShouldHideSipper_typeNormal_returnFalse() {
mNormalBatterySipper.drainType = BatterySipper.DrainType.APP;
assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isFalse();
}
public static class TestFragment extends PowerUsageSummary {
private Context mContext;