Search in sources :

Example 6 with NfcPreferenceController

use of com.android.settings.nfc.NfcPreferenceController in project android_packages_apps_Settings by LineageOS.

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;
}
Also used : BluetoothMasterSwitchPreferenceController(com.android.settings.bluetooth.BluetoothMasterSwitchPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) ArrayList(java.util.ArrayList) NfcPreferenceController(com.android.settings.nfc.NfcPreferenceController) UsbBackend(com.android.settings.deviceinfo.UsbBackend)

Example 7 with NfcPreferenceController

use of com.android.settings.nfc.NfcPreferenceController in project android_packages_apps_Settings by DirtyUnicorns.

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;
}
Also used : BluetoothMasterSwitchPreferenceController(com.android.settings.bluetooth.BluetoothMasterSwitchPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) ArrayList(java.util.ArrayList) NfcPreferenceController(com.android.settings.nfc.NfcPreferenceController) UsbBackend(com.android.settings.deviceinfo.UsbBackend)

Example 8 with NfcPreferenceController

use of com.android.settings.nfc.NfcPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AdvancedConnectedDeviceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    mContentResolver = mContext.getContentResolver();
    mNfcController = new NfcPreferenceController(mContext, NfcPreferenceController.KEY_TOGGLE_NFC);
    mShadowNfcAdapter = Shadows.shadowOf(NfcAdapter.getNfcAdapter(mContext));
}
Also used : NfcPreferenceController(com.android.settings.nfc.NfcPreferenceController) Before(org.junit.Before)

Aggregations

NfcPreferenceController (com.android.settings.nfc.NfcPreferenceController)8 BluetoothMasterSwitchPreferenceController (com.android.settings.bluetooth.BluetoothMasterSwitchPreferenceController)6 UsbBackend (com.android.settings.deviceinfo.UsbBackend)6 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)6 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)6 ArrayList (java.util.ArrayList)6 Before (org.junit.Before)2