am 30717b68: Merge "AudioService: undock audio glitch - DO NOT MERGE" into jb-mr1.1-dev

* commit '30717b6881bba8460b041cf39848748c7657cff4':
  AudioService: undock audio glitch - DO NOT MERGE
This commit is contained in:
Eric Laurent
2012-11-08 13:00:44 -08:00
committed by Android Git Automerger

View File

@@ -436,6 +436,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
private boolean mDockAudioMediaEnabled = true;
private int mDockState = Intent.EXTRA_DOCK_STATE_UNDOCKED;
///////////////////////////////////////////////////////////////////////////
// Construction
///////////////////////////////////////////////////////////////////////////
@@ -3758,13 +3760,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
config = AudioSystem.FORCE_BT_CAR_DOCK;
break;
case Intent.EXTRA_DOCK_STATE_LE_DESK:
synchronized (mSettingsLock) {
if (mDockAudioMediaEnabled) {
config = AudioSystem.FORCE_ANALOG_DOCK;
} else {
config = AudioSystem.FORCE_NONE;
}
}
config = AudioSystem.FORCE_ANALOG_DOCK;
break;
case Intent.EXTRA_DOCK_STATE_HE_DESK:
config = AudioSystem.FORCE_DIGITAL_DOCK;
@@ -3773,8 +3769,14 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
default:
config = AudioSystem.FORCE_NONE;
}
AudioSystem.setForceUse(AudioSystem.FOR_DOCK, config);
// Low end docks have a menu to enable or disable audio
// (see mDockAudioMediaEnabled)
if (!((dockState == Intent.EXTRA_DOCK_STATE_LE_DESK) ||
((dockState == Intent.EXTRA_DOCK_STATE_UNDOCKED) &&
(mDockState == Intent.EXTRA_DOCK_STATE_LE_DESK)))) {
AudioSystem.setForceUse(AudioSystem.FOR_DOCK, config);
}
mDockState = dockState;
} else if (action.equals(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED)) {
state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE,
BluetoothProfile.STATE_DISCONNECTED);