diff options
author | Michael Chan <> | 2009-03-27 11:53:26 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 11:53:26 -0700 |
commit | a322045d92786dd3d96963a198522f7994a548a9 (patch) | |
tree | 8099f8d415c811a7fd944de8ffee27df8ba25a07 /src/com/android/settings/bluetooth | |
parent | 60af953bda9a2f92ccee0b9ae35fef136a720b78 (diff) | |
download | packages_apps_settings-a322045d92786dd3d96963a198522f7994a548a9.zip packages_apps_settings-a322045d92786dd3d96963a198522f7994a548a9.tar.gz packages_apps_settings-a322045d92786dd3d96963a198522f7994a548a9.tar.bz2 |
AI 143116: Added separate error messages for Bluetooth bonding rejections
and bonding failures due to down devices
BUG=1308546
Automated import of CL 143116
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r-- | src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java index 9527980..9e46b4d 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java @@ -181,10 +181,22 @@ public class LocalBluetoothDeviceManager { * BluetoothDevice.UNBOND_REASON_* */ public synchronized void onBondingError(String address, int reason) { - mLocalManager.showError(address, R.string.bluetooth_error_title, - (reason == BluetoothDevice.UNBOND_REASON_AUTH_FAILED) ? - R.string.bluetooth_pairing_pin_error_message : - R.string.bluetooth_pairing_error_message); + int errorMsg; + + switch(reason) { + case BluetoothDevice.UNBOND_REASON_AUTH_FAILED: + errorMsg = R.string.bluetooth_pairing_pin_error_message; + break; + case BluetoothDevice.UNBOND_REASON_AUTH_REJECTED: + errorMsg = R.string.bluetooth_pairing_rejected_error_message; + break; + case BluetoothDevice.UNBOND_REASON_REMOTE_DEVICE_DOWN: + errorMsg = R.string.bluetooth_pairing_device_down_error_message; + break; + default: + errorMsg = R.string.bluetooth_pairing_error_message; + } + mLocalManager.showError(address, R.string.bluetooth_error_title, errorMsg); } public synchronized void onProfileStateChanged(String address, boolean transientState) { |