Search in sources :

Example 1 with CardPreference

use of com.android.settings.widget.CardPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BatteryTipPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = RuntimeEnvironment.application;
    mCardPreference = spy(new CardPreference(mContext));
    when(mPreferenceScreen.getContext()).thenReturn(mContext);
    doReturn(mCardPreference).when(mPreferenceScreen).findPreference(KEY_PREF);
    mFeatureFactory = FakeFeatureFactory.setupForTest();
    mOldBatteryTips = new ArrayList<>();
    mOldBatteryTips.add(new SummaryTip(BatteryTip.StateType.NEW, AVERAGE_TIME_MS));
    mNewBatteryTips = new ArrayList<>();
    mNewBatteryTips.add(new SummaryTip(BatteryTip.StateType.INVISIBLE, AVERAGE_TIME_MS));
    mBatteryTipPreferenceController = buildBatteryTipPreferenceController();
    mBatteryTipPreferenceController.mCardPreference = mCardPreference;
    mBatteryTipPreferenceController.mPrefContext = mContext;
}
Also used : SummaryTip(com.android.settings.fuelgauge.batterytip.tips.SummaryTip) CardPreference(com.android.settings.widget.CardPreference) Before(org.junit.Before)

Aggregations

SummaryTip (com.android.settings.fuelgauge.batterytip.tips.SummaryTip)1 CardPreference (com.android.settings.widget.CardPreference)1 Before (org.junit.Before)1