diff options
author | Android Code Review <code-review@android.com> | 2009-11-05 14:08:25 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2009-11-05 14:08:25 -0800 |
commit | 8d9ef036115981735b5d32181e7d8cbea174dc2a (patch) | |
tree | 549b6fb4a3c898a7a71fc939d731e1ad0e976128 /services | |
parent | b52990e79d564424233bff50e0867f29a1acb2d2 (diff) | |
parent | fb0bd47d3a61cf68b63940722542b8759be82df4 (diff) | |
download | frameworks_base-8d9ef036115981735b5d32181e7d8cbea174dc2a.zip frameworks_base-8d9ef036115981735b5d32181e7d8cbea174dc2a.tar.gz frameworks_base-8d9ef036115981735b5d32181e7d8cbea174dc2a.tar.bz2 |
Merge change I8f67f092
* changes:
Fix of compatibility with multifunction extUSB adapters. Tested with HTC YC A300.
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/HeadsetObserver.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/java/com/android/server/HeadsetObserver.java b/services/java/com/android/server/HeadsetObserver.java index 9b0a2d4..0742cae 100644 --- a/services/java/com/android/server/HeadsetObserver.java +++ b/services/java/com/android/server/HeadsetObserver.java @@ -97,7 +97,7 @@ class HeadsetObserver extends UEventObserver { private synchronized final void update(String newName, int newState) { if (newName != mHeadsetName || newState != mHeadsetState) { - boolean isUnplug = (newState == 0 && mHeadsetState == 1); + boolean isUnplug = (newState == 0 && mHeadsetState > 0); mHeadsetName = newName; mHeadsetState = newState; mAudioRouteNeedsUpdate = true; @@ -123,7 +123,7 @@ class HeadsetObserver extends UEventObserver { Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); - intent.putExtra("state", mHeadsetState); + intent.putExtra("state", isUnplug ? 0 : 1); intent.putExtra("name", mHeadsetName); // TODO: Should we require a permission? @@ -137,7 +137,7 @@ class HeadsetObserver extends UEventObserver { private synchronized final void updateAudioRoute() { if (mAudioRouteNeedsUpdate) { - mAudioManager.setWiredHeadsetOn(mHeadsetState == 1); + mAudioManager.setWiredHeadsetOn(mHeadsetState > 0); mAudioRouteNeedsUpdate = false; } } |