diff options
author | Jake Hamby <jhamby@google.com> | 2011-01-11 13:27:50 -0800 |
---|---|---|
committer | Jake Hamby <jhamby@google.com> | 2011-01-11 13:27:50 -0800 |
commit | c6e1b293a7cca6804a0a3ea4923beea16bd6dc0e (patch) | |
tree | d6975887ca3eb6b2d632eff4315fb9a865e72246 /src | |
parent | 844f323ee5fc7200b201eb23d3a37e9aa9a10cec (diff) | |
download | packages_apps_settings-c6e1b293a7cca6804a0a3ea4923beea16bd6dc0e.zip packages_apps_settings-c6e1b293a7cca6804a0a3ea4923beea16bd6dc0e.tar.gz packages_apps_settings-c6e1b293a7cca6804a0a3ea4923beea16bd6dc0e.tar.bz2 |
Don't throw exception on unexpected BT device addition.
Fix for reported bug where settings app crashes while trying to share
a picture. Bug report showed IllegalStateException thrown with message
"Got onDeviceAdded, but cachedDevice already exists." Changed code to
print an error message to the log and ignore the unexpected event,
rather than throwing an uncaught exception that crashes the app.
Bug: 2192884
Change-Id: I016be6a1616b317b2289768d18ae9f069a49445e
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/bluetooth/BluetoothSettings.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index aa5decb..54f9fb1 100644 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -286,7 +286,8 @@ public class BluetoothSettings extends SettingsPreferenceFragment public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { if (mDevicePreferenceMap.get(cachedDevice) != null) { - throw new IllegalStateException("Got onDeviceAdded, but cachedDevice already exists"); + Log.e(TAG, "Got onDeviceAdded, but cachedDevice already exists"); + return; } if (mScreenType != SCREEN_TYPE_SETTINGS |