/packages/apps/Settings/src/com/android/settings/bluetooth/ |
D | BluetoothDevicePreference.java | 71 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 108 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 110 mCachedDevice.registerCallback(mCallback); in BluetoothDevicePreference() 123 return mCachedDevice == null in shouldHideSecondTarget() 124 || mCachedDevice.getBondState() != BluetoothDevice.BOND_BONDED in shouldHideSecondTarget() 135 return mCachedDevice; in getCachedDevice() 142 mCachedDevice.unregisterCallback(mCallback); in onPrepareForRemoval() 155 mCachedDevice.registerCallback(mCallback); in onAttached() 165 mCachedDevice.unregisterCallback(mCallback); in onDetached() 171 return mCachedDevice; in getBluetoothDevice() [all …]
|
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() 186 controllers.add(new BluetoothDetailsButtonsController(context, this, mCachedDevice, in createPreferenceControllers() [all …]
|
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() 198 List<LocalBluetoothProfile> result = mCachedDevice.getConnectableProfiles(); in getProfiles() 199 final BluetoothDevice device = mCachedDevice.getDevice(); in getProfiles() [all …]
|
D | AdvancedBluetoothDetailsHeaderController.java | 94 private CachedBluetoothDevice mCachedDevice; field in AdvancedBluetoothDetailsHeaderController 120 if (mCachedDevice == null) { in getAvailabilityStatus() 123 return Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) in getAvailabilityStatus() 140 mCachedDevice.registerCallback(this); in onStart() 141 mBluetoothAdapter.addOnMetadataChangedListener(mCachedDevice.getDevice(), in onStart() 152 mCachedDevice.unregisterCallback(this); in onStop() 153 mBluetoothAdapter.removeOnMetadataChangedListener(mCachedDevice.getDevice(), in onStop() 170 mCachedDevice = cachedBluetoothDevice; in init() 175 if (mLayoutPreference != null && mCachedDevice != null) { in refresh() 177 title.setText(mCachedDevice.getName()); 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 | 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()
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/ |
D | BluetoothDevicePreferenceTest.java | 54 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceTest 59 mPreference = new BluetoothDevicePreference(mContext, mCachedDevice); in setUp() 76 verify(mCachedDevice).registerCallback(any(CachedBluetoothDevice.Callback.class)); in onAttached_registersDeviceCallback() 82 when(mCachedDevice.getName()).thenReturn(name); in onAttached_setsDeviceNameAsTitle() 92 when(mCachedDevice.isConnected()).thenReturn(false); in onAttached_notConnected_setsCarConnectionSummaryAsSummary() 93 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in onAttached_notConnected_setsCarConnectionSummaryAsSummary() 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() [all …]
|
D | BluetoothDeviceActionButtonsPreferenceControllerTest.java | 62 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceActionButtonsPreferenceControllerTest 77 when(mCachedDevice.getAddress()).thenReturn(address); in setUp() 82 mPreferenceController.setCachedDevice(mCachedDevice); in setUp() 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() 136 when(mCachedDevice.isConnected()).thenReturn(false); in deviceNotConnected_connectionButtonShowsConnect() [all …]
|
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()
|
/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/ |
D | BluetoothDevicePreference.java | 49 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference 57 mCachedDevice = cachedDevice; in BluetoothDevicePreference() 79 return mCachedDevice; in getCachedDevice() 93 mCachedDevice.registerCallback(mDeviceCallback); in onAttached() 100 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached() 104 setTitle(mCachedDevice.getName()); in refreshUi() 108 if (mCachedDevice.isConnected()) { in refreshUi() 113 setSummary(mCachedDevice.getCarConnectionSummary()); in refreshUi() 117 .getBtClassDrawableWithDescription(getContext(), mCachedDevice); in refreshUi() 123 setEnabled(!mCachedDevice.isBusy()); in refreshUi() [all …]
|
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()
|
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()
|
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/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/ |
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 | 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()
|
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()
|
/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 | 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 | 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 | AdvancedBluetoothDetailsHeaderControllerTest.java | 82 private CachedBluetoothDevice mCachedDevice; field in AdvancedBluetoothDetailsHeaderControllerTest 94 when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp() 95 mController.init(mCachedDevice); in setUp() 100 when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp() 101 when(mCachedDevice.getAddress()).thenReturn(MAC_ADDRESS); in setUp() 124 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedWatch_behaveAsExpected() 149 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedWatch_unknownBatteryLevel_shouldNotShowBatteryLevel() 180 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedUntetheredHeadset_behaveAsExpected() 204 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connected_updateCorrectInfo() 214 when(mCachedDevice.isConnected()).thenReturn(false); in refresh_disconnected_updateCorrectInfo() [all …]
|
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()
|
D | BluetoothDeviceDetailsFragmentTest.java | 69 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragmentTest 83 doReturn(mCachedDevice).when(mFragment).getCachedDevice(any()); in setUp() 91 when(mCachedDevice.getAddress()).thenReturn(TEST_ADDRESS); in setUp() 105 assertThat(mFragment.mCachedDevice).isEqualTo(mCachedDevice); in verifyOnAttachResult() 134 when(mCachedDevice.getBondState()).thenReturn(BOND_NONE); in finishFragmentIfNecessary_deviceIsBondNone_finishFragment()
|