diff options
author | Brian Beloshapka <bbelos@hotmail.com> | 2013-05-02 12:35:25 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-05-08 04:20:48 -0700 |
commit | 4ee668340cbdac6ccced68d10910f6120809cf1d (patch) | |
tree | eaf5ef66565b3650e5fa4c164eccdb0a73eef4c1 /media | |
parent | 4384dfcc51edbe1c70f184e786c1ab26c636674c (diff) | |
download | frameworks_base-4ee668340cbdac6ccced68d10910f6120809cf1d.zip frameworks_base-4ee668340cbdac6ccced68d10910f6120809cf1d.tar.gz frameworks_base-4ee668340cbdac6ccced68d10910f6120809cf1d.tar.bz2 |
audio: Add overlay to fix analog docks.
Of particular interest to devices using libhardware_legacy and
affected by commit 5a484b753cc72d6a50c1dd3bbf68b3403c741a3a: http://goo.gl/rVR1Z
which restricted the routing of AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET
to docks using FORCE_ANALOG_DOCK cases. The EXTRA_DOCK_STATE_CAR case is
returning FORCE_BT_CAR_DOCK, preventing the dock audio from routing properly.
Add an overlay option for overriding to FORCE_ANALOG_DOCK.
Change-Id: Ib7d70c242aa6f537ea5d65098ceb2c591662d8bb
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioService.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 338ba5e..033bb8a 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -446,6 +446,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { private boolean mDockAudioMediaEnabled = true; + private boolean mForceAnalogDeskDock; + private boolean mForceAnalogCarDock; + private int mDockState = Intent.EXTRA_DOCK_STATE_UNDOCKED; private boolean mVolumeKeysControlRingStream; @@ -570,6 +573,12 @@ public class AudioService extends IAudioService.Stub implements OnFinished { mMasterVolumeRamp = context.getResources().getIntArray( com.android.internal.R.array.config_masterVolumeRamp); + mForceAnalogDeskDock = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_forceAnalogDeskDock); + + mForceAnalogCarDock = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_forceAnalogCarDock); + mMainRemote = new RemotePlaybackState(-1, MAX_STREAM_VOLUME[AudioManager.STREAM_MUSIC], MAX_STREAM_VOLUME[AudioManager.STREAM_MUSIC]); mHasRemotePlayback = false; @@ -3888,10 +3897,10 @@ public class AudioService extends IAudioService.Stub implements OnFinished { int config; switch (dockState) { case Intent.EXTRA_DOCK_STATE_DESK: - config = AudioSystem.FORCE_BT_DESK_DOCK; + config = mForceAnalogDeskDock ? AudioSystem.FORCE_ANALOG_DOCK : AudioSystem.FORCE_BT_DESK_DOCK; break; case Intent.EXTRA_DOCK_STATE_CAR: - config = AudioSystem.FORCE_BT_CAR_DOCK; + config = mForceAnalogCarDock ? AudioSystem.FORCE_ANALOG_DOCK : AudioSystem.FORCE_BT_CAR_DOCK; break; case Intent.EXTRA_DOCK_STATE_LE_DESK: config = AudioSystem.FORCE_ANALOG_DOCK; |