[LG Optimus 3D] defcomg:
@ilie321

Check this out

http://www.java2s.com/Open-Source/A...works-base/android/media/AudioSystem.java.htm

from ICS

.field public static final AUDIO_STATUS_ERROR:I = 0x1

.field public static final AUDIO_STATUS_OK:I = 0x0

.field public static final AUDIO_STATUS_SERVER_DIED:I = 0x64

.field public static final DEVICE_IN_AMBIENT:I = 0x20000

.field public static final DEVICE_IN_AUX_DIGITAL:I = 0x800000

.field public static final DEVICE_IN_BLUETOOTH_SCO_HEADSET:I = 0x200000

.field public static final DEVICE_IN_BUILTIN_MIC1:I = 0x40000

.field public static final DEVICE_IN_BUILTIN_MIC2:I = 0x80000

.field public static final DEVICE_IN_COMMUNICATION:I = 0x10000

.field public static final DEVICE_IN_DEFAULT:I = -0x80000000

.field public static final DEVICE_IN_FM_RADIO_RX:I = 0x2000000

.field public static final DEVICE_IN_FM_RXA2DP:I = 0x10000000

.field public static final DEVICE_IN_MIC_ARRAY:I = 0x100000

.field public static final DEVICE_IN_WIRED_HEADSET:I = 0x400000

.field public static final DEVICE_OUT_ANLG_DOCK_HEADSET:I = 0x800

.field public static final DEVICE_OUT_AUX_DIGITAL:I = 0x400

.field public static final DEVICE_OUT_BLUETOOTH_A2DP:I = 0x80

.field public static final DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES:I = 0x100

.field public static final DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER:I = 0x200

.field public static final DEVICE_OUT_BLUETOOTH_SCO:I = 0x10

.field public static final DEVICE_OUT_BLUETOOTH_SCO_CARKIT:I = 0x40

.field public static final DEVICE_OUT_BLUETOOTH_SCO_HEADSET:I = 0x20

.field public static final DEVICE_OUT_DEFAULT:I = 0x8000

.field public static final DEVICE_OUT_DGTL_DOCK_HEADSET:I = 0x1000

.field public static final DEVICE_OUT_EARPIECE:I = 0x1

.field public static final DEVICE_OUT_FM_RADIO_TX:I = 0x2000

.field public static final DEVICE_OUT_SPEAKER:I = 0x2

.field public static final DEVICE_OUT_WIRED_HEADPHONE:I = 0x8

.field public static final DEVICE_OUT_WIRED_HEADSET:I = 0x4

.field public static final DEVICE_STATE_AVAILABLE:I = 0x1

.field public static final DEVICE_STATE_UNAVAILABLE:I = 0x0

.field public static final FORCE_ALL:I = 0xb

.field public static final FORCE_ANALOG_DOCK:I = 0x9

.field public static final FORCE_BT_A2DP:I = 0x5

.field public static final FORCE_BT_CAR_DOCK:I = 0x7

.field public static final FORCE_BT_DESK_DOCK:I = 0x8

.field public static final FORCE_BT_SCO:I = 0x4

.field public static final FORCE_DEFAULT:I = 0x0

.field public static final FORCE_DIGITAL_DOCK:I = 0xa

.field public static final FORCE_EARPIECE:I = 0x1

.field public static final FORCE_HEADPHONES:I = 0x3

.field public static final FORCE_NONE:I = 0x0

.field public static final FORCE_SPEAKER:I = 0x2

.field public static final FORCE_WIRED_ACCESSORY:I = 0x6

.field public static final FOR_COMMUNICATION:I = 0x0

.field public static final FOR_DOCK:I = 0x3

.field public static final FOR_MEDIA:I = 0x1

.field public static final FOR_RECORD:I = 0x2

.field public static final MODE_CURRENT:I = -0x1

.field public static final MODE_INVALID:I = -0x2

.field public static final MODE_IN_CALL:I = 0x2

.field public static final MODE_IN_COMMUNICATION:I = 0x3

.field public static final MODE_NORMAL:I = 0x0

.field public static final MODE_RINGTONE:I = 0x1

.field public static final MODE_VOIP_CALL:I = 0x5

.field public static final MODE_VT_CALL:I = 0x4

.field private static final NUM_DEVICE_STATES:I = 0x1

.field private static final NUM_FORCE_CONFIG:I = 0xc

.field private static final NUM_FORCE_USE:I = 0x4

.field public static final NUM_MODES:I = 0x6

.field public static final NUM_STREAMS:I = 0x5

.field private static final NUM_STREAM_TYPES:I = 0xb

.field public static final PHONE_STATE_INCALL:I = 0x2

.field public static final PHONE_STATE_OFFCALL:I = 0x0

.field public static final PHONE_STATE_RINGING:I = 0x1

According to the link above this method

setDeviceConnectionState(int device, int state, String device_address);

+

setForceUse(int usage, int config);

.field public static final DEVICE_IN_FM_RADIO_RX:I =

setDeviceConnectionState(int 0x2000000, int 1, String DEVICE_IN_FM_RADIO_RX);

setForceUse(int 1, int 2);

Calling that from the app may route audio to Headset without any scripts

This also needs to be added

http://developer.android.com/training/managing-audio/audio-focus.html

Thats why if you adjust volume outside the app sound goes out