Home
last modified time | relevance | path

Searched refs:mCachedDevice (Results 1 – 25 of 42) sorted by relevance

12

/packages/apps/Settings/src/com/android/settings/bluetooth/
DBluetoothDevicePreference.java71 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 …]
DLeAudioBluetoothDetailsHeaderController.java93 private CachedBluetoothDevice mCachedDevice; field in LeAudioBluetoothDetailsHeaderController
107 if (mCachedDevice == null || mProfileManager == null) { in getAvailabilityStatus()
110 boolean hasLeAudio = mCachedDevice.getConnectableProfiles() in getAvailabilityStatus()
114 return !Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) && hasLeAudio in getAvailabilityStatus()
131 mCachedDevice.registerCallback(this); in onStart()
140 mCachedDevice.unregisterCallback(this); in onStop()
150 mCachedDevice = cachedBluetoothDevice; in init()
156 if (mLayoutPreference == null || mCachedDevice == null) { in refresh()
162 BluetoothUtils.getBtRainbowDrawableWithDescription(mContext, mCachedDevice); in refresh()
169 title.setText(mCachedDevice.getName()); in refresh()
[all …]
DBluetoothDeviceDetailsFragment.java84 CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragment
120 mCachedDevice = getCachedDevice(mDeviceAddress); in onAttach()
122 if (mCachedDevice == null) { in onAttach()
128 use(AdvancedBluetoothDetailsHeaderController.class).init(mCachedDevice); in onAttach()
129 use(LeAudioBluetoothDetailsHeaderController.class).init(mCachedDevice, mManager); in onAttach()
137 ? featureProvider.getBluetoothDeviceSettingsUri(mCachedDevice.getDevice()) in onAttach()
147 String uri = featureProvider.getBluetoothDeviceControlUri(mCachedDevice.getDevice()); in updateExtraControlUri()
198 if (mCachedDevice.getBondState() == BOND_NONE) { in finishFragmentIfNecessary()
230 RemoteDeviceNameDialogFragment.newInstance(mCachedDevice).show( in onOptionsItemSelected()
241 if (mCachedDevice != null) { in createPreferenceControllers()
[all …]
DAdvancedBluetoothDetailsHeaderController.java94 private CachedBluetoothDevice mCachedDevice; field in AdvancedBluetoothDetailsHeaderController
126 if (mCachedDevice == null) { in getAvailabilityStatus()
129 return Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) in getAvailabilityStatus()
146 mCachedDevice.registerCallback(this); in onStart()
147 mBluetoothAdapter.addOnMetadataChangedListener(mCachedDevice.getDevice(), in onStart()
158 mCachedDevice.unregisterCallback(this); in onStop()
159 mBluetoothAdapter.removeOnMetadataChangedListener(mCachedDevice.getDevice(), in onStop()
176 mCachedDevice = cachedBluetoothDevice; in init()
181 if (mLayoutPreference != null && mCachedDevice != null) { in refresh()
183 title.setText(mCachedDevice.getName()); in refresh()
[all …]
DBluetoothDetailsProfilesController.java71 private CachedBluetoothDevice mCachedDevice; field in BluetoothDetailsProfilesController
85 mCachedDevice = device; in BluetoothDetailsProfilesController()
113 pref.setTitle(profile.getNameResource(mCachedDevice.getDevice())); in createProfilePreference()
126 BluetoothDevice device = mCachedDevice.getDevice(); in refreshProfilePreference()
161 profilePref.setEnabled(!mCachedDevice.isBusy()); in refreshProfilePreference()
186 highQualityPref.setEnabled(!mCachedDevice.isBusy() && !isLeAudioEnabled); in refreshProfilePreference()
222 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in enableProfile()
249 final BluetoothDevice bluetoothDevice = mCachedDevice.getDevice(); in disableProfile()
311 final BluetoothDevice device = mCachedDevice.getDevice(); in getProfiles()
330 if (mCachedDevice == null) { in getAllOfCachedBluetoothDevices()
[all …]
DBluetoothFindBroadcastsFragment.java75 CachedBluetoothDevice mCachedDevice; field in BluetoothFindBroadcastsFragment
182 mCachedDevice = getCachedDevice(mDeviceAddress); in onAttach()
187 if (mCachedDevice == null || mLeBroadcastAssistant == null) { in onAttach()
233 if (mCachedDevice.getBondState() == BOND_NONE) { in finishFragmentIfNecessary()
260 if (mLeBroadcastAssistant == null || mCachedDevice == null) { in leaveBroadcastSession()
264 mLeBroadcastAssistant.removeSource(mCachedDevice.getDevice(), getSourceId()); in leaveBroadcastSession()
281 if (mCachedDevice != null) { in createPreferenceControllers()
284 context, this, mCachedDevice, lifecycle, mManager); in createPreferenceControllers()
373 if (mLeBroadcastAssistant == null || mCachedDevice == null) { in addSource()
387 mLeBroadcastAssistant.addSource(mCachedDevice.getDevice(), in addSource()
[all …]
DBluetoothDetailsMacAddressController.java49 R.string.bluetooth_device_mac_address, mCachedDevice.getIdentityAddress())); in init()
54 if (mCachedDevice.getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) { in refresh()
57 mCachedDevice.getIdentityAddress())); in refresh()
58 for (CachedBluetoothDevice member: mCachedDevice.getMemberDevice()) { in refresh()
64 R.string.bluetooth_device_mac_address, mCachedDevice.getIdentityAddress())); in refresh()
DBluetoothFindBroadcastsHeaderController.java74 if (mLayoutPreference == null || mCachedDevice == null) { in refresh()
79 mTitle.setText(mCachedDevice.getName()); in refresh()
108 if (mBluetoothFindBroadcastsFragment != null && mCachedDevice != null) { in updateHeaderLayout()
112 && broadcastAssistant.getConnectionStatus(mCachedDevice.getDevice()) in updateHeaderLayout()
139 mCachedDevice.getDevice()); in launchQrCodeScanner()
145 if (mCachedDevice != null) { in onDeviceAttributesChanged()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/
DBluetoothDevicePreferenceTest.java65 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceTest
70 mPreference = new BluetoothDevicePreference(mContext, mCachedDevice); in setUp()
87 verify(mCachedDevice).registerCallback(any(CachedBluetoothDevice.Callback.class)); in onAttached_registersDeviceCallback()
93 when(mCachedDevice.getName()).thenReturn(name); in onAttached_setsDeviceNameAsTitle()
103 when(mCachedDevice.isConnected()).thenReturn(false); in onAttached_notConnected_setsCarConnectionSummaryAsSummary()
104 when(mCachedDevice.getCarConnectionSummary(anyBoolean(), anyBoolean())).thenReturn(summary); in onAttached_notConnected_setsCarConnectionSummaryAsSummary()
113 when(mCachedDevice.isConnected()).thenReturn(true); in onAttached_connected_setsCarConnectionSummaryAsSummary()
115 when(mCachedDevice.getCarConnectionSummary(anyBoolean(), anyBoolean())).thenReturn(summary); in onAttached_connected_setsCarConnectionSummaryAsSummary()
124 when(mCachedDevice.getBtClass()).thenReturn( in onAttached_setsIcon()
134 when(mCachedDevice.isBusy()).thenReturn(false); in onAttached_deviceNotBusy_setsEnabled()
[all …]
DBluetoothDeviceActionButtonsPreferenceControllerTest.java62 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 …]
DBluetoothDeviceNamePreferenceControllerTest.java74 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceNamePreferenceControllerTest
94 mPreferenceController.setCachedDevice(mCachedDevice); in setUp()
102 when(mCachedDevice.getName()).thenReturn(name); in refreshUi_setsDeviceNameAsTitle()
112 when(mCachedDevice.isConnected()).thenReturn(true); in refreshUi_connected_setsCarConnectionSummaryAsSummary()
113 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in refreshUi_connected_setsCarConnectionSummaryAsSummary()
123 when(mCachedDevice.isConnected()).thenReturn(false); in refreshUi_notConnectedsetsCarConnectionSummaryAsSummary()
124 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in refreshUi_notConnectedsetsCarConnectionSummaryAsSummary()
133 when(mCachedDevice.getBtClass()).thenReturn( in refreshUi_setsIcon()
144 when(mCachedDevice.isConnected()).thenReturn(true); in refreshUi_hearingAidDevice_setsBatteryStatusesAsSummary()
145 when(mCachedDevice.getCarConnectionSummary()).thenReturn(summary); in refreshUi_hearingAidDevice_setsBatteryStatusesAsSummary()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/
DBluetoothDetailsPairOtherControllerTest.java53 mController = new BluetoothDetailsPairOtherController(mContext, mFragment, mCachedDevice, in setUp()
65 when(mCachedDevice.getDeviceSide()).thenReturn(HearingAidProfile.DeviceSide.SIDE_LEFT); in init_leftSideDevice_expectedTitle()
75 when(mCachedDevice.getDeviceSide()).thenReturn(HearingAidProfile.DeviceSide.SIDE_RIGHT); in init_rightSideDevice_expectedTitle()
85 when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(false); in init_isNotConnectedHearingAidDevice_notVisiblePreference()
95 when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(false); in isAvailable_isNotConnectedHearingAidDevice_notAvailable()
102 when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true); in isAvailable_notConnectedHearingAidDevice_notAvailable()
103 when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_MONAURAL); in isAvailable_notConnectedHearingAidDevice_notAvailable()
110 when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true); in isAvailable_subDeviceIsConnectedHearingAidDevice_notAvailable()
111 when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_BINAURAL); in isAvailable_subDeviceIsConnectedHearingAidDevice_notAvailable()
113 when(mCachedDevice.getSubDevice()).thenReturn(mSubCachedDevice); in isAvailable_subDeviceIsConnectedHearingAidDevice_notAvailable()
[all …]
DBluetoothDetailsButtonsControllerTest.java62 new BluetoothDetailsButtonsController(mContext, mFragment, mCachedDevice, in setUp()
80 when(mCachedDevice.isBusy()).thenReturn(false); in setUp()
96 verify(mCachedDevice).disconnect(); in clickOnDisconnect()
101 when(mCachedDevice.isConnected()).thenReturn(false); in clickOnConnect()
107 verify(mCachedDevice).connect(); in clickOnConnect()
117 when(mCachedDevice.isConnected()).thenReturn(false); in becomeDisconnected()
123 verify(mCachedDevice).connect(); in becomeDisconnected()
129 when(mCachedDevice.isConnected()).thenReturn(false); in becomeConnected()
136 when(mCachedDevice.isConnected()).thenReturn(true); in becomeConnected()
142 verify(mCachedDevice).disconnect(); in becomeConnected()
[all …]
DForgetDeviceDialogFragmentTest.java59 private CachedBluetoothDevice mCachedDevice; field in ForgetDeviceDialogFragmentTest
75 when(mCachedDevice.getAddress()).thenReturn(deviceAddress); in setUp()
76 when(mCachedDevice.getIdentityAddress()).thenReturn(deviceAddress); in setUp()
77 when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice); in setUp()
78 when(mCachedDevice.getName()).thenReturn(DEVICE_NAME); in setUp()
80 doReturn(mCachedDevice).when(mFragment).getDevice(any()); in setUp()
89 verify(mCachedDevice, never()).unpair(); in cancelDialog()
98 verify(mCachedDevice).unpair(); in confirmDialog()
DRemoteDeviceNameDialogFragmentTest.java54 private CachedBluetoothDevice mCachedDevice; field in RemoteDeviceNameDialogFragmentTest
64 when(mCachedDevice.getAddress()).thenReturn(deviceAddress); in setUp()
65 when(mCachedDevice.getIdentityAddress()).thenReturn(deviceAddress); in setUp()
66 mFragment = spy(RemoteDeviceNameDialogFragment.newInstance(mCachedDevice)); in setUp()
67 doReturn(mCachedDevice).when(mFragment).getDevice(any()); in setUp()
77 when(mCachedDevice.getName()).thenReturn(deviceName); in startDialog()
117 verify(mCachedDevice).setName(deviceNameModified); in deviceNameEditSucceeds()
132 verify(mCachedDevice, never()).setName(anyString()); in deviceNameEditThenCancelDoesntRename()
DBluetoothDetailsControllerTestBase.java59 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()
158 when(mCachedDevice.getIdentityAddress()).thenReturn(config.getAddress()); in setupDevice()
DAdvancedBluetoothDetailsHeaderControllerTest.java82 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()
102 when(mCachedDevice.getIdentityAddress()).thenReturn(MAC_ADDRESS); in setUp()
125 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedWatch_behaveAsExpected()
150 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedWatch_unknownBatteryLevel_shouldNotShowBatteryLevel()
181 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connectedUntetheredHeadset_behaveAsExpected()
205 when(mCachedDevice.isConnected()).thenReturn(true); in refresh_connected_updateCorrectInfo()
[all …]
DBluetoothDeviceDetailsFragmentTest.java69 private CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceDetailsFragmentTest
83 doReturn(mCachedDevice).when(mFragment).getCachedDevice(any()); in setUp()
91 when(mCachedDevice.getAddress()).thenReturn(TEST_ADDRESS); in setUp()
92 when(mCachedDevice.getIdentityAddress()).thenReturn(TEST_ADDRESS); in setUp()
106 assertThat(mFragment.mCachedDevice).isEqualTo(mCachedDevice); in verifyOnAttachResult()
135 when(mCachedDevice.getBondState()).thenReturn(BOND_NONE); in finishFragmentIfNecessary_deviceIsBondNone_finishFragment()
/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/
DBluetoothDevicePreference.java46 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreference
60 mCachedDevice = cachedDevice; in BluetoothDevicePreference()
83 return mCachedDevice; in getCachedDevice()
97 mCachedDevice.registerCallback(mDeviceCallback); in onAttached()
104 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached()
108 setTitle(mCachedDevice.getName()); in refreshUi()
109 setSummary(mCachedDevice.getCarConnectionSummary(/* shortSummary= */ true, in refreshUi()
113 .getBtClassDrawableWithDescription(getContext(), mCachedDevice); in refreshUi()
119 setEnabled(!mCachedDevice.isBusy()); in refreshUi()
120 setVisible(mShowDevicesWithoutNames || mCachedDevice.hasHumanReadableName()); in refreshUi()
[all …]
DBluetoothDeviceProfilePreference.java36 private final CachedBluetoothDevice mCachedDevice; field in BluetoothDeviceProfilePreference
43 mCachedDevice = cachedDevice; in BluetoothDeviceProfilePreference()
59 return mCachedDevice; in getCachedDevice()
65 mCachedDevice.registerCallback(mDeviceCallback); in onAttached()
72 mCachedDevice.unregisterCallback(mDeviceCallback); in onDetached()
77 setEnabled(!mCachedDevice.isBusy()); in refreshUi()
80 mProfile.getConnectionStatus(mCachedDevice.getDevice()) == STATE_CONNECTED); in refreshUi()
82 setChecked(mProfile.isEnabled(mCachedDevice.getDevice())); in refreshUi()
DBluetoothDeviceDetailsFragment.java39 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()
DRemoteRenameDialogFragment.java38 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()
DBluetoothDevicePreferenceController.java45 private CachedBluetoothDevice mCachedDevice; field in BluetoothDevicePreferenceController
66 mCachedDevice = device; in setCachedDevice()
73 return mCachedDevice; in getCachedDevice()
79 if (mCachedDevice == null) { in checkInitialized()
97 mCachedDevice.registerCallback(mDeviceCallback); in onStartInternal()
103 mCachedDevice.unregisterCallback(mDeviceCallback); in onStopInternal()
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/
DBluetoothDeviceProfilePreferenceTest.java53 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 …]
DRemoteRenameDialogFragmentTest.java60 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()

12