[Sprint Samsung Galaxy S III] Didact74:
Freeza,

I was farting around with this MOD today and even when hand applying the changes to a stock ROM it sticks at the Samsung screen. So I reversed the code and applied one method at a time until it would boot. Here is what I found.....

The code change inside of the .method public interceptKeyBeforeQueueing(Landroid/view/KeyEvent;IZ)I

is where the problem is. Specifically the changes that are made inside this section of code:

:cond_20
move-object/from16 v0, p0

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

if-nez v0, :cond_21

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

move-result v20

if-eqz v20, :cond_21

move-object/from16 v0, p0

invoke-virtual {v0, v13}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V

:cond_21
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-nez v23, :cond_1

new-instance v23, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

const/16 v24, 0x0

move-object/from16 v0, v23

move-object/from16 v1, p0

move-object/from16 v2, v24

invoke-direct {v0, v1, v2}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;Lcom/android/internal/policy/impl/PhoneWindowManager$1;)V

move-object/from16 v0, v23

move-object/from16 v1, p0

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

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, v15, v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V

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

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

goto/16 :goto_2

:cond_22
if-nez v5, :cond_23

move-object/from16 v0, p0

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

if-eqz v0, :cond_23

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_23

move-object/from16 v0, p0

const/4 v3, 0x0

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

:cond_23
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

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, v15, v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V

const/16 v23, 0x0

move-object/from16 v0, v23

move-object/from16 v1, p0

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

goto/16 :goto_2

:sswitch_2
and-int/lit8 v20, v20, -0x2

if-eqz v5, :cond_27

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

move-result-object v22

const/4 v8, 0x0

if-eqz v22, :cond_24

:try_start_1
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->endCall()Z
:try_end_1
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_1

move-result v8

:cond_24
:goto_9
if-eqz p3, :cond_25

if-eqz v8, :cond_26

:cond_25
const/16 v23, 0x1

:goto_a
move-object/from16 v0, p0

move/from16 v1, v23

invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptPowerKeyDown(Z)V

goto/16 :goto_2

:catch_1
move-exception v6

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

goto :goto_9

:cond_26
const/16 v23, 0x0

goto :goto_a

:cond_27
move-object/from16 v0, p0

invoke-direct {v0, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptPowerKeyUp(Z)Z

move-result v23

if-eqz v23, :cond_1

move-object/from16 v0, p0

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

move/from16 v23, v0

and-int/lit8 v23, v23, 0x1

if-eqz v23, :cond_28

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

move-result v23

if-nez v23, :cond_1

:cond_28
move-object/from16 v0, p0

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

move/from16 v23, v0

and-int/lit8 v23, v23, 0x2

if-eqz v23, :cond_1

and-int/lit8 v23, v20, -0x3

or-int/lit8 v20, v23, 0x4

goto/16 :goto_2

:sswitch_3
and-int/lit8 v20, v20, -0x2

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

move-object/from16 v23, v0

invoke-interface/range {v23 .. v23}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->fakeState()I

move-result v7

if-eqz v5, :cond_32

const-string v23, "WindowManager"

const-string v24, "KeyEvent.KEYCODE_POWER"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->secI(Ljava/lang/String;Ljava/lang/String;)I

if-eqz v7, :cond_2a

const/16 v23, 0x2

move/from16 v0, v23

if-ne v7, v0, :cond_29

const-string v23, "FakeShutdown"

const-string v24, "PWM : is Fake sleep mode"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

const/16 v23, 0x1

move/from16 v0, v23

move-object/from16 v1, p0

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

move-object/from16 v0, p0

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

move-object/from16 v23, v0

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerLongPressWhenFake:Ljava/lang/Runnable;

move-object/from16 v24, v0

invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J

move-result-wide v25

invoke-virtual/range {v23 .. v26}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

const/16 v20, 0x0

goto/16 :goto_2

:cond_29
const/16 v20, 0x0

goto/16 :goto_2

:cond_2a
if-eqz p3, :cond_2b

move-object/from16 v0, p0

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

move/from16 v23, v0

if-nez v23, :cond_2b

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

move-result v23

move/from16 v0, v23

and-int/lit16 v0, v0, 0x400

move/from16 v23, v0

if-nez v23, :cond_2b

const/16 v23, 0x1

move/from16 v0, v23

move-object/from16 v1, p0

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

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

move-result-wide v23

move-wide/from16 v0, v23

move-object/from16 v2, p0

iput-wide v0, v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerKeyTime:J

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

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

:cond_2b
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

move-object/from16 v23, v0

const/16 v24, 0x3

invoke-interface/range {v23 .. v24}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->getWakeFlag(I)Z

move-result v23

move/from16 v0, v23

move-object/from16 v1, p0

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

move-object/from16 v0, p0

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

move/from16 v23, v0

if-eqz v23, :cond_2e

if-eqz v12, :cond_2e

const/4 v13, 0x1

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

move-result-object v22

const/4 v8, 0x0

if-eqz v22, :cond_2c

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

move-result v23

if-eqz v23, :cond_2f

const-string v23, "KOR"

const-string v24, ""

invoke-virtual/range {v23 .. v24}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v23

if-nez v23, :cond_2c

invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->silenceRinger()V
:try_end_2
.catch Landroid/os/RemoteException; {:try_start_2 .. :try_end_2} :catch_2

:cond_2c
:goto_c

if-eqz p3, :cond_2d

if-nez v8, :cond_2d

move-object/from16 v0, p0

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

move/from16 v23, v0

if-nez v23, :cond_2d

move-object/from16 v0, p0

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

move/from16 v23, v0

if-nez v23, :cond_2d

move-object/from16 v0, p0

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

move/from16 v23, v0

if-eqz v23, :cond_31

:cond_2d
const/16 v23, 0x1

:goto_d
move-object/from16 v0, p0

move/from16 v1, v23

invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptPowerKeyDown(Z)V

move-object/from16 v0, p0

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

move-object/from16 v23, v0

const/16 v24, 0x1a

invoke-virtual/range {v23 .. v24}, Lcom/android/internal/policy/impl/PhoneWindowManager$HoldKeyConcept;->isSystemKeyEventRequested(I)Z

move-result v23

if-eqz v23, :cond_1

const-string v23, "WindowManager"

const-string v24, "in interceptKeyBeforeQueueing() KEYCODE_POWER Down event isSystemKeyEventRequested() is true"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->secV(Ljava/lang/String;Ljava/lang/String;)I

or-int/lit8 v20, v20, 0x1

goto/16 :goto_2

:cond_2e
const/4 v13, 0x0

goto :goto_b

:cond_2f
:try_start_3
move-object/from16 v0, p0

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

move/from16 v23, v0

and-int/lit8 v23, v23, 0x2

if-eqz v23, :cond_2c

invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isOffhook()Z

move-result v23

if-eqz v23, :cond_2c

if-nez p3, :cond_30

if-eqz v13, :cond_2c

:cond_30
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->endCall()Z
:try_end_3
.catch Landroid/os/RemoteException; {:try_start_3 .. :try_end_3} :catch_2

move-result v8

goto :goto_c

:catch_2
move-exception v6

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

goto :goto_c

:cond_31
const/16 v23, 0x0

goto :goto_d

:cond_32
if-eqz v7, :cond_34

const/16 v23, 0x2

move/from16 v0, v23

if-ne v7, v0, :cond_33

const-string v23, "FakeShutdown"

new-instance v24, Ljava/lang/StringBuilder;

invoke-direct/range {v24 .. v24}, Ljava/lang/StringBuilder;-><init>()V

const-string v25, "PWM : is fakestate : "

invoke-virtual/range {v24 .. v25}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v24

move-object/from16 v0, v24

invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v24

invoke-virtual/range {v24 .. v24}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v24

invoke-static/range {v23 .. v24}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

move-object/from16 v0, p0

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

move-object/from16 v23, v0

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerLongPressWhenFake:Ljava/lang/Runnable;

move-object/from16 v24, v0

invoke-virtual/range {v23 .. v24}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

:try_start_4
const-string v23, "power"

invoke-static/range {v23 .. v23}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;

move-result-object v23

invoke-static/range {v23 .. v23}, Landroid/os/IPowerManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IPowerManager;

move-result-object v19

invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

move-result-wide v23

const/16 v25, 0x5

move-object/from16 v0, v19

move-wide/from16 v1, v23

move/from16 v3, v25

invoke-interface {v0, v1, v2, v3}, Landroid/os/IPowerManager;->goToSleepWithReason(JI)V
:try_end_4
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_5

:goto_e
const/16 v20, 0x0

goto/16 :goto_2

:cond_33
const-string v23, "FakeShutdown"

const-string v24, "PWM : should wake up, ACTION_PASS_TO_USER"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

const/16 v20, 0x0

goto/16 :goto_2

:cond_34
const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

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

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

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

if-nez v4, :cond_35

move-object/from16 v0, p0

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

move/from16 v23, v0

if-eqz v23, :cond_38

:cond_35
const/16 v23, 0x1

:goto_f
move-object/from16 v0, p0

move/from16 v1, v23

invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptPowerKeyUp(Z)Z

move-result v23

if-eqz v23, :cond_36

and-int/lit8 v23, v20, -0x3

or-int/lit8 v20, v23, 0x4

:cond_36
move-object/from16 v0, p0

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

move-object/from16 v23, v0

const/16 v24, 0x1a

invoke-virtual/range {v23 .. v24}, Lcom/android/internal/policy/impl/PhoneWindowManager$HoldKeyConcept;->isSystemKeyEventRequested(I)Z

move-result v23

if-eqz v23, :cond_37

const-string v23, "WindowManager"

const-string v24, "in interceptKeyBeforeQueueing() KEYCODE_POWER Up event isSystemKeyEventRequested() is true"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->secV(Ljava/lang/String;Ljava/lang/String;)I

or-int/lit8 v20, v20, 0x1

and-int/lit8 v20, v20, -0x5

:cond_37
const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

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

goto/16 :goto_2

:cond_38
const/16 v23, 0x0

goto :goto_f

:sswitch_4
if-nez p3, :cond_1

if-eqz v5, :cond_1

and-int/lit8 v23, v20, 0x1

if-nez v23, :cond_1

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

move-object/from16 v23, v0

invoke-virtual/range {v23 .. v23}, Landroid/os/PowerManager$WakeLock;->acquire()V

move-object/from16 v0, p0

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

move-object/from16 v23, v0

const/16 v24, 0x3

new-instance v25, Landroid/view/KeyEvent;

move-object/from16 v0, v25

move-object/from16 v1, p1

invoke-direct {v0, v1}, Landroid/view/KeyEvent;-><init>(Landroid/view/KeyEvent;)V

invoke-virtual/range {v23 .. v25}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

move-result-object v18

const/16 v23, 0x1

move-object/from16 v0, v18

move/from16 v1, v23

invoke-virtual {v0, v1}, Landroid/os/Message;->setAsynchronous(Z)V

invoke-virtual/range {v18 .. v18}, Landroid/os/Message;->sendToTarget()V

goto/16 :goto_2

:sswitch_5
if-eqz v5, :cond_39

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

move-result-object v22

if-eqz v22, :cond_39

:try_start_5
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isIdle()Z
:try_end_5
.catch Landroid/os/RemoteException; {:try_start_5 .. :try_end_5} :catch_3

move-result v23

if-eqz v23, :cond_1

:cond_39
:goto_10
:sswitch_6
const/16 v23, 0x4f

move/from16 v0, v23

if-ne v15, v0, :cond_3a

const-string v23, "ril.factory_mode"

invoke-static/range {v23 .. v23}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v23

const-string v24, "PBA"

invoke-virtual/range {v23 .. v24}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v23

if-eqz v23, :cond_3a

const-string v23, "WindowManager"

const-string v24, " KeyEvent.KEYCODE_HEADSETHOOK blocked..."

invoke-static/range {v23 .. v24}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

goto/16 :goto_2

:catch_3
move-exception v6

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

goto :goto_10

:cond_3a
:sswitch_7
and-int/lit8 v23, v20, 0x1

if-nez v23, :cond_1

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

move-object/from16 v23, v0

invoke-virtual/range {v23 .. v23}, Landroid/os/PowerManager$WakeLock;->acquire()V

move-object/from16 v0, p0

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

move-object/from16 v23, v0

const/16 v24, 0x3

new-instance v25, Landroid/view/KeyEvent;

move-object/from16 v0, v25

move-object/from16 v1, p1

invoke-direct {v0, v1}, Landroid/view/KeyEvent;-><init>(Landroid/view/KeyEvent;)V

invoke-virtual/range {v23 .. v25}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

move-result-object v18

const/16 v23, 0x1

move-object/from16 v0, v18

move/from16 v1, v23

invoke-virtual {v0, v1}, Landroid/os/Message;->setAsynchronous(Z)V

invoke-virtual/range {v18 .. v18}, Landroid/os/Message;->sendToTarget()V

goto/16 :goto_2

:sswitch_8
if-eqz v5, :cond_1

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

move-result-object v22

if-eqz v22, :cond_1

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

move-result v23

if-eqz v23, :cond_1

const-string v23, "WindowManager"

const-string v24, "interceptKeyBeforeQueueing: CALL key-down while ringing: Answer the call!"

invoke-static/range {v23 .. v24}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->answerRingingCall()V
:try_end_6
.catch Landroid/os/RemoteException; {:try_start_6 .. :try_end_6} :catch_4

and-int/lit8 v20, v20, -0x2

goto/16 :goto_2

:catch_4
move-exception v6

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

goto/16 :goto_2

:sswitch_9
if-eqz v12, :cond_1

if-eqz v5, :cond_3d

if-nez v14, :cond_3c

if-eqz p3, :cond_3b

const/16 v23, 0x0

const/16 v24, 0xe

const/16 v25, 0x0

move-object/from16 v0, p0

move-object/from16 v1, v23

move/from16 v2, v24

move/from16 v3, v25

invoke-virtual {v0, v1, v2, v3}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z

:cond_3b
move-object/from16 v0, p0

move/from16 v1, p3

invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->playSoundEffect(Z)V

:cond_3c
if-eqz p3, :cond_1

move-object/from16 v0, p0

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

move/from16 v23, v0

if-nez v23, :cond_1

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

move-result v23

move/from16 v0, v23

and-int/lit16 v0, v0, 0x400

move/from16 v23, v0

if-nez v23, :cond_1

const/16 v23, 0x1

move/from16 v0, v23

move-object/from16 v1, p0

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

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

move-result-wide v23

move-wide/from16 v0, v23

move-object/from16 v2, p0

iput-wide v0, v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyTime:J

const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

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

const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

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

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

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

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

goto/16 :goto_2

:cond_3d
const/16 v23, 0x0

move/from16 v0, v23

move-object/from16 v1, p0

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

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

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

goto/16 :goto_2

:sswitch_a
if-eqz v5, :cond_1

if-eqz v12, :cond_1

if-eqz p3, :cond_3e

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

move-result v23

const/16 v24, 0x4002

move/from16 v0, v23

move/from16 v1, v24

if-eq v0, v1, :cond_3e

const/16 v23, 0x0

const/16 v24, 0xe

const/16 v25, 0x0

move-object/from16 v0, p0

move-object/from16 v1, v23

move/from16 v2, v24

move/from16 v3, v25

invoke-virtual {v0, v1, v2, v3}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z

:cond_3e
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getSource()I

move-result v23

const/16 v24, 0x4002

move/from16 v0, v23

move/from16 v1, v24

if-eq v0, v1, :cond_1

move-object/from16 v0, p0

move/from16 v1, p3

invoke-direct {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->playSoundEffect(Z)V

goto/16 :goto_2

:sswitch_b
const/16 v20, 0x1

goto/16 :goto_2

:catch_5
move-exception v23

goto/16 :goto_e

:sswitch_data_0
.sparse-switch
0x0 -> :sswitch_0
0x3 -> :sswitch_9
0x4 -> :sswitch_a
0x5 -> :sswitch_8
0x6 -> :sswitch_2
0x18 -> :sswitch_1
0x19 -> :sswitch_1
0x1a -> :sswitch_3
0x4f -> :sswitch_6
0x52 -> :sswitch_a
0x55 -> :sswitch_5
0x56 -> :sswitch_7
0x57 -> :sswitch_7
0x58 -> :sswitch_7
0x59 -> :sswitch_7
0x5a -> :sswitch_7
0x5b -> :sswitch_4
0x7e -> :sswitch_5
0x7f -> :sswitch_5
0x82 -> :sswitch_7
0xa4 -> :sswitch_1
0xa8 -> :sswitch_1
0xa9 -> :sswitch_1
0xbb -> :sswitch_a
0xef -> :sswitch_b
.end sparse-switch

All the other changes take fine and boot, its only when you apply that specific section above will it hang. I am trying to figure out why but maybe this will help you in the meantime.