diff options
author | Eric Laurent <elaurent@google.com> | 2010-07-01 11:59:10 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-07-01 11:59:10 -0700 |
commit | e822c99511128db118d4192733e9cc0415fa155d (patch) | |
tree | b63c7975bdeff808309f77e53d38836f8dd7c907 /media/java | |
parent | 2d3dcac183da7601664a8f7245b1348de9658b00 (diff) | |
parent | eba857d126e2b76a368f41d3169a56fe28029674 (diff) | |
download | frameworks_base-e822c99511128db118d4192733e9cc0415fa155d.zip frameworks_base-e822c99511128db118d4192733e9cc0415fa155d.tar.gz frameworks_base-e822c99511128db118d4192733e9cc0415fa155d.tar.bz2 |
am eba857d1: am a0c2b539: Merge "Fix issue 2811538: System server crash when disconnecting BT headset after using SCO off call." into gingerbread
Merge commit 'eba857d126e2b76a368f41d3169a56fe28029674'
* commit 'eba857d126e2b76a368f41d3169a56fe28029674':
Fix issue 2811538: System server crash when disconnecting BT headset after using SCO off call.
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 50f0674..9212708 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -16,6 +16,7 @@ package android.media; +import java.util.NoSuchElementException; import android.app.ActivityManagerNative; import android.content.BroadcastReceiver; import android.content.ComponentName; @@ -1016,7 +1017,11 @@ public class AudioService extends IAudioService.Stub { } else { mStartcount--; if (mStartcount == 0) { - mCb.unlinkToDeath(this, 0); + try { + mCb.unlinkToDeath(this, 0); + } catch (NoSuchElementException e) { + Log.w(TAG, "decCount() going to 0 but not registered to binder"); + } } requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED); } @@ -1025,8 +1030,14 @@ public class AudioService extends IAudioService.Stub { public void clearCount(boolean stopSco) { synchronized(mScoClients) { + if (mStartcount != 0) { + try { + mCb.unlinkToDeath(this, 0); + } catch (NoSuchElementException e) { + Log.w(TAG, "clearCount() mStartcount: "+mStartcount+" != 0 but not registered to binder"); + } + } mStartcount = 0; - mCb.unlinkToDeath(this, 0); if (stopSco) { requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED); } |