/aosp12/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/ |
H A D | CachedBluetoothDeviceTest.java | 80 private CachedBluetoothDevice mCachedDevice; field in CachedBluetoothDeviceTest 280 mCachedDevice.onAudioModeChanged(); in getConnectionSummary_testSingleProfileActiveDeviceHfp() 359 mCachedDevice. in getConnectionSummary_testSingleProfileActiveDeviceHearingAid() 873 mCachedDevice.setName(name); in setName_setDeviceNameIsNotNull() 880 mCachedDevice.setName(null); in setName_setDeviceNameIsNull() 918 mCachedDevice.mRssi = RSSI_1; in switchSubDeviceContent() 960 mCachedDevice.onUuidChanged(); in onUuidChanged_bluetoothClassIsNull_shouldNotCrash() 976 mCachedDevice.refresh(); in getDrawableWithDescription_isAdvancedDevice_returnAdvancedIcon() 987 mCachedDevice.refresh(); in getDrawableWithDescription_isNotAdvancedDevice_returnBluetoothIcon() 1000 mCachedDevice.refresh(); in releaseLruCache_lruCacheShouldBeRelease() [all …]
|
/aosp12/packages/apps/Settings/src/com/android/settings/bluetooth/ |
H A D | BluetoothDevicePreference.java | 108 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 123 return mCachedDevice == null in shouldHideSecondTarget() 135 return mCachedDevice; in getCachedDevice() 171 return mCachedDevice; in getBluetoothDevice() 188 setTitle(mCachedDevice.getName()); in onPreferenceAttributesChanged() 235 return mCachedDevice.equals( in equals() 241 return mCachedDevice.hashCode(); in hashCode() 253 return mCachedDevice in compareTo() 269 if (mCachedDevice.isConnected()) { in onClicked() 276 mCachedDevice.connect(); in onClicked() [all …]
|
H A D | BluetoothDeviceDetailsFragment.java | 75 CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragment 111 mCachedDevice = getCachedDevice(mDeviceAddress); in onAttach() 113 if (mCachedDevice == null) { in onAttach() 119 use(AdvancedBluetoothDetailsHeaderController.class).init(mCachedDevice); in onAttach() 127 ? featureProvider.getBluetoothDeviceSettingsUri(mCachedDevice.getDevice()) in onAttach() 139 if (mCachedDevice.getBondState() == BOND_NONE) { in finishFragmentIfNecessary() 171 RemoteDeviceNameDialogFragment.newInstance(mCachedDevice).show( in onOptionsItemSelected() 182 if (mCachedDevice != null) { in createPreferenceControllers() 184 controllers.add(new BluetoothDetailsHeaderController(context, this, mCachedDevice, in createPreferenceControllers() 189 mCachedDevice, lifecycle)); in createPreferenceControllers() [all …]
|
H A D | BluetoothDetailsProfilesController.java | 60 private CachedBluetoothDevice mCachedDevice; field in BluetoothDetailsProfilesController 70 mCachedDevice = device; in BluetoothDetailsProfilesController() 95 pref.setTitle(profile.getNameResource(mCachedDevice.getDevice())); in createProfilePreference() 106 BluetoothDevice device = mCachedDevice.getDevice(); in refreshProfilePreference() 107 profilePref.setEnabled(!mCachedDevice.isBusy()); in refreshProfilePreference() 130 highQualityPref.setEnabled(!mCachedDevice.isBusy()); in refreshProfilePreference() 142 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in enableProfile() 158 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in disableProfile() 199 final BluetoothDevice device = mCachedDevice.getDevice(); in getProfiles() 228 BluetoothDevice device = mCachedDevice.getDevice(); in maybeAddHighQualityAudioPref() [all …]
|
H A D | AdvancedBluetoothDetailsHeaderController.java | 94 private CachedBluetoothDevice mCachedDevice; field in AdvancedBluetoothDetailsHeaderController 122 if (mCachedDevice == null) { in getAvailabilityStatus() 125 return Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) in getAvailabilityStatus() 142 mCachedDevice.registerCallback(this); in onStart() 154 mCachedDevice.unregisterCallback(this); in onStop() 172 mCachedDevice = cachedBluetoothDevice; in init() 177 if (mLayoutPreference != null && mCachedDevice != null) { in refresh() 179 title.setText(mCachedDevice.getName()); in refresh() 183 if (!mCachedDevice.isConnected() || mCachedDevice.isBusy()) { in refresh() 187 final BluetoothDevice device = mCachedDevice.getDevice(); in refresh() [all …]
|
H A 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()
|
H A D | BluetoothDetailsHeaderController.java | 56 return !Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()); in isAvailable() 69 BluetoothUtils.getBtRainbowDrawableWithDescription(mContext, mCachedDevice); in setHeaderProperties() 70 String summaryText = mCachedDevice.getConnectionSummary(); in setHeaderProperties() 76 mHeaderController.setSecondSummary(mDeviceManager.getSubDeviceSummary(mCachedDevice)); in setHeaderProperties() 78 mHeaderController.setLabel(mCachedDevice.getName()); in setHeaderProperties()
|
H A D | BluetoothDetailsController.java | 42 protected final CachedBluetoothDevice mCachedDevice; field in BluetoothDetailsController 49 mCachedDevice = device; in BluetoothDetailsController() 55 mCachedDevice.unregisterCallback(this); in onPause() 60 mCachedDevice.registerCallback(this); in onResume()
|
/aosp12/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/ |
H A D | BluetoothDevicePreferenceTest.java | 54 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceTest 82 when(mCachedDevice.getName()).thenReturn(name); in onAttached_setsDeviceNameAsTitle() 102 when(mCachedDevice.isConnected()).thenReturn(true); in onAttached_connected_setsConnectedAsSummary() 113 when(mCachedDevice.getBtClass()).thenReturn( in onAttached_setsIcon() 123 when(mCachedDevice.isBusy()).thenReturn(false); in onAttached_deviceNotBusy_setsEnabled() 132 when(mCachedDevice.isBusy()).thenReturn(true); in onAttached_deviceBusy_setsNotEnabled() 176 when(mCachedDevice.getName()).thenReturn(name); in onDeviceAttributesChanged_refreshesUi() 179 when(mCachedDevice.isBusy()).thenReturn(false); in onDeviceAttributesChanged_refreshesUi() 193 when(mCachedDevice.isBusy()).thenReturn(true); in onDeviceAttributesChanged_refreshesUi() 205 mCachedDevice); in equals_devicesEqual_returnsTrue() [all …]
|
H A D | BluetoothDeviceActionButtonsPreferenceControllerTest.java | 62 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceActionButtonsPreferenceControllerTest 93 verify(mCachedDevice).unpair(); in forgetButtonClicked_unpairsDevice() 107 when(mCachedDevice.isConnected()).thenReturn(true); in connectionButtonClicked_deviceConnected_disconnectsDevice() 112 verify(mCachedDevice).disconnect(); in connectionButtonClicked_deviceConnected_disconnectsDevice() 117 when(mCachedDevice.isConnected()).thenReturn(false); in connectionButtonClicked_deviceNotConnected_connectsDevice() 122 verify(mCachedDevice).connect(); in connectionButtonClicked_deviceNotConnected_connectsDevice() 127 when(mCachedDevice.isConnected()).thenReturn(true); in deviceConnected_connectionButtonShowsDisconnect() 145 when(mCachedDevice.isBusy()).thenReturn(true); in deviceBusy_connectionButtonDisabled() 153 when(mCachedDevice.isBusy()).thenReturn(false); in deviceNotBusy_connectionButtonEnabled() 161 when(mCachedDevice.isBusy()).thenReturn(true); in deviceAttributesChanged_updatesConnectionButtonState() [all …]
|
H A D | BluetoothDeviceNamePreferenceControllerTest.java | 65 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceNamePreferenceControllerTest 85 mPreferenceController.setCachedDevice(mCachedDevice); in setUp() 93 when(mCachedDevice.getName()).thenReturn(name); in refreshUi_setsDeviceNameAsTitle() 103 when(mCachedDevice.isConnected()).thenReturn(true); in refreshUi_connected_setsCarConnectionSummaryAsSummary() 104 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in refreshUi_connected_setsCarConnectionSummaryAsSummary() 113 when(mCachedDevice.isConnected()).thenReturn(false); in refreshUi_notConnected_setsDisconnectedAsSummary() 123 when(mCachedDevice.getBtClass()).thenReturn( in refreshUi_setsIcon() 134 when(mCachedDevice.isConnected()).thenReturn(true); in refreshUi_hearingAidDevice_setsBatteryStatusesAsSummary() 135 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in refreshUi_hearingAidDevice_setsBatteryStatusesAsSummary() 137 when(mCachedDeviceManager.getSubDeviceSummary(mCachedDevice)).thenReturn("other summary"); in refreshUi_hearingAidDevice_setsBatteryStatusesAsSummary()
|
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/media/ |
H A D | BluetoothMediaDevice.java | 37 private CachedBluetoothDevice mCachedDevice; field in BluetoothMediaDevice 42 mCachedDevice = device; in BluetoothMediaDevice() 48 return mCachedDevice.getName(); in getName() 53 return isConnected() || mCachedDevice.isBusy() in getSummary() 54 ? mCachedDevice.getConnectionSummary() in getSummary() 61 BluetoothUtils.getBtDrawableWithDescription(mContext, mCachedDevice).first; in getIcon() 75 return MediaDeviceUtils.getId(mCachedDevice); in getId() 82 return mCachedDevice; in getCachedDevice() 101 return mCachedDevice != null in isFastPairDevice() 108 return mCachedDevice.getBondState() == BluetoothDevice.BOND_BONDED in isConnected() [all …]
|
/aosp12/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/ |
H A D | BluetoothDevicePreference.java | 48 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 56 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 78 return mCachedDevice; in getCachedDevice() 92 mCachedDevice.registerCallback(mDeviceCallback); in onAttached() 99 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached() 103 setTitle(mCachedDevice.getName()); in refreshUi() 107 if (mCachedDevice.isConnected()) { in refreshUi() 122 setEnabled(!mCachedDevice.isBusy()); in refreshUi() 137 return mCachedDevice.equals(((BluetoothDevicePreference) o).mCachedDevice); in equals() 142 return mCachedDevice.hashCode(); in hashCode() [all …]
|
H A D | BluetoothDeviceProfilePreference.java | 34 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceProfilePreference 41 mCachedDevice = cachedDevice; in BluetoothDeviceProfilePreference() 57 return mCachedDevice; in getCachedDevice() 63 mCachedDevice.registerCallback(mDeviceCallback); in onAttached() 70 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached() 74 setEnabled(!mCachedDevice.isBusy()); in refreshUi() 77 mProfile.getConnectionStatus(mCachedDevice.getDevice()) == STATE_CONNECTED); in refreshUi() 79 setChecked(mProfile.isEnabled(mCachedDevice.getDevice())); in refreshUi()
|
H A D | BluetoothDeviceDetailsFragment.java | 39 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragment 69 mCachedDevice = manager.getCachedDeviceManager().findDevice(remoteDevice); in onAttach() 70 if (mCachedDevice == null) { in onAttach() 76 R.string.pk_bluetooth_device_name).setCachedDevice(mCachedDevice); in onAttach() 78 R.string.pk_bluetooth_device_action_buttons).setCachedDevice(mCachedDevice); in onAttach() 80 R.string.pk_bluetooth_device_profiles).setCachedDevice(mCachedDevice); in onAttach() 82 R.string.pk_bluetooth_device_address).setCachedDevice(mCachedDevice); in onAttach()
|
H A 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()
|
H A 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()
|
/aosp12/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/ |
H A 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() 151 when(mCachedDevice.isBusy()).thenReturn(false); in onDeviceAttributesChanged_refreshesUi() 155 verify(mCachedDevice).registerCallback(callbackCaptor.capture()); in onDeviceAttributesChanged_refreshesUi() 161 when(mCachedDevice.isBusy()).thenReturn(true); in onDeviceAttributesChanged_refreshesUi() 174 verify(mCachedDevice).registerCallback(callbackCaptor.capture()); in onDetached_unregistersDeviceCallback() [all …]
|
H A 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() 145 when(mCachedDevice.getProfiles()).thenReturn(Collections.singletonList(profile)); in refreshUi_profiles_showsPreference() 154 when(mCachedDevice.getProfiles()).thenReturn(Collections.emptyList()); in refreshUi_noProfiles_hidesPreference() 165 when(mCachedDevice.getProfiles()).thenReturn(Collections.singletonList(profile)); in profileChecked_setsProfilePreferred() [all …]
|
H A D | RemoteRenameDialogFragmentTest.java | 60 private CachedBluetoothDevice mCachedDevice; field in RemoteRenameDialogFragmentTest 79 when(mCachedDeviceManager.findDevice(device)).thenReturn(mCachedDevice); in setUp() 80 when(mCachedDevice.getAddress()).thenReturn(address); in setUp() 82 mFragment = RemoteRenameDialogFragment.newInstance(mCachedDevice); in setUp() 94 when(mCachedDevice.getName()).thenReturn(NAME); in getDeviceName_returnsCachedDeviceName() 102 when(mCachedDevice.getName()).thenReturn(NAME); in setDeviceName_updatesCachedDeviceName() 109 verify(mCachedDevice).setName(NAME_UPDATED); in setDeviceName_updatesCachedDeviceName()
|
H A D | BluetoothScanningDevicesGroupPreferenceControllerTest.java | 70 private CachedBluetoothDevice mCachedDevice; field in BluetoothScanningDevicesGroupPreferenceControllerTest 95 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_NONE); in setUp() 96 when(mCachedDevice.getDevice()).thenReturn(mDevice); in setUp() 98 Collections.singletonList(mCachedDevice)); in setUp() 146 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in onScanningStateChanged_scanningDisabled_receiveStopped_doesNothing() 161 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in onDeviceBondStateChanged_refreshesUi() 163 mController.onDeviceBondStateChanged(mCachedDevice, BluetoothDevice.BOND_BONDING); in onDeviceBondStateChanged_refreshesUi() 223 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_stopsScanning() 233 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_disablesGroup() 243 when(mCachedDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); in refreshUi_deviceBonding_setsScanModeConnectable()
|
/aosp12/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
H A D | BluetoothDetailsButtonsControllerTest.java | 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() 134 when(mCachedDevice.isConnected()).thenReturn(true); in becomeConnected() 140 verify(mCachedDevice).disconnect(); in becomeConnected() 162 when(mCachedDevice.isBusy()).thenReturn(true); in startsOutBusy() 170 when(mCachedDevice.isBusy()).thenReturn(false); in startsOutBusy() [all …]
|
H A 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()
|
H A 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()
|
H A 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()
|