Merge "API Changes needed for Blueooth apex to build"

This commit is contained in:
Zach Johnson
2022-01-28 19:31:18 +00:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 5 deletions

View File

@@ -1255,7 +1255,7 @@ public class CompanionDeviceManagerService extends SystemService
}
@Override
public void onDeviceDisconnected(BluetoothDevice device, @DisconnectReason int reason) {
public void onDeviceDisconnected(BluetoothDevice device, int reason) {
Slog.d(LOG_TAG, device.getAddress() + " disconnected w/ reason: (" + reason + ") "
+ BluetoothAdapter.BluetoothConnectionCallback.disconnectReasonText(reason));
CompanionDeviceManagerService.this.onDeviceDisconnected(device.getAddress());

View File

@@ -91,7 +91,7 @@ class BluetoothCompanionDeviceConnectionListener
*/
@Override
public void onDeviceDisconnected(@NonNull BluetoothDevice device,
@DisconnectReason int reason) {
int reason) {
if (DEBUG) {
Log.i(TAG, "onDevice_Disconnected() " + btDeviceToString(device));
Log.d(TAG, " reason=" + disconnectReasonText(reason));

View File

@@ -486,9 +486,7 @@ public class BtHelper {
return;
}
final BluetoothDevice btDevice = deviceList.get(0);
final @BluetoothProfile.BtProfileState int state =
proxy.getConnectionState(btDevice);
if (state == BluetoothProfile.STATE_CONNECTED) {
if (proxy.getConnectionState(btDevice) == BluetoothProfile.STATE_CONNECTED) {
mDeviceBroker.queueOnBluetoothActiveDeviceChanged(
new AudioDeviceBroker.BtDeviceChangedData(btDevice, null,
new BtProfileConnectionInfo(profile), "mBluetoothProfileServiceListener"));