use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SavedDeviceGroupControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
doReturn(mContext).when(mDashboardFragment).getContext();
doReturn(mPackageManager).when(mContext).getPackageManager();
mSavedDeviceGroupController = new SavedDeviceGroupController(mContext);
mSavedDeviceGroupController.setBluetoothDeviceUpdater(mBluetoothDeviceUpdater);
mSavedDeviceGroupController.setSavedDockUpdater(mSavedDockUpdater);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UsbDetailsDataRoleControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mLifecycle = new Lifecycle(() -> mLifecycle);
mPreferenceManager = new PreferenceManager(mContext);
mScreen = mPreferenceManager.createPreferenceScreen(mContext);
when(mFragment.getActivity()).thenReturn(mActivity);
when(mActivity.getApplicationContext()).thenReturn(mContext);
when(mFragment.getContext()).thenReturn(mContext);
when(mFragment.getPreferenceManager()).thenReturn(mPreferenceManager);
when(mFragment.getPreferenceScreen()).thenReturn(mScreen);
mDetailsDataRoleController = new UsbDetailsDataRoleController(mContext, mFragment, mUsbBackend);
mPreference = new PreferenceCategory(mContext);
mPreference.setKey(mDetailsDataRoleController.getPreferenceKey());
mScreen.addPreference(mPreference);
mDetailsDataRoleController.mHandler = mHandler;
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UsbDetailsFunctionsControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mLifecycle = new Lifecycle(() -> mLifecycle);
mPreferenceManager = new PreferenceManager(mContext);
mScreen = mPreferenceManager.createPreferenceScreen(mContext);
when(mFragment.getActivity()).thenReturn(mActivity);
when(mActivity.getApplicationContext()).thenReturn(mContext);
when(mFragment.getContext()).thenReturn(mContext);
when(mFragment.getPreferenceManager()).thenReturn(mPreferenceManager);
when(mFragment.getPreferenceScreen()).thenReturn(mScreen);
when(mContext.getSystemService(ConnectivityManager.class)).thenReturn(mConnectivityManager);
mDetailsFunctionsController = new UsbDetailsFunctionsController(mContext, mFragment, mUsbBackend);
mPreferenceCategory = new PreferenceCategory(mContext);
mPreferenceCategory.setKey(mDetailsFunctionsController.getPreferenceKey());
mScreen.addPreference(mPreferenceCategory);
mDetailsFunctionsController.displayPreference(mScreen);
mRadioButtonPreference = new RadioButtonPreference(mContext);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LogPersistPreferenceControllerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mController = spy(new LogPersistPreferenceController(mContext, mFragment, mLifecycle));
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
SystemProperties.set("ro.debuggable", "1");
mController.displayPreference(mScreen);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PictureColorModePreferenceControllerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mController = new PictureColorModePreferenceController(mContext, mLifecycle);
when(mPreferenceScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
when(mContext.getResources()).thenReturn(mResources);
when(mResources.getIntArray(R.array.color_mode_ids)).thenReturn(new int[0]);
mController.displayPreference(mPreferenceScreen);
}
Aggregations