[Samsung Epic 4G Touch] tdunham:
FI25/FI27 Long Press Back to Kill App

Another brilliant mod ported over from the Galaxy SII I9100.

Many thanks go out to Mirko DDD for this one too: http://xdaforums.com/showthread.php?t=1969499

Added a flashable zip. This is for stock deodexed FI25/FI27 ICS only.

Android.Policy.Jar - Classes.dex

Download PhoneWindowManager$KillConcept.zip, unzip and add the new smali file to: com/android/internal/policy/impl.

PhoneWindowManager.smali edits.

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

Line 191

Before:

.field final mAllowSystemUiDelay:Ljava/lang/Runnable;

.field mBootMsgDialog:Landroid/app/ProgressDialog;

After:

.field final mAllowSystemUiDelay:Ljava/lang/Runnable;

.field mBackKillTimeout:Z

.field mBackLongPress:Ljava/lang/Runnable;

.field mBootMsgDialog:Landroid/app/ProgressDialog;

Line 339

Before:

.field mLockScreenTimerActive:Z

.field private mLongPressOnHomeBehavior:I

After:

.field mLockScreenTimerActive:Z

.field mLongPressBackKill:Z

.field private mLongPressOnHomeBehavior:I

Line 888

Before:

iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHideNavInputHandler:Landroid/view/InputHandler;

.line 3653
new-instance v0, Ljava/lang/Object;

After:

iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHideNavInputHandler:Landroid/view/InputHandler;

.line 2768
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;

invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;

.line 3653
new-instance v0, Ljava/lang/Object;

Line 8547

Before:

.line 2250
:cond_121
const/16 v36, 0x3

After:

.line 2250
:cond_121
const/16 v25, 0x4

move/from16 v0, v25

move/from16 v1, v19

if-ne v1, v0, :cond_16a

if-nez v8, :cond_16a

.line 1741
and-int/lit8 v25, v11, 0x20

if-nez v25, :cond_16a

.line 1742
move-object/from16 v0, p0

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

move-object/from16 v25, v0

move-object/from16 v0, p0

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

move-object/from16 v1, v25

invoke-virtual {v1, v0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

.line 1743
add-int/lit8 v25, v11, 0x20

move-object/from16 v0, p2

move/from16 v1, v25

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

.line 1744
const/16 v25, 0x0

move/from16 v0, v25

move-object/from16 v1, p0

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

.line 1752
:cond_16a
const/16 v36, 0x3

Line 9482

Before:

.line 2490
.end local v9 #e:Landroid/os/RemoteException;
:cond_3ba
const/16 v36, 0xd4

After:

.line 2490
.end local v9 #e:Landroid/os/RemoteException;
:cond_3ba
const/16 v25, 0x4

move/from16 v0, v25

move/from16 v1, v19

if-ne v1, v0, :cond_4b8

.line 1863
move-object/from16 v0, p0

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

move/from16 v25, v0

if-nez v25, :cond_4b8

if-eqz v8, :cond_4b8

if-nez v26, :cond_4b8

.line 1864
move-object/from16 v0, p0

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

move-object/from16 v35, v0

move-object/from16 v0, p0

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

move-object/from16 v36, v0

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

move-result-wide v37

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

.line 1865
const/16 v25, 0x1

move/from16 v0, v25

move-object/from16 v1, p0

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

.line 1875
:cond_4b8
const/16 v36, 0xd4