diff options
author | Michael Chan <mchan@android.com> | 2009-09-30 17:59:40 -0700 |
---|---|---|
committer | Michael Chan <mchan@android.com> | 2009-09-30 18:14:08 -0700 |
commit | 081f58abb7ceb702fdb0b65ff0e0ff70dd265a30 (patch) | |
tree | befde0862f6dccc19c1f7cb3028c7fd26a25cbfd | |
parent | 88f2acb066f2b66a01807ad4f3d26ef575a1bf37 (diff) | |
download | frameworks_base-081f58abb7ceb702fdb0b65ff0e0ff70dd265a30.zip frameworks_base-081f58abb7ceb702fdb0b65ff0e0ff70dd265a30.tar.gz frameworks_base-081f58abb7ceb702fdb0b65ff0e0ff70dd265a30.tar.bz2 |
b/2148252 Fix emulator
Change-Id: Ic2a16d4fac2a2a12a209c83ad2049829255cb31f
-rw-r--r-- | core/java/android/bluetooth/BluetoothA2dp.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java index 7c4c9c1..e8a69d8 100644 --- a/core/java/android/bluetooth/BluetoothA2dp.java +++ b/core/java/android/bluetooth/BluetoothA2dp.java @@ -93,10 +93,15 @@ public final class BluetoothA2dp { mContext = c; IBinder b = ServiceManager.getService(BluetoothA2dpService.BLUETOOTH_A2DP_SERVICE); - if (b == null) { - throw new RuntimeException("Bluetooth A2DP service not available!"); + if (b != null) { + mService = IBluetoothA2dp.Stub.asInterface(b); + } else { + Log.w(TAG, "Bluetooth A2DP service not available!"); + + // Instead of throwing an exception which prevents people from going + // into Wireless settings in the emulator. Let it crash later when it is actually used. + mService = null; } - mService = IBluetoothA2dp.Stub.asInterface(b); } /** Initiate a connection to an A2DP sink. |