use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class WpsPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
when(mScreen.findPreference(anyString())).thenReturn(mWpsPushPref).thenReturn(mWpsPinPref);
mController = new WpsPreferenceController(mContext, mLifecycle, mWifiManager, mFragmentManager);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class WifiDetailActionBarObserverTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
when(mockFragment.getActivity()).thenReturn(mockActivity);
when(mockActivity.getActionBar()).thenReturn(mockActionBar);
mObserver = new WifiDetailActionBarObserver(mContext, mockFragment);
mLifecycle.addObserver(mObserver);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by crdroidandroid.
the class BluetoothSettings method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
mDeviceNamePrefController = new BluetoothDeviceNamePreferenceController(context, lifecycle);
mPairingPrefController = new BluetoothPairingPreferenceController(context, this, (SettingsActivity) getActivity());
controllers.add(mDeviceNamePrefController);
controllers.add(mPairingPrefController);
controllers.add(new BluetoothFilesPreferenceController(context));
controllers.add(new BluetoothDeviceRenamePreferenceController(context, this, lifecycle));
return controllers;
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by crdroidandroid.
the class ConnectedDeviceDashboardFragment method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
final NfcPreferenceController nfcPreferenceController = new NfcPreferenceController(context);
lifecycle.addObserver(nfcPreferenceController);
controllers.add(nfcPreferenceController);
mUsbPrefController = new UsbModePreferenceController(context, new UsbBackend(context));
lifecycle.addObserver(mUsbPrefController);
controllers.add(mUsbPrefController);
final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController = new BluetoothMasterSwitchPreferenceController(context, Utils.getLocalBtManager(context), this, (SettingsActivity) getActivity());
lifecycle.addObserver(bluetoothPreferenceController);
controllers.add(bluetoothPreferenceController);
SmsMirroringFeatureProvider smsMirroringFeatureProvider = FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
AbstractPreferenceController smsMirroringController = smsMirroringFeatureProvider.getController(context);
controllers.add(smsMirroringController);
return controllers;
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.
the class ConnectedDeviceDashboardFragment method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
final NfcPreferenceController nfcPreferenceController = new NfcPreferenceController(context);
lifecycle.addObserver(nfcPreferenceController);
controllers.add(nfcPreferenceController);
mUsbPrefController = new UsbModePreferenceController(context, new UsbBackend(context));
lifecycle.addObserver(mUsbPrefController);
controllers.add(mUsbPrefController);
final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController = new BluetoothMasterSwitchPreferenceController(context, Utils.getLocalBtManager(context), this, (SettingsActivity) getActivity());
lifecycle.addObserver(bluetoothPreferenceController);
controllers.add(bluetoothPreferenceController);
SmsMirroringFeatureProvider smsMirroringFeatureProvider = FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
AbstractPreferenceController smsMirroringController = smsMirroringFeatureProvider.getController(context);
controllers.add(smsMirroringController);
return controllers;
}
Aggregations