[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] loserskater:
This has been updated. Check out the new thread: http://xdaforums.com/showthread.php?t=2254022

Now includes checkbox in settings to enable and disable!

Thanks to jakubklos for his diff file and getting me in the right direction.

And a HUGE thanks to the CM team.

CODE IN RED IS NEW!

CODE IN BLUE IS MODIFIED!

Some of your lines/variables may be different.

I've attached the original and modified files so you can diff them yourself!

First, decompile SecSettings.apk. If you're unsure how to do that you're going to have some pretty big issues ahead.

Navigate to res/values/strings.xml

and add the following to the end:

<string name="volbtn_music_controls_title">Volume rocker music controls</string>
<string name="volbtn_music_controls_summary">When screen off, long-pressing the volume rockers will seek music tracks</string>

Next navigate to res/xml/sound_settings.xml

and add the section in red:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.android.settings.VibrationFeedbackPreference android:title="@string/vibration_intensity" android:key="vibration_feedback_intensity" android:summary="" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/vibration_intensity" />
<PreferenceScreen android:title="@string/phone_profile" android:key="phone_profile" android:summary="@string/normal" android:fragment="com.android.settings.phoneprofile.PhoneProfileSettings" />
<Preference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</Preference>
<PreferenceCategory android:title="@string/sound_category_calls_and_notification_title" android:key="category_calls_and_notification" />
<PreferenceScreen android:title="@string/download_ringtones" android:key="download_ringtone" android:summary="">
<intent android:action="android.intent.action.VIEW" android:data="http://waprd.telstra.com/redirect?target=3glatesttones" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/ringtone_title" android:key="ringtone" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/ringtone_title" android:ringtoneType="ringtone" />
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/voice_call_ringtone2" android:key="ringtone2" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/voice_call_ringtone2" android:ringtoneType="ringtone2" />
<PreferenceScreen android:title="@string/phone_vibration_title" android:key="phone_vibration" android:summary="@string/phone_vibration_summary" android:widgetLayout="@layout/round_more_icon">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.personalvibration.SelectPatternDialog" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/notification_sound_title" android:key="notification_sound" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/notification_sound_dialog_title" android:ringtoneType="notification" />
<CheckBoxPreference android:persistent="false" android:title="@string/vibrate_on_ring_title" android:key="vibrate_when_ringing" />
<PreferenceCategory android:title="@string/sound_category_system_title" />
<CheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<CheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<CheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<CheckBoxPreference android:title="@string/gps_notification_sounds_title" android:key="gps_notification_sounds" />
<CheckBoxPreference android:title="@string/haptic_feedback_enable_title" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<SwitchPreferenceScreen android:title="@string/auto_haptic" android:key="autohaptic_settings" android:fragment="com.android.settings.autohaptic.AutoHapticSettings" />
<ListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/emergency_tone_values" />
[COLOR="Red"]<CheckBoxPreference android:persistent="false" android:title="@string/volbtn_music_controls_title" android:key="volbtn_music_controls" android:summary="@string/volbtn_music_controls_summary" />[/COLOR]
</PreferenceScreen>

Now let's get into some smail.

Open up com/android/settings/SoundSettings.smali

.field private mSoundSettings:Landroid/preference/PreferenceGroup;

.field private mUnloadSoundEffectRunnable:Ljava/lang/Runnable;

.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;

[COLOR="red"].field private mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;[/COLOR]

.field private mVolume:Lcom/android/settings/RingerVolumePreference;

method onCreate:

const-string v18, "lockscreen_sounds_enabled"

const/16 v20, 0x1

move-object/from16 v0, v18

move/from16 v1, v20

invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v18

if-eqz v18, :cond_f

const/16 v18, 0x1

:goto_6
move-object/from16 v0, v19

move/from16 v1, v18

invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

.line 291
[COLOR="red"]const-string v18, "volbtn_music_controls"

move-object/from16 v0, p0

move-object/from16 v1, v18

invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v18

check-cast v18, Landroid/preference/CheckBoxPreference;

move-object/from16 v0, v18

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;

move-object/from16 v18, v0

const/16 v19, 0x0

invoke-virtual/range {v18 .. v19}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;

move-object/from16 v19, v0

const-string v18, "volbtn_music_controls"

const/16 v20, 0x1

move-object/from16 v0, v18

move/from16 v1, v20

invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v18

if-eqz v18, :cond_long

const/16 v18, 0x1

:goto_long
move-object/from16 v0, v19

move/from16 v1, v18

invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]

const-string v18, "ringtone"

move-object/from16 v0, p0

move-object/from16 v1, v18

invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

:cond_d
const/16 v18, 0x0

goto/16 :goto_4

.line 280
:cond_e
const/16 v18, 0x0

goto/16 :goto_5

.line 288
:cond_f
const/16 v18, 0x0

goto/16 :goto_6

[COLOR="red"]:cond_long
const/16 v18, 0x0

goto/16 :goto_long[/COLOR]

.line 315
.restart local v17 #vibrator:Landroid/os/Vibrator;
:cond_11
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SoundSettings;->getActivity()Landroid/app/Activity;

move-result-object v18

invoke-static/range {v18 .. v18}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z

method onPreferenceTreeClick:

iget-object v4, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v4

if-eqz v4, :cond_e

:goto_8
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto/16 :goto_1

:cond_e
move v0, v1

goto :goto_8

.line 640
:cond_f
[COLOR="red"]iget-object v2, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;

if-ne p2, v2, :cond_next

.line 637
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "volbtn_music_controls"

iget-object v4, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v4

if-eqz v4, :cond_long

:goto_long
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto/16 :goto_1

:cond_long
move v0, v1

goto :goto_long

:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mMusicFx:Landroid/preference/Preference;

if-ne p2, v0, :cond_0

goto/16 :goto_2
.end method

Now recompile SecSettings and the setting should be there. It won't do anything though.

Next we need to decompile android.policy.jar.

First file is com\android\internal\policy\impl\PhoneWindowManager$PolicyHandler.smali

Add another switch statement:

:pswitch_4
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

#calls: Lcom/android/internal/policy/impl/PhoneWindowManager;->enableSPenGesture()V
invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$300(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

goto :goto_0

[COLOR="red"]:pswitch_5
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

check-cast v0, Landroid/view/KeyEvent;

invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V

iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

check-cast v0, Landroid/view/KeyEvent;

const/16 v3, 0x01

invoke-static {v0, v3}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;

move-result-object v0

invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V

iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

const/4 v2, 0x1

iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

goto :goto_0[/COLOR]

.line 828
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
[COLOR="red"]:pswitch_5[/COLOR]
.end packed-switch
.end method

Next: com\android\internal\policy\impl\PhoneWindowManager$SettingsObserver.smali

method observe:

const-string v1, "incall_power_button_behavior"

invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

[COLOR="red"]const-string v1, "volbtn_music_controls"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]

.line 878
const-string v1, "accelerometer_rotation"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

Next: com\android\internal\policy\impl\PhoneWindowManager.smali

.field static final LONG_PRESS_POWER_NOTHING:I = 0x0

.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

[COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR]

.field static final MINI_APP_DIALOG_LAYER:I = 0x5

.field static final MINI_APP_LAYER:I = 0x3

.field private mIsSensorhubEnabled:Z

.field private mIsVisibleSPenGestureView:Z

[COLOR="red"].field mIsVolumeAction:Z

.field mIsVolumeBlocking:Z[/COLOR]

.field mKeyboardTapVibePattern:[J

.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;

.field mVoiceTalkDefaultLaunch:Z

.field mVoiceTalkIntent:Landroid/content/Intent;

[COLOR="red"].field mVolBtnMusicControls:I[/COLOR]

.field private mVolumeDownKeyConsumedByScreenshotChord:Z

method handleVolumeKey:

.method handleVolumeKey(II)V
.locals 5

[COLOR="red"]move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

if-nez v0, :cond_vc[/COLOR]

invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;

move-result-object v0

if-nez v0, :cond_0

.line 4898
[COLOR="Red"]:cond_vc[/COLOR]
:goto_0
return-void

.line 4875
:cond_0

Add the following after the above method handleVolumeKey

[COLOR="Red"].method handleVolumeLongPress(Landroid/view/KeyEvent;)V
.locals 11
.parameter "event"

.prologue
const/4 v7, 0x0

.line 26
const/4 v0, 0x1

iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

.line 27
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

.line 28
invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I

move-result v0

const/16 v1, 0x18

if-ne v0, v1, :cond_0

.line 29
const/16 v6, 0x57

.line 30
.local v6, newKeyCode:I
:goto_0
iget-object v9, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

const/4 v10, 0x6

.line 31
new-instance v0, Landroid/view/KeyEvent;

invoke-virtual {p1}, Landroid/view/KeyEvent;->getDownTime()J

move-result-wide v1

invoke-virtual {p1}, Landroid/view/KeyEvent;->getEventTime()J

move-result-wide v3

invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

move-result v5

invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;->(JJIII)V

.line 30
invoke-virtual {v9, v10, v0}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

move-result-object v8

.line 32
.local v8, msg:Landroid/os/Message;
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

sget v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I

int-to-long v1, v1

invoke-virtual {v0, v8, v1, v2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

.line 33
return-void

.line 29
.end local v6 #newKeyCode:I
.end local v8 #msg:Landroid/os/Message;
:cond_0
const/16 v6, 0x58

goto :goto_0
.end method

.method handleVolumeLongPressAbort()V
.locals 2

.prologue
.line 36
const/4 v0, 0x0

iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

.line 37
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

const/4 v1, 0x6

invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

.line 38
return-void
.end method[/COLOR]

method interceptKeyBeforeQueueing:

This one's kind of hard to find so here's some extra lines before and after:

.line 5201
const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyConsumedByScreenshotChord:Z

.line 5202
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingPowerKeyAction()V

.line 5203
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenrecordChordAction()V

.line 5204
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptScreenshotChord()V

.line 5246
:cond_1a
:goto_8
if-eqz v5, [COLOR="Blue"]:cond_long[/COLOR]

.line 5247
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;

move-result-object v22

.line 5248
.local v22, telephonyService:Lcom/android/internal/telephony/ITelephony;
if-eqz v22, :cond_20

.line 5250
:try_start_0
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z

const-string v23, "WindowManager"

const-string v24, "ITelephony threw RemoteException"

move-object/from16 v0, v23

move-object/from16 v1, v24

invoke-static {v0, v1, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

.line 5333
.end local v6 #ex:Landroid/os/RemoteException;
:cond_20
move-object/from16 v0, p0

[COLOR="Red"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z

if-nez v0, :cond_reg

invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z

move-result v21

if-eqz v21, :cond_reg

const/16 v1, 0x1

move-object/from16 v0, p0

iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I

if-ne v0, v1, :cond_reg

move-object/from16 v0, p0

move-object/from16 v1, p1

invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(Landroid/view/KeyEvent;)V

:cond_reg
move-object/from16 v0, p0[/COLOR]

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

if-nez v23, :cond_1

and a couple lines down:

move-object/from16 v23, v0

invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V

goto/16 :goto_2

.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

if-eqz v0, :cond_vc

const/16 v1, 0x1

move-object/from16 v0, p0

iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I

if-ne v0, v1, :cond_vc

invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

if-nez v0, :cond_vc

move-object/from16 v0, p0

const/4 v3, 0x0

invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V

:cond_vc[/COLOR]
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

if-eqz v23, :cond_1

method updateSettings:

const-string v19, "incall_power_button_behavior"

const/16 v20, 0x1

move-object/from16 v0, v19

move/from16 v1, v20

invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v9

[COLOR="red"]const-string v19, "volbtn_music_controls"

const/16 v20, 0x0

move-object/from16 v0, v19

move/from16 v1, v20

invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v3[/COLOR]

.line 2006
const-string v19, "user_rotation"

iput v6, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I

.line 2028
move-object/from16 v0, p0

iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I

[COLOR="red"]move-object/from16 v0, p0

iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I[/COLOR]

.line 2030
move-object/from16 v0, p0

iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I

Newer Firmwares:(Sprint 4.1.2 MR2, etc.)

com\android\internal\policy\impl\PhoneWindowManager.smali

We need to edit one of the sections in method interceptKeyBeforeQueueing.

Remove the code in purple and add the code in green.

move-object/from16 v23, v0

invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V

goto/16 :goto_2

.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

if-eqz v0, :cond_vc

invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

if-nez v0, :cond_vc

move-object/from16 v0, p0

const/4 v3, 0x0

[COLOR="Purple"]invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]

[COLOR="Green"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

move-object/from16 v0, v23

invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->handleVolume(II)V[/COLOR]

:cond_vc[/COLOR]
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

if-eqz v23, :cond_1

com\android\internal\policy\impl\PhoneWindowManager$SamsungVolumeControlThread.smali

method handleVolume:

.method handleVolume(II)V
.locals 6

[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

if-nez v0, :cond_vc[/COLOR]

iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

iget-object v3, v3, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

const-string v4, "audio"

invoke-virtual {v3, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/media/AudioManager;

if-nez v0, :cond_0

[COLOR="red"]:cond_vc[/COLOR]
:goto_0
return-void

:cond_0
:try_start_0
invoke-virtual {v0}, Landroid/media/AudioManager;->dismissVolumePanel()V

sparse-switch p2, :sswitch_data_0

goto :goto_0

ISSUES:

Pressing volume up or down both turn the volume down(or up):

Looking at a little bit more from the last entry:

move-object/from16 v23, v0

invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V

goto/16 :goto_2

.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

if-eqz v0, :cond_vc

invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V

move-object/from16 v0, p0

iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

if-nez v0, :cond_vc

move-object/from16 v0, p0

const/4 v3, 0x0

invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V

:cond_vc[/COLOR]
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

if-eqz v23, :cond_1

.line 5342
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

move-object/from16 v23, v0

move-object/from16 v0, v23

invoke-virtual {v0, [COLOR="Orange"]v15[/COLOR], v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V

Pull the variable in orange from the last line and replace the variable in line

invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V

Make sure you're not replacing the last line with anything, but using it as reference.