[Android General] Abdullaharis:
Continued.

Second Part

( SystemUI.apk )

1.Decompile SystemUI.apk

2.Open SystemUI\smali\com\android\systemui\statusbar\BaseStatusBar.smali

find below method

.method static sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V

After the end of the previous method, add this

.method private isOmniSwitchEnabled()Z
.locals 6

.prologue
const/4 v1, 0x1

const/4 v2, 0x0

.line 1196
iget-object v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v3

const-string v4, "recents_use_omniswitch"

const/4 v5, -0x2

invoke-static {v3, v4, v2, v5}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I

move-result v0

.line 1199
.local v0, "settingsValue":I
if-ne v0, v1, :cond_0

:goto_0
return v1

:cond_0
move v1, v2

goto :goto_0
.end method

find

.method protected cancelPreloadingRecents()V

replace whole method with this

.method protected cancelPreloadingRecents()V
.locals 1

.prologue
.line 1246
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v0

if-nez v0, :cond_0

.line 1247
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v0, :cond_0

.line 1248
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->cancelPreloadingRecents()V

.line 1251
:cond_0
return-void
.end method

find

.method protected hideRecents(ZZ)V

replace whole method with this

.method protected hideRecents(ZZ)V
.locals 3
.param p1, "triggeredFromAltTab" # Z
.param p2, "triggeredFromHomeKey" # Z

.prologue
.line 1215
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v1

if-eqz v1, :cond_1

.line 1216
new-instance v0, Landroid/content/Intent;

const-string v1, "org.omnirom.omniswitch.ACTION_HIDE_OVERLAY"

invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 1217
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V

.line 1223
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void

.line 1219
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v1, :cond_0

.line 1220
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-interface {v1, p1, p2}, Lcom/android/systemui/RecentsComponent;->hideRecents(ZZ)V

goto :goto_0
.end method

find

.method protected preloadRecents()V

replace whole method

.method protected preloadRecents()V
.locals 1

.prologue
.line 1238
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v0

if-nez v0, :cond_0

.line 1239
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v0, :cond_0

.line 1240
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->preloadRecents()V

.line 1243
:cond_0
return-void
.end method

find

.method protected showRecents(Z)V

replace whole method with this

.method protected showRecents(Z)V
.locals 3
.param p1, "triggeredFromAltTab" # Z

.prologue
.line 1203
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v1

if-eqz v1, :cond_1

.line 1204
new-instance v0, Landroid/content/Intent;

const-string v1, "org.omnirom.omniswitch.ACTION_SHOW_OVERLAY"

invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 1205
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V

.line 1212
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void

.line 1207
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v1, :cond_0

.line 1208
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

const-string v2, "recentapps"

invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V

.line 1209
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;

move-result-object v2

invoke-interface {v1, p1, v2}, Lcom/android/systemui/RecentsComponent;->showRecents(ZLandroid/view/View;)V

goto :goto_0
.end method

find

.method protected showRecentsNextAffiliatedTask()V

replace whole method with this

.method protected showRecentsNextAffiliatedTask()V
.locals 1

.prologue
.line 1254
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v0

if-nez v0, :cond_0

.line 1255
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v0, :cond_0

.line 1256
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showNextAffiliatedTask()V

.line 1259
:cond_0
return-void
.end method

find

.method protected showRecentsPreviousAffiliatedTask()V

replace whole method with this

.method protected showRecentsPreviousAffiliatedTask()V
.locals 1

.prologue
.line 1262
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v0

if-nez v0, :cond_0

.line 1263
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v0, :cond_0

.line 1264
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showPrevAffiliatedTask()V

.line 1267
:cond_0
return-void
.end method

find

.method protected toggleRecents()V

replace whole method with this

.method protected toggleRecents()V
.locals 5

.prologue
.line 1226
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z

move-result v1

if-eqz v1, :cond_1

.line 1227
new-instance v0, Landroid/content/Intent;

const-string v1, "org.omnirom.omniswitch.ACTION_TOGGLE_OVERLAY"

invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 1228
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V

.line 1235
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void

.line 1230
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

if-eqz v1, :cond_0

.line 1231
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

const-string v2, "recentapps"

invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V

.line 1232
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;

iget-object v2, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mDisplay:Landroid/view/Display;

iget v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mLayoutDirection:I

invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;

move-result-object v4

invoke-interface {v1, v2, v3, v4}, Lcom/android/systemui/RecentsComponent;->toggleRecents(Landroid/view/Display;ILandroid/view/View;)V

goto :goto_0
.end method

3.Recompile SystemUI and move to your device

Continued on next post