/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/bluetooth/ |
D | BluetoothDevicePreference.java | 56 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 81 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 82 mCachedDevice.registerCallback(this); in BluetoothDevicePreference() 93 return mCachedDevice == null in shouldHideSecondTarget() 94 || mCachedDevice.getBondState() != BluetoothDevice.BOND_BONDED in shouldHideSecondTarget() 105 return mCachedDevice; in getCachedDevice() 111 mCachedDevice.unregisterCallback(this); in onPrepareForRemoval() 119 return mCachedDevice; in getBluetoothDevice() 132 setTitle(mCachedDevice.getName()); in onDeviceAttributesChanged() 134 setSummary(mCachedDevice.getConnectionSummary()); in onDeviceAttributesChanged() [all …]
|
/packages/apps/Settings/src/com/android/settings/bluetooth/ |
D | BluetoothDevicePreference.java | 57 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 82 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 83 mCachedDevice.registerCallback(this); in BluetoothDevicePreference() 94 return mCachedDevice == null in shouldHideSecondTarget() 95 || mCachedDevice.getBondState() != BluetoothDevice.BOND_BONDED in shouldHideSecondTarget() 106 return mCachedDevice; in getCachedDevice() 112 mCachedDevice.unregisterCallback(this); in onPrepareForRemoval() 120 return mCachedDevice; in getBluetoothDevice() 133 setTitle(mCachedDevice.getName()); in onDeviceAttributesChanged() 135 setSummary(mCachedDevice.getConnectionSummary()); in onDeviceAttributesChanged() [all …]
|
D | BluetoothDetailsProfilesController.java | 57 private CachedBluetoothDevice mCachedDevice; field in BluetoothDetailsProfilesController 65 mCachedDevice = device; in BluetoothDetailsProfilesController() 89 pref.setTitle(profile.getNameResource(mCachedDevice.getDevice())); in createProfilePreference() 100 BluetoothDevice device = mCachedDevice.getDevice(); in refreshProfilePreference() 101 profilePref.setEnabled(!mCachedDevice.isBusy()); in refreshProfilePreference() 124 highQualityPref.setEnabled(!mCachedDevice.isBusy()); in refreshProfilePreference() 136 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in enableProfile() 152 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in disableProfile() 192 List<LocalBluetoothProfile> result = mCachedDevice.getConnectableProfiles(); in getProfiles() 193 final BluetoothDevice device = mCachedDevice.getDevice(); in getProfiles() [all …]
|
D | BluetoothDeviceDetailsFragment.java | 73 CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragment 109 mCachedDevice = getCachedDevice(mDeviceAddress); in onAttach() 110 if (mCachedDevice == null) { in onAttach() 116 use(AdvancedBluetoothDetailsHeaderController.class).init(mCachedDevice); in onAttach() 124 ? featureProvider.getBluetoothDeviceSettingsUri(mCachedDevice.getDevice()) in onAttach() 154 RemoteDeviceNameDialogFragment.newInstance(mCachedDevice).show( in onOptionsItemSelected() 165 if (mCachedDevice != null) { in createPreferenceControllers() 167 controllers.add(new BluetoothDetailsHeaderController(context, this, mCachedDevice, in createPreferenceControllers() 169 controllers.add(new BluetoothDetailsButtonsController(context, this, mCachedDevice, in createPreferenceControllers() 172 mCachedDevice, lifecycle)); in createPreferenceControllers() [all …]
|
D | AdvancedBluetoothDetailsHeaderController.java | 69 private CachedBluetoothDevice mCachedDevice; field in AdvancedBluetoothDetailsHeaderController 96 mCachedDevice.getDevice(), BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET); in getAvailabilityStatus() 114 mCachedDevice.registerCallback(this::onDeviceAttributesChanged); in onStart() 115 mBluetoothAdapter.addOnMetadataChangedListener(mCachedDevice.getDevice(), in onStart() 124 mCachedDevice.unregisterCallback(this::onDeviceAttributesChanged); in onStop() 125 mBluetoothAdapter.removeOnMetadataChangedListener(mCachedDevice.getDevice(), in onStop() 144 mCachedDevice = cachedBluetoothDevice; in init() 149 if (mLayoutPreference != null && mCachedDevice != null) { in refresh() 151 title.setText(mCachedDevice.getName()); in refresh() 153 summary.setText(mCachedDevice.getConnectionSummary(true /* shortSummary */)); in refresh() [all …]
|
D | BluetoothDetailsButtonsController.java | 48 ForgetDeviceDialogFragment.newInstance(mCachedDevice.getAddress()); in onForgetButtonPressed() 64 mActionButtons.setButton2Enabled(!mCachedDevice.isBusy()); in refresh() 67 mIsConnected = mCachedDevice.isConnected(); in refresh() 73 .setButton2OnClickListener(view -> mCachedDevice.disconnect()); in refresh() 82 view -> mCachedDevice.connect()); in refresh()
|
D | BluetoothDetailsHeaderController.java | 61 || !BluetoothUtils.getBooleanMetaData(mCachedDevice.getDevice(), in isAvailable() 75 BluetoothUtils.getBtRainbowDrawableWithDescription(mContext, mCachedDevice); in setHeaderProperties() 76 String summaryText = mCachedDevice.getConnectionSummary(); in setHeaderProperties() 80 mDeviceManager.getSubDeviceSummary(mCachedDevice)); in setHeaderProperties() 81 mHeaderController.setLabel(mCachedDevice.getName()); in setHeaderProperties()
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/ |
D | BluetoothDevicePreferenceTest.java | 49 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceTest 57 mPreference = new BluetoothDevicePreference(mContext, mCachedDevice); in setUp() 69 verify(mCachedDevice).registerCallback(any(CachedBluetoothDevice.Callback.class)); in onAttached_registersDeviceCallback() 75 when(mCachedDevice.getName()).thenReturn(name); in onAttached_setsDeviceNameAsTitle() 85 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in onAttached_setsCarConnectionSummaryAsSummary() 94 when(mCachedDevice.getBtClass()).thenReturn( in onAttached_setsIcon() 104 when(mCachedDevice.isBusy()).thenReturn(false); in onAttached_deviceNotBusy_setsEnabled() 113 when(mCachedDevice.isBusy()).thenReturn(true); in onAttached_deviceBusy_setsNotEnabled() 122 when(mCachedDevice.hasHumanReadableName()).thenReturn(false); in onAttached_deviceNameNotHumanReadable_setsHidden() 132 when(mCachedDevice.hasHumanReadableName()).thenReturn(false); in onAttached_deviceNameNotHumanReadable_showWithoutNamesTrue_setsShown() [all …]
|
D | BluetoothDeviceDetailsFragmentTest.java | 59 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragmentTest 81 when(mCachedDeviceManager.findDevice(device)).thenReturn(mCachedDevice); in setUp() 82 when(mCachedDevice.getAddress()).thenReturn(address); in setUp() 84 mFragment = BluetoothDeviceDetailsFragment.newInstance(mCachedDevice); in setUp() 101 verify(mCachedDevice).unpair(); in forgetButtonClicked_unpairsDevice() 116 when(mCachedDevice.isConnected()).thenReturn(true); in connectionButtonClicked_deviceConnected_disconnectsDevice() 121 verify(mCachedDevice).disconnect(); in connectionButtonClicked_deviceConnected_disconnectsDevice() 126 when(mCachedDevice.isConnected()).thenReturn(false); in connectionButtonClicked_deviceNotConnected_connectsDevice() 131 verify(mCachedDevice).connect(/* connectAllProfiles= */ true); in connectionButtonClicked_deviceNotConnected_connectsDevice() 136 when(mCachedDevice.isConnected()).thenReturn(true); in deviceConnected_connectionButtonShowsDisconnect() [all …]
|
D | BluetoothDeviceProfilePreferenceTest.java | 53 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceProfilePreferenceTest 63 when(mCachedDevice.getDevice()).thenReturn(mDevice); in setUp() 66 mPreference = new BluetoothDeviceProfilePreference(mContext, mProfile, mCachedDevice); in setUp() 83 verify(mCachedDevice).registerCallback(any(CachedBluetoothDevice.Callback.class)); in onAttached_registersDeviceCallback() 88 when(mCachedDevice.isBusy()).thenReturn(false); in onAttached_deviceNotBusy_setsEnabled() 97 when(mCachedDevice.isBusy()).thenReturn(true); in onAttached_deviceBusy_setsNotEnabled() 128 mPreference = new BluetoothDeviceProfilePreference(mContext, mProfile, mCachedDevice); in onAttached_panProfile_connected_setsChecked() 141 mPreference = new BluetoothDeviceProfilePreference(mContext, mProfile, mCachedDevice); in onAttached_panProfile_notConnected_setsUnchecked() 151 when(mCachedDevice.isBusy()).thenReturn(false); in onDeviceAttributesChanged_refreshesUi() 155 verify(mCachedDevice).registerCallback(callbackCaptor.capture()); in onDeviceAttributesChanged_refreshesUi() [all …]
|
D | BluetoothDeviceProfilesPreferenceControllerTest.java | 63 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceProfilesPreferenceControllerTest 73 when(mCachedDevice.getDevice()).thenReturn(mDevice); in setUp() 86 mController.setCachedDevice(mCachedDevice); in setUp() 100 when(mCachedDevice.getProfiles()).thenReturn(Collections.singletonList(profile1)); in refreshUi_addsNewProfiles() 108 when(mCachedDevice.getProfiles()).thenReturn(Arrays.asList(profile1, profile2)); in refreshUi_addsNewProfiles() 124 when(mCachedDevice.getProfiles()).thenReturn(Arrays.asList(profile1, profile2)); in refreshUi_removesRemovedProfiles() 130 when(mCachedDevice.getProfiles()).thenReturn(Collections.singletonList(profile2)); in refreshUi_removesRemovedProfiles() 131 when(mCachedDevice.getRemovedProfiles()).thenReturn(Collections.singletonList(profile1)); in refreshUi_removesRemovedProfiles() 145 when(mCachedDevice.getProfiles()).thenReturn(Collections.singletonList(profile)); in refreshUi_profiles_showsPreference() 154 when(mCachedDevice.getProfiles()).thenReturn(Collections.emptyList()); in refreshUi_noProfiles_hidesPreference() [all …]
|
D | BluetoothDisconnectConfirmDialogFragmentTest.java | 56 private CachedBluetoothDevice mCachedDevice; field in BluetoothDisconnectConfirmDialogFragmentTest 75 when(mCachedDeviceManager.findDevice(device)).thenReturn(mCachedDevice); in setUp() 76 when(mCachedDevice.getAddress()).thenReturn(address); in setUp() 77 when(mCachedDevice.isConnected()).thenReturn(true); in setUp() 79 mFragment = BluetoothDisconnectConfirmDialogFragment.newInstance(mCachedDevice); in setUp() 95 verify(mCachedDevice).disconnect(); in confirmDisconnect_disconnectsFromDevice() 103 verify(mCachedDevice).registerCallback(callbackCaptor.capture()); in deviceNoLongerConnected_dismiss() 105 when(mCachedDevice.isConnected()).thenReturn(false); in deviceNoLongerConnected_dismiss()
|
D | RemoteRenameDialogFragmentTest.java | 59 private CachedBluetoothDevice mCachedDevice; field in RemoteRenameDialogFragmentTest 78 when(mCachedDeviceManager.findDevice(device)).thenReturn(mCachedDevice); in setUp() 79 when(mCachedDevice.getAddress()).thenReturn(address); in setUp() 81 mFragment = RemoteRenameDialogFragment.newInstance(mCachedDevice); in setUp() 93 when(mCachedDevice.getName()).thenReturn(NAME); in getDeviceName_returnsCachedDeviceName() 101 when(mCachedDevice.getName()).thenReturn(NAME); in setDeviceName_updatesCachedDeviceName() 108 verify(mCachedDevice).setName(NAME_UPDATED); in setDeviceName_updatesCachedDeviceName()
|
D | BluetoothScanningDevicesGroupPreferenceControllerTest.java | 72 private CachedBluetoothDevice mCachedDevice; field in BluetoothScanningDevicesGroupPreferenceControllerTest 98 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_NONE); in setUp() 99 when(mCachedDevice.getDevice()).thenReturn(mDevice); in setUp() 101 Collections.singletonList(mCachedDevice)); in setUp() 150 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in onScanningStateChanged_scanningDisabled_receiveStopped_doesNothing() 165 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in onDeviceBondStateChanged_refreshesUi() 167 mController.onDeviceBondStateChanged(mCachedDevice, BluetoothDevice.BOND_BONDING); in onDeviceBondStateChanged_refreshesUi() 227 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_stopsScanning() 237 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_disablesGroup() 247 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_setsScanModeConnectable()
|
/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/ |
D | BluetoothDevicePreference.java | 44 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 50 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 61 return mCachedDevice; in getCachedDevice() 67 mCachedDevice.registerCallback(mDeviceCallback); in onAttached() 74 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached() 78 setTitle(mCachedDevice.getName()); in refreshUi() 79 setSummary(mCachedDevice.getCarConnectionSummary()); in refreshUi() 82 .getBtClassDrawableWithDescription(getContext(), mCachedDevice); in refreshUi() 88 setEnabled(!mCachedDevice.isBusy()); in refreshUi() 89 setVisible(mShowDevicesWithoutNames || mCachedDevice.hasHumanReadableName()); in refreshUi() [all …]
|
D | BluetoothDeviceDetailsFragment.java | 47 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragment 76 mCachedDevice.unpair(); in onCreate() 99 mCachedDevice = manager.getCachedDeviceManager().findDevice(remoteDevice); in onAttach() 100 if (mCachedDevice == null) { in onAttach() 106 R.string.pk_bluetooth_device_name).setCachedDevice(mCachedDevice); in onAttach() 108 R.string.pk_bluetooth_device_profiles).setCachedDevice(mCachedDevice); in onAttach() 110 R.string.pk_bluetooth_device_address).setCachedDevice(mCachedDevice); in onAttach() 116 mCachedDevice.registerCallback(mDeviceCallback); in onStart() 123 mCachedDevice.unregisterCallback(mDeviceCallback); in onStop() 127 mConnectionButton.setEnabled(!mCachedDevice.isBusy()); in updateConnectionButtonState() [all …]
|
D | BluetoothDeviceProfilePreference.java | 35 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceProfilePreference 42 mCachedDevice = cachedDevice; in BluetoothDeviceProfilePreference() 58 return mCachedDevice; in getCachedDevice() 64 mCachedDevice.registerCallback(mDeviceCallback); in onAttached() 71 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached() 75 setEnabled(!mCachedDevice.isBusy()); in refreshUi() 78 mProfile.getConnectionStatus(mCachedDevice.getDevice()) == STATE_CONNECTED); in refreshUi() 80 setChecked(mProfile.isEnabled(mCachedDevice.getDevice())); in refreshUi()
|
D | BluetoothDisconnectConfirmDialogFragment.java | 43 private CachedBluetoothDevice mCachedDevice; field in BluetoothDisconnectConfirmDialogFragment 65 mCachedDevice = manager.getCachedDeviceManager().findDevice(device); in onAttach() 72 String name = mCachedDevice.getName(); in onCreateDialog() 83 (dialog, which) -> mCachedDevice.disconnect()) in onCreateDialog() 95 mCachedDevice.registerCallback(mDeviceCallback); in onStart() 101 mCachedDevice.unregisterCallback(mDeviceCallback); in onStop() 110 if (!mCachedDevice.isConnected() && getDialog().isShowing()) { in dismissIfNotConnected()
|
D | BluetoothDevicePreferenceController.java | 43 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceController 56 mCachedDevice = device; in setCachedDevice() 63 return mCachedDevice; in getCachedDevice() 69 if (mCachedDevice == null) { in checkInitialized() 87 mCachedDevice.registerCallback(mDeviceCallback); in onStartInternal() 93 mCachedDevice.unregisterCallback(mDeviceCallback); in onStopInternal()
|
D | RemoteRenameDialogFragment.java | 38 private CachedBluetoothDevice mCachedDevice; field in RemoteRenameDialogFragment 56 mCachedDevice = manager.getCachedDeviceManager().findDevice(device); in onAttach() 67 if (mCachedDevice != null) { in getDeviceName() 68 return mCachedDevice.getName(); in getDeviceName() 75 if (mCachedDevice != null) { in setDeviceName() 76 mCachedDevice.setName(deviceName); in setDeviceName()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
D | BluetoothDetailsButtonsControllerTest.java | 60 new BluetoothDetailsButtonsController(mContext, mFragment, mCachedDevice, in setUp() 78 when(mCachedDevice.isBusy()).thenReturn(false); in setUp() 94 verify(mCachedDevice).disconnect(); in clickOnDisconnect() 99 when(mCachedDevice.isConnected()).thenReturn(false); in clickOnConnect() 105 verify(mCachedDevice).connect(); in clickOnConnect() 115 when(mCachedDevice.isConnected()).thenReturn(false); in becomeDisconnected() 121 verify(mCachedDevice).connect(); in becomeDisconnected() 127 when(mCachedDevice.isConnected()).thenReturn(false); in becomeConnected() 134 when(mCachedDevice.isConnected()).thenReturn(true); in becomeConnected() 140 verify(mCachedDevice).disconnect(); in becomeConnected() [all …]
|
D | RemoteDeviceNameDialogFragmentTest.java | 54 private CachedBluetoothDevice mCachedDevice; field in RemoteDeviceNameDialogFragmentTest 64 when(mCachedDevice.getAddress()).thenReturn(deviceAddress); in setUp() 65 mFragment = spy(RemoteDeviceNameDialogFragment.newInstance(mCachedDevice)); in setUp() 66 doReturn(mCachedDevice).when(mFragment).getDevice(any()); in setUp() 76 when(mCachedDevice.getName()).thenReturn(deviceName); in startDialog() 116 verify(mCachedDevice).setName(deviceNameModified); in deviceNameEditSucceeds() 131 verify(mCachedDevice, never()).setName(anyString()); in deviceNameEditThenCancelDoesntRename()
|
D | ForgetDeviceDialogFragmentTest.java | 59 private CachedBluetoothDevice mCachedDevice; field in ForgetDeviceDialogFragmentTest 75 when(mCachedDevice.getAddress()).thenReturn(deviceAddress); in setUp() 76 when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp() 77 when(mCachedDevice.getName()).thenReturn(DEVICE_NAME); in setUp() 79 doReturn(mCachedDevice).when(mFragment).getDevice(any()); in setUp() 88 verify(mCachedDevice, never()).unpair(); in cancelDialog() 97 verify(mCachedDevice).unpair(); in confirmDialog()
|
D | BluetoothDetailsControllerTestBase.java | 59 protected CachedBluetoothDevice mCachedDevice; field in BluetoothDetailsControllerTestBase 150 when(mCachedDevice.getName()).thenReturn(config.getName()); in setupDevice() 152 when(mCachedDevice.isConnected()).thenReturn(config.isConnected()); in setupDevice() 153 when(mCachedDevice.getConnectionSummary()).thenReturn(config.getConnectionSummary()); in setupDevice() 156 when(mCachedDevice.getDevice()).thenReturn(mDevice); in setupDevice() 157 when(mCachedDevice.getAddress()).thenReturn(config.getAddress()); in setupDevice()
|
D | BluetoothDetailsHeaderControllerTest.java | 70 when(mCachedDeviceManager.getSubDeviceSummary(mCachedDevice)).thenReturn("abc"); in setUp() 72 new BluetoothDetailsHeaderController(mContext, mFragment, mCachedDevice, mLifecycle, in setUp() 78 when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp() 110 when(mCachedDevice.getConnectionSummary()) in connectionStatusChangesWhileScreenOpen() 116 when(mCachedDevice.getConnectionSummary()).thenReturn(null); in connectionStatusChangesWhileScreenOpen() 120 when(mCachedDevice.getConnectionSummary()) in connectionStatusChangesWhileScreenOpen()
|