Merge "Set each function as default in BluetoothCallback"
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
index eba6f94..a91c45d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
@@ -33,7 +33,7 @@
* {@link android.bluetooth.BluetoothAdapter#STATE_ON},
* {@link android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}.
*/
- void onBluetoothStateChanged(int bluetoothState);
+ default void onBluetoothStateChanged(int bluetoothState) {}
/**
* It will be called when the local Bluetooth adapter has started
@@ -43,7 +43,7 @@
*
* @param started indicate the current process is started or finished.
*/
- void onScanningStateChanged(boolean started);
+ default void onScanningStateChanged(boolean started) {}
/**
* It will be called in following situations:
@@ -54,7 +54,7 @@
*
* @param cachedDevice the Bluetooth device.
*/
- void onDeviceAdded(CachedBluetoothDevice cachedDevice);
+ default void onDeviceAdded(CachedBluetoothDevice cachedDevice) {}
/**
* It will be called when a remote device that was
@@ -63,7 +63,7 @@
*
* @param cachedDevice the Bluetooth device.
*/
- void onDeviceDeleted(CachedBluetoothDevice cachedDevice);
+ default void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {}
/**
* It will be called when bond state of a remote device is changed.
@@ -75,7 +75,7 @@
* {@link android.bluetooth.BluetoothDevice#BOND_BONDING},
* {@link android.bluetooth.BluetoothDevice#BOND_BONDED}.
*/
- void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState);
+ default void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) {}
/**
* It will be called in following situations:
@@ -91,7 +91,7 @@
* {@link android.bluetooth.BluetoothAdapter#STATE_CONNECTED},
* {@link android.bluetooth.BluetoothAdapter#STATE_DISCONNECTING}.
*/
- void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state);
+ default void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {}
/**
* It will be called when device been set as active for {@code bluetoothProfile}
@@ -103,7 +103,7 @@
* @param activeDevice the active Bluetooth device.
* @param bluetoothProfile the profile of active Bluetooth device.
*/
- void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile);
+ default void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {}
/**
* It will be called in following situations:
@@ -113,7 +113,7 @@
* {@link android.bluetooth.BluetoothHeadset#ACTION_AUDIO_STATE_CHANGED}
* {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
*/
- void onAudioModeChanged();
+ default void onAudioModeChanged() {}
/**
* It will be called when one of the bluetooth device profile connection state is changed.
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java
index d295bd6..a42191c 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java
@@ -598,21 +598,6 @@
mHandler.obtainMessage(MSG_ON_DEVICE_BOND_STATE_CHANGED,
bondState, 0, cachedDevice).sendToTarget();
}
-
- @Override
- public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { }
- @Override
- public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { }
- @Override
- public void onScanningStateChanged(boolean started) { }
- @Override
- public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { }
- @Override
- public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice,
- int bluetoothProfile) { }
-
- @Override
- public void onAudioModeChanged() { }
}
private final class BluetoothErrorListener implements BluetoothUtils.ErrorListener {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 8df51db..1085b06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -239,11 +239,6 @@
}
@Override
- public void onScanningStateChanged(boolean started) {
- // Don't care.
- }
-
- @Override
public void onDeviceAdded(CachedBluetoothDevice cachedDevice) {
cachedDevice.registerCallback(this);
updateConnected();
@@ -277,12 +272,6 @@
mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED);
}
- @Override
- public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {}
-
- @Override
- public void onAudioModeChanged() {}
-
private ActuallyCachedState getCachedState(CachedBluetoothDevice device) {
ActuallyCachedState state = mCachedState.get(device);
if (state == null) {