[MOD] Screen Off/On animations (CRT/Fade) - Galaxy S 4 Themes and Apps

Hi!
Here is the screen Off/On animations mod (GT-I9500).
Since Android 4.2, screen off/on animations were transferred from native to dalvik code. This is the good sign, because it's possible to change effects to whatever you want with enough skills in android programming
Samsung, as always continues to remove some part of code (instead of just use framework's official variable). I've added the missing code (from CM10.1) and some improvements.
The diff is too huge to list the code modification here, so check included zip file. You can diff mod and orig folders from zip to see what you have to change to port my mod to other ROM versions or other devices.
I think, all Samsung devices with Android 4.2 should be very similar to code I've modified.
I've added two system properties to change effect's behavior:
persist.sys.screen_off
persist.sys.screen_on
you can change it using terminal command: setprop
Each of those 2 properties can have following value:
none - instant on or off (like in stock ROM)
crt - Old CRT TV effect
fade - fade-in or fade-out effect.
Some effects can be mixed. For example you can set crt-off and instant-on, or crt-off and fade-in. But not every combination is possible. For example, instant-off will always produce instant-on effect regardless of settings.
Default behavior in my mod:
crt for persist.sys.screen_off
fade for persist.sys.screen_on
ZIP file i've attached has ready to install (through CWM/TWRP) mod for I9500XXUAME1 (deodexed).
It will replace your services.jar file. So, if you have any modifications in this file, you will lost them.
P.S. I won't make mods for any other ROM versions. I've provided enough info in zip file to port it to other ROMs. So, either port it by yourself or wait for someone (not me) to port.
If my post was useful for you, click "thanks" button :good:

sorg said:
Hi!
Here is the screen Off/On animations mod (GT-I9500).
Since Android 4.2, screen off/on animations were transferred from native to dalvik code. This is the good sign, because it's possible to change effects to whatever you want with enough skills in android programming
Samsung, as always continues to remove some part of code (instead of just use framework's official variable). I've added the missing code (from CM10.1) and some improvements.
The diff is too huge to list the code modification here, so check included zip file. You can diff mod and orig folders from zip to see what you have to change to port my mod to other ROM versions or other devices.
I think, all Samsung devices with Android 4.2 should be very similar to code I've modified.
I've added two system properties to change effect's behavior:
persist.sys.screen_off
persist.sys.screen_on
you can change it using terminal command: setprop
Each of those 2 properties can have following value:
none - instant on or off (like in stock ROM)
crt - Old CRT TV effect
fade - fade-in or fade-out effect.
Some effects can be mixed. For example you can set crt-off and instant-on, or crt-off and fade-in. But not every combination is possible. For example, instant-off will always produce instant-on effect regardless of settings.
Default behavior in my mod:
crt for persist.sys.screen_off
fade for persist.sys.screen_on
ZIP file i've attached has ready to install (through CWM/TWRP) mod for I9500XXUAME1.
P.S. I won't make mods for any other ROM versions. I've provided enough info in zip file to port it to other ROMs. So, either port it by yourself or wait for someone (not me) to port.
If my post was useful for you, click "thanks" button :good:
Click to expand...
Click to collapse
As always you are a genius!!!:good:
Just a quick question, will this work with both Odexed and Deodexed ROMs?

deodexed only.

Works in GT-I9505?
Enviado desde mi GT-I9505 usando Tapatalk 2

Thanks...insert your mod in my service.jar and work fine

Great port sorg, does it need any suspend drawing delay on the kernel?

wanam said:
Great port sorg, does it need any suspend drawing delay on the kernel?
Click to expand...
Click to collapse
nope.

wanam said:
Great port sorg, does it need any suspend drawing delay on the kernel?
Click to expand...
Click to collapse
He, Wanam is on it !!
Hope you will port this to your Roms, including S3 !!

I guess this works with the i9505 too?

great mod! Diff file is below if anyone needs it!
PHP:
.super Ljava/lang/Object;
.source "DisplayPowerController.java"
+# interfaces
+.implements Landroid/animation/Animator$AnimatorListener;
+
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
@@ -113,6 +116,14 @@
.field private mElectronBeamFadesConfig:Z
+.field private mElectronBeamOff:I
+
+.field private mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+.field private mElectronBeamOn:I
+
+.field private mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
.field private final mHandler:Lcom/android/server/power/DisplayPowerController$DisplayControllerHandler;
.field private mHighHysteresis:F
@@ -3211,6 +3222,58 @@
goto :goto_1
.end method
+.method static getBeamCfg(Ljava/lang/String;I)I
+ .locals 3
+ .parameter
+ .parameter
+
+ .prologue
+ move v0, p1
+
+ invoke-static {p0}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
+
+ move-result-object v1
+
+ const-string v2, "none"
+
+ invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
+
+ move-result v2
+
+ if-eqz v2, :cond_0
+
+ const v0, 0x0
+
+ return v0
+
+ :cond_0
+ const-string v2, "crt"
+
+ invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
+
+ move-result v2
+
+ if-eqz v2, :cond_1
+
+ const v0, 0x1
+
+ return v0
+
+ :cond_1
+ const-string v2, "fade"
+
+ invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
+
+ move-result v2
+
+ if-eqz v2, :cond_2
+
+ const v0, 0x2
+
+ :cond_2
+ return v0
+.end method
+
.method private getDynamicAutoBrightnessHighHysteresis(F)F
.locals 11
.parameter "cd"
@@ -4408,6 +4471,92 @@
iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+ const v4, 0x2
+
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ sget-object v1, Lcom/android/server/power/DisplayPowerState;->ELECTRON_BEAM_LEVEL:Landroid/util/FloatProperty;
+
+ new-array v2, v4, [F
+
+ fill-array-data v2, :array_0
+
+ invoke-static {v0, v1, v2}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
+
+ move-result-object v0
+
+ iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ .line 6120
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ const-wide/16 v1, 0xfa
+
+ invoke-virtual {v0, v1, v2}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;
+
+ .line 6130
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v0, p0}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
+
+ .line 6150
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ sget-object v1, Lcom/android/server/power/DisplayPowerState;->ELECTRON_BEAM_LEVEL:Landroid/util/FloatProperty;
+
+ new-array v2, v4, [F
+
+ fill-array-data v2, :array_1
+
+ invoke-static {v0, v1, v2}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
+
+ move-result-object v0
+
+ iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ .line 6170
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ const-wide/16 v1, 0x190
+
+ invoke-virtual {v0, v1, v2}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;
+
+ .line 6180
+ iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v0, p0}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
+
+ const-string v2, "persist.sys.screen_off"
+
+ const v3, 0x1
+
+ invoke-static {v2, v3}, Lcom/android/server/power/DisplayPowerController;->getBeamCfg(Ljava/lang/String;I)I
+
+ move-result v4
+
+ iput v4, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
+
+ const-string v2, "persist.sys.screen_on"
+
+ const v3, 0x2
+
+ invoke-static {v2, v3}, Lcom/android/server/power/DisplayPowerController;->getBeamCfg(Ljava/lang/String;I)I
+
+ move-result v2
+
+ const v3, 0x1
+
+ if-ne v3, v2, :cond_0
+
+ const v3, 0x2
+
+ if-ne v3, v4, :cond_0
+
+ move v2, v4
+
+ :cond_0
+ iput v2, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I
+
.line 618
new-instance v0, Lcom/android/server/power/RampAnimator;
@@ -4421,6 +4570,21 @@
.line 620
return-void
+
+ nop
+
+ :array_0
+ .array-data 0x4
+ 0x0t 0x0t 0x0t 0x0t
+ 0x0t 0x0t 0x80t 0x3ft
+ .end array-data
+
+ .line 615
+ :array_1
+ .array-data 0x4
+ 0x0t 0x0t 0x80t 0x3ft
+ 0x0t 0x0t 0x0t 0x0t
+ .end array-data
.end method
.method private isTablet()Z
@@ -7121,7 +7285,15 @@
move-result v6
- if-eqz v6, :cond_1d
+ if-eqz v6, :cond_21
+
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_9
.line 842
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
@@ -7133,6 +7305,18 @@
if-eqz v6, :cond_1c
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
+
+ move-result v6
+
+ const v10, 0x0
+
+ cmpl-float v6, v6, v10
+
+ if-nez v6, :cond_1c
+
.line 844
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->blockScreenOn()V
@@ -7145,6 +7329,22 @@
if-nez v6, :cond_0
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_0
+
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_0
+
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
iget-object v7, p0, Lcom/android/server/power/DisplayPowerController;->mCleanListener:Ljava/lang/Runnable;
@@ -7499,10 +7699,87 @@
:cond_1c
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V
+ .line 7840
+ iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I
+
+ if-nez v10, :cond_1d
+
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ const/high16 v7, 0x3f80
+
+ invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V
+
goto/16 :goto_9
- .line 849
:cond_1d
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_9
+
+ .line 7720
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
+
+ move-result v6
+
+ const/high16 v7, 0x3f80
+
+ cmpl-float v6, v6, v7
+
+ if-nez v6, :cond_1e
+
+ .line 7850
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V
+
+ goto/16 :goto_9
+
+ :cond_1e
+ const v6, 0x2
+
+ if-eq v6, v10, :cond_1f
+
+ const v10, 0x0
+
+ :cond_1f
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z
+
+ move-result v6
+
+ if-eqz v6, :cond_20
+
+ .line 778
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V
+
+ goto/16 :goto_9
+
+ .line 780
+ :cond_20
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V
+
+ goto/16 :goto_9
+
+ .line 849
+ :cond_21
+ iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
+
+ if-nez v10, :cond_22
+
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
.line 851
@@ -7517,6 +7794,76 @@
goto/16 :goto_9
+ :cond_22
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_9
+
+ .line 7930
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
+
+ move-result v6
+
+ if-nez v6, :cond_9
+
+ .line 7940
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
+
+ move-result v6
+
+ const v10, 0x0
+
+ cmpl-float v6, v6, v10
+
+ if-nez v6, :cond_23
+
+ invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
+
+ goto/16 :goto_9
+
+ .line 7960
+ :cond_23
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
+
+ invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z
+
+ move-result v6
+
+ if-eqz v6, :cond_24
+
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
+
+ invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->isScreenOn()Z
+
+ move-result v6
+
+ if-eqz v6, :cond_24
+
+ .line 8010
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V
+
+ goto/16 :goto_9
+
+ .line 8030
+ :cond_24
+ iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
+
+ invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V
+
+ goto/16 :goto_9
+
.line 936
:catchall_1
move-exception v6
@@ -7936,6 +8283,40 @@
const/4 v0, 0x0
goto :goto_0
+.end method
+
+.method public onAnimationCancel(Landroid/animation/Animator;)V
+ .locals 0
+ .parameter "animation"
+
+ .prologue
+ return-void
+.end method
+
+.method public onAnimationEnd(Landroid/animation/Animator;)V
+ .locals 0
+ .parameter "animation"
+
+ .prologue
+ invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendUpdatePowerState()V
+
+ return-void
+.end method
+
+.method public onAnimationRepeat(Landroid/animation/Animator;)V
+ .locals 0
+ .parameter "animation"
+
+ .prologue
+ return-void
+.end method
+
+.method public onAnimationStart(Landroid/animation/Animator;)V
+ .locals 0
+ .parameter "animation"
+
+ .prologue
+ return-void
.end method
.method public requestPowerState(Lcom/android/server/power/DisplayPowerRequest;ZZ)Z

Sweet ! I'll take it !

Thank you very much! This is great!
Sent from my GT-I9500 using xda premium

just flashed it on WanamLite v1.2 XXUAME1: phone boots, updating apps..., screen goes off and remains off, no way to use it anymore, good thing i have made a backup before flashing

maranello69 said:
just flashed it on WanamLite v1.2 XXUAME1: phone boots, updating apps..., screen goes off and remains off, no way to use it anymore, good thing i have made a backup before flashing
Click to expand...
Click to collapse
Try this.

yep, all good now, fade in and crt-off effects are working
but there's a small delay after pressing the power button until the crt animation starts, like 0.5 s, on s3 the effect is instant

You are a magic Sorg! Again you save CRT from Samy's hands
Enviado de meu GT-I9505 usando o Tapatalk 2
---------- Post added at 12:22 PM ---------- Previous post was at 12:19 PM ----------
For Wanam and other Guys:
Do you have problems reodexing frameworks on S4 or this is only for me?
Enviado de meu GT-I9505 usando o Tapatalk 2

Thanks dude! Now some kind soul makes one for 9505 also <3

Any possibility to make one for s3 with leaked 4.2.2 rom
Sent from my GT-I9300 using xda premium

julian_fin said:
Thanks dude! Now some kind soul makes one for 9505 also <3
Click to expand...
Click to collapse
I am interested, too

wanam said:
Try this.
Click to expand...
Click to collapse
Works flawlessly ,thanks :thumbup:

Related

[HOWTO] New Hot Reboot Command!!!!

Hi,
"Hot Reboot" does not work currently.
I learned from the next person.
His name is "cielavenir "
Learned this command from someone he also.
Code:
# setprop ctl.restart zygote
The results similar to "Hot Reboot" By performing the above commands.
Our aim is to incorporate the above command to "APM".
I was able to incorporate it.
The following is a "Hot Reboot" until now.
Code:
# virtual methods
.method public onPress()V
.locals 6
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v3
[COLOR="Silver"]const/4 v4, 0x4
new-array v0, v4, [Ljava/lang/String;
const/4 v4, 0x0
const-string v5, "pkill"
aput-object v5, v0, v4
const/4 v4, 0x1
const-string v5, "-TERM"
aput-object v5, v0, v4
const/4 v4, 0x2
const-string v5, "-f"
aput-object v5, v0, v4
const/4 v4, 0x3
const-string v5, "system_server"
aput-object v5, v0, v4
[/COLOR]
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v2
:goto_0
return-void
:catch_0
move-exception v1
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_0
.end method
Changed as follows.
Code:
# virtual methods
.method public onPress()V
.locals 6
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v3
[COLOR="Red"]const/4 v4, 0x3
new-array v0, v4, [Ljava/lang/String;
const/4 v4, 0x0
const-string v5, "setprop"
aput-object v5, v0, v4
const/4 v4, 0x1
const-string v5, "ctl.restart"
aput-object v5, v0, v4
const/4 v4, 0x2
const-string v5, "zygote"
aput-object v5, v0, v4
[/COLOR]
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v2
:goto_0
return-void
:catch_0
move-exception v1
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_0
.end method
New "Hot Reboot" works normally!!
I also can "Safe Mode" also operate similarly.
The following is a "Safe Mode" until now.
Code:
.class Lcom/android/internal/policy/impl/GlobalActions$22;
.super Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.source "GlobalActions.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/htc/widget/HtcAlertDialog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
.locals 0
iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
invoke-direct {p0, p2, p3, p4}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>(III)V
return-void
.end method
# virtual methods
.method public onPress()V
.locals 3
const-string v0, "ADVANCED POWER MENU"
const-string v1, "Safe mode"
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$1000(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
move-result-object v0
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->rebootSafeMode()V
const-string v0, "ADVANCED POWER MENU"
const-string v1, "Safe mode end"
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
.method public showBeforeProvisioning()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
.method public showDuringKeyguard()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
Changed as follows.
Code:
.class Lcom/android/internal/policy/impl/GlobalActions$22;
.super Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.source "GlobalActions.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/htc/widget/HtcAlertDialog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
.locals 0
iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
invoke-direct {p0, p2, p3, p4}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>(III)V
return-void
.end method
# virtual methods
.method public onPress()V
.locals 6
[COLOR="Red"]const-string v2, "persist.sys.safemode"
const-string v3, "1"
invoke-static {v2, v3}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v3
const/4 v4, 0x3
new-array v0, v4, [Ljava/lang/String;
const/4 v4, 0x0
const-string v5, "setprop"
aput-object v5, v0, v4
const/4 v4, 0x1
const-string v5, "ctl.restart"
aput-object v5, v0, v4
const/4 v4, 0x2
const-string v5, "zygote"
aput-object v5, v0, v4[/COLOR]
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v2
:goto_0
return-void
:catch_0
move-exception v1
invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
goto :goto_0
.end method
.method public showBeforeProvisioning()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
.method public showDuringKeyguard()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
You can also use the following command.
Hot Reboot
Code:
adb shell su -c setprop ctl.restart zygote
Safe Mode
Code:
adb shell su -c setprop persist.sys.safemode 1
adb shell su -c setprop ctl.restart zygote
Thank you!!
pertamax..
good job.. broo..
:good:
belantara said:
pertamax..
good job.. broo..
:good:
Click to expand...
Click to collapse
So flash this and we will be able to hot reboot when shutting the phone
Sent from my HTC Butterfly using xda premium

[Q] [SMALI] Hide statusbar audio profile icon

Hi everyone!
I have a 4.4.2 AOSP-based ROM which has always showed the audio profile when in normal/general mode. It bugged me a bit but never found an easy approach as to how to remove it.
As a personal challenge and now that I could spare some free time, I decompiled SystemUI.apk and proceed to edit the PhoneStatusBarPolicy.smali file where the audio icons are set. After a hard time understanding the nasty Smali, now it does not show the normal profile icon while still showing the silent, vibrate and outdoor icons when selected. :good:
The problem is that, when restarting SystemUI.apk or rebooting the phone, it will show the normal profile icon again. After I change to another profile and go back, it disappears and behaves as it should. So restarting is restoring the icon visibility somehow :crying:
I commented the lines for "setIcon" in the updateProfile() method of the same .smali file and the icon then does NOT appear at startup (nor any profile icon), which means that the very same function that makes it disappear when switching, is making it appear at the start.
So the answer lies there but no matter how hard I try I do not find what is the difference between startup and switching the profile mode. It must be either the method initializes with that visibility by default and then it loops when running, or an external input is making it
Here it is the method that sets the icons (with my edit in blue, at the end):
Code:
.method private final updateProfile()V
.locals 10
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 142
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const-string v8, "audio"
invoke-virtual {v7, v8}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/media/AudioManager;
.line 143
.local v1, "audioManager":Landroid/media/AudioManager;
invoke-virtual {v1}, Landroid/media/AudioManager;->getRingerMode()I
move-result v4
.line 145
.local v4, "ringerMode":I
if-eqz v4, :cond_0
if-eq v4, v5, :cond_0
const/4 v7, 0x2
if-ne v4, v7, :cond_2
.line 147
.local v5, "visible":Z
:cond_0
:goto_0
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mProfileManager:Lcom/mediatek/audioprofile/AudioProfileManager;
invoke-virtual {v7}, Lcom/mediatek/audioprofile/AudioProfileManager;->getActiveProfileKey()Ljava/lang/String;
move-result-object v0
.line 149
.local v0, "activeProfileKey":Ljava/lang/String;
const/4 v2, 0x0
.line 150
.local v2, "contentDescription":Ljava/lang/String;
const-string v7, "zcl"
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
const-string v9, "ringerMode:"
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v8
invoke-virtual {v8, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v8
const-string v9, "visible:"
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v8
invoke-virtual {v8, v5}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v8
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v8
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 151
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mProfileManager:Lcom/mediatek/audioprofile/AudioProfileManager;
sget-object v7, Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;->SILENT:Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;
invoke-static {v7}, Lcom/mediatek/audioprofile/AudioProfileManager;->getProfileKey(Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;)Ljava/lang/String;
move-result-object v7
invoke-virtual {v7, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_3
.line 152
const v3, 0x7f020164
.line 153
.local v3, "iconsId":I
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v8, 0x7f0b00c1
invoke-virtual {v7, v8}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v2
.line 164
:goto_1
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v8, "volume"
invoke-virtual {v7, v8, v3, v6, v2}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
.line 165
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
if-eq v5, v6, :cond_1
.line 166
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v7, "volume"
invoke-virtual {v6, v7, v5}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 167
iput-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
.line 170
:cond_1
return-void
.end local v0 # "activeProfileKey":Ljava/lang/String;
.end local v2 # "contentDescription":Ljava/lang/String;
.end local v3 # "iconsId":I
.end local v5 # "visible":Z
:cond_2
move v5, v6
.line 145
goto :goto_0
.line 154
.restart local v0 # "activeProfileKey":Ljava/lang/String;
.restart local v2 # "contentDescription":Ljava/lang/String;
.restart local v5 # "visible":Z
:cond_3
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mProfileManager:Lcom/mediatek/audioprofile/AudioProfileManager;
sget-object v7, Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;->MEETING:Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;
invoke-static {v7}, Lcom/mediatek/audioprofile/AudioProfileManager;->getProfileKey(Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;)Ljava/lang/String;
move-result-object v7
invoke-virtual {v7, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_4
.line 155
const v3, 0x7f020165
.line 156
.restart local v3 # "iconsId":I
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v8, 0x7f0b00c0
invoke-virtual {v7, v8}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v2
goto :goto_1
.line 157
.end local v3 # "iconsId":I
:cond_4
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mProfileManager:Lcom/mediatek/audioprofile/AudioProfileManager;
sget-object v7, Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;->OUTDOOR:Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;
invoke-static {v7}, Lcom/mediatek/audioprofile/AudioProfileManager;->getProfileKey(Lcom/mediatek/audioprofile/AudioProfileManager$Scenario;)Ljava/lang/String;
move-result-object v7
invoke-virtual {v7, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_5
.line 158
const v3, 0x7f020163
.restart local v3 # "iconsId":I
goto :goto_1
.line 161
.end local v3 # "iconsId":I
:cond_5
[COLOR="Blue"]move v5, v6[/COLOR]
const v3, 0x7f020162
.restart local v3 # "iconsId":I
goto :goto_1
.end method
There are a couple of lines above the method where the silence icon is handled. Also there is another method below in the file called updateVolume which changes the icons too. Though when uncommented they did not trigger the icon to appear at startup, so I am assuming the cause is not there. I will attach the .smali file also.
I really would like to complete this mod, I have done some further testing but it is too tiresome to test the .apk whenever I change a line of code. Also I am a noobie with all this so I do not want to screw it up. If someone is familliar with these kind of things, I will appreciate any help I can get! :fingers-crossed:
PD: If someone has a deodexed 4.4.x AOSP not showing the icon and be nice to share the SystemUI.apk, I could hopefully adapt it to my needs.
Here you can dw the file:
https://www.dropbox.com/s/jqnl7s3p3up9ysg/PhoneStatusBarPolicy_original.smali?dl=0
OK, I got it eventually. I noticed "setIcon" was called before even checking the current visibility status for the current profile (a troll developer?). Thus I edited it so that the call is made after checking.
Before editing, notice the setIcon call before if-eq v5, v6:
Code:
:goto_1
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v8, "volume"
invoke-virtual {v7, v8, v3, v6, v2}, Landroid/app/StatusBarManager;->[COLOR="Red"]setIcon[/COLOR](Ljava/lang/String;IILjava/lang/String;)V
.line 165
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
[COLOR="Red"] if-eq v5, v6[/COLOR], :cond_1
.line 166
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v7, "volume"
invoke-virtual {v6, v7, v5}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 167
iput-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
.line 170
:cond_1
return-void
.end local v0 # "activeProfileKey":Ljava/lang/String;
.end local v2 # "contentDescription":Ljava/lang/String;
.end local v3 # "iconsId":I
.end local v5 # "visible":Z
After editing, I made a new condition to skip the setIcon call in case the visibility variable (v5) is equal to false.
Code:
:goto_1
[COLOR="Blue"]if-eqz v5, :cond_6[/COLOR]
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v8, "volume"
invoke-virtual {v7, v8, v3, v6, v2}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
.line 165
[COLOR="Blue"]:cond_6[/COLOR]
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
if-eq v5, v6, :cond_1
.line 166
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v7, "volume"
invoke-virtual {v6, v7, v5}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 167
iput-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
.line 170
:cond_1
return-void
.end local v0 # "activeProfileKey":Ljava/lang/String;
.end local v2 # "contentDescription":Ljava/lang/String;
.end local v3 # "iconsId":I
.end local v5 # "visible":Z
So it works, though I wish I knew exactly what is happening in the code. The getRingerMode call should return 0, 1 or 2 for silence, vibrate and normal respectively (https://developer.android.com/reference/android/media/AudioManager.html#getRingerMode()), but my phone has also the outdoor mode, so I suspect the returned values are different.
Anyway, I'm happy I could get this done and learn how to customize this!

[Guide] Adding OminiSwitch Recent Panal

Hello guys
Here is a new guide that help you to add ominiSwitch Recent Panal on your device
Before doing this make sure you have done this.
[This guide is only for Android 5.0+]
Credit:-
KachalkinGeorg (The GK)
Reuirement (Deodexed):-
1.Settings.apk
2.SystemUI.apk
3.framework.jar
4.NotePad++
5.Patience.. if you dont have try to get it
First part ( Settings.apk )
1.Decompile Settings.apk
2.Download ominisettings.zip from attachment. Extract and copy files to your decompiled Settings
3.Open Settings\res\xml\gk_recents_panel.xml
add
Code:
<PreferenceCategory android:title="@string/recents_panel_other">
<PreferenceScreen android:title="@string/omniswitch_settings_title" android:fragment="com.android.settings.gk.RecentsPanel.OmniSwitch" />
</PreferenceCategory>
4.Open Settings\res\values\strings.xml
add
Code:
<string name="recents_panel_other">Other Recents</string>
<string name="omniswitch_settings_title">OmniSwitch</string>
<string name="recents_use_omniswitch_title">Use for recents</string>
<string name="recents_use_omniswitch_summary">Use OmniSwitch instead of default recents view</string>
<string name="omniswitch_start_settings_title">Settings</string>
<string name="omniswitch_start_settings_summary">Open OmniSwitch settings</string>
<string name="omniswitch_first_time_title">Information</string>
<string name="omniswitch_first_time_message">Make sure you have enabled OmniSwitch. You can do this by using \"Settings\" below</string>
5.Recompile and Decompile Settings (For id's)
6.Open Settings\smali\com\android\settings\gk\RecentsPanel\OmniSwitch.smali
find
Code:
0x7f090427
replace with below id
Code:
<public type="string" name="omniswitch_first_time_title"
find
Code:
0x7f090428
replace with below id
Code:
<public type="string" name="omniswitch_first_time_message"
find
Code:
0x7f060067
replace with below id
Code:
<public type="xml" name="gk_recents_omniswitch"
7.Recompile Settings and move to your device
Continued on next post
Continued.
Second Part ( SystemUI.apk )
1.Decompile SystemUI.apk
2.Open SystemUI\smali\com\android\systemui\statusbar\BaseStatusBar.smali
find below method
Code:
.method static sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
After the end of the previous method, add this
Code:
.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
Code:
.method protected cancelPreloadingRecents()V
replace whole method with this
Code:
.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
Code:
.method protected hideRecents(ZZ)V
replace whole method with this
Code:
.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
Code:
.method protected preloadRecents()V
replace whole method
Code:
.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
Code:
.method protected showRecents(Z)V
replace whole method with this
Code:
.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
Code:
.method protected showRecentsNextAffiliatedTask()V
replace whole method with this
Code:
.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
Code:
.method protected showRecentsPreviousAffiliatedTask()V
replace whole method with this
Code:
.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
Code:
.method protected toggleRecents()V
replace whole method with this
Code:
.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
Continued.
Final part ( framework.jar )
1.Decompile framework.jar
2.Download ominiframework.zip from attachment. Extract and copy files to decompiled framework
3.Open framework.jar\smali\android\provider\Settings$System.smali
find
Code:
.field public static final RECENTS_SHOW_SEARCH_BAR:Ljava/lang/String; = "recents_show_search_bar"
below add a new field
Code:
.field public static final RECENTS_USE_OMNISWITCH:Ljava/lang/String; = "recents_use_omniswitch"
4.Recompile framework and move to your device
Now download Omini_System.zip and flash using any custom recovery.
Enjoy...
Screenshots:-

Can i delete boot.art and boot.oat?

Problem 1
I use s7 G930L rom stock.I see boot.art,boot.oat in system/framework/arm64 and i not it in rom cook. Can I delete it?
Problem 2
I mod add advance power menu to rom stock in thead
How to Advance Power Menu on Marshmallow 6.0.1
Decompile Service.jar /smali/com/android/server/policy/GlobalActions.smali
Open notepad++
Search for this line
Code:
new-instance v5, Lcom/android/server/policy/GlobalActions$9
Code:
new-instance v5, Lcom/android/server/policy/GlobalActions$9; Change it to 99
sget-boolean v4, Lcom/android/server/policy/GlobalActions;->mNewFeatureForM:Z
if-eqz v4, :cond_7
const v4, 0x108095f Remember this numbers or what numbers gonna be here
:goto_4
const v6, 0x10408cf
move-object/from16 v0, p0
invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$9;-><init>(Lcom/android/server/policy/GlobalActions;II)V change it to 99
Search for this line
Code:
iput v1, p0, Lcom/android/server/policy/GlobalActions;->mConfirmPowerOffIconResId:I OR Search 108095f
Delete only the red line then SAVE
Code:
iput v1, p0, Lcom/android/server/policy/GlobalActions;->mConfirmPowerOffIconResId:I
const v1, 0x108095f
iput v1, p0, Lcom/android/server/policy/GlobalActions;->mRestartIconResId:I
const v1, 0x1080960
iput v1, p0, Lcom/android/server/policy/GlobalActions;->mConfirmRestartIconResId:I
const v1, 0x108095c
iput v1, p0, Lcom/android/server/policy/GlobalActions;->mEmergencyIconResId:I
Open /smali/com/android/server/policy/ GlobalActions$SinglePressAction and add the blue lines
Code:
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/server/policy/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# static fields
.field public static rebootMode:I
.field public static final rebootOptions:[Ljava/lang/String;
.field public static final rebootString:[Ljava/lang/String;
# instance fields
and then
Code:
# direct methods
.method static constructor <clinit>()V
.registers 9
const/4 v8, 0x5
const/4 v7, 0x4
const/4 v6, 0x3
const/4 v5, 0x2
const/4 v4, 0x1
const/4 v3, 0x0
new-array v0, v8, [Ljava/lang/String;
const-string/jumbo v2, "Reboot"
aput-object v2, v0, v3
const-string/jumbo v2, "Hot Reboot"
aput-object v2, v0, v4
const-string/jumbo v2, "Download"
aput-object v2, v0, v5
const-string/jumbo v2, "Recovery"
aput-object v2, v0, v6
const-string/jumbo v2, "Safe Mode"
aput-object v2, v0, v7
sput-object v0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootString:[Ljava/lang/String;
new-array v1, v8, [Ljava/lang/String;
const-string v2, "Reboot"
aput-object v2, v1, v3
const-string v2, "Hot Reboot"
aput-object v2, v1, v4
const-string v2, "Download"
aput-object v2, v1, v5
const-string v2, "Recovery"
aput-object v2, v1, v6
const-string v2, "Safe Mode"
aput-object v2, v1, v7
sput-object v1, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
.method protected constructor <init>(II)V
Download attached smalis (Smali_MM.zip) and paste it in services.jar\smali\com\android\server\policy folder
To change power menu title GlobalActions$99, find const-string v2, "Advanced Power Menu" and change to what you want.
Click to expand...
Click to collapse
And it not working. How to add advance power menu on s7.
Sorry my English

[HELP] How to enable touchwiz page transitions effect (Select in Display Settings)

This mod is an adaptation for ROMs that does not have RomControl. Link of the original topic at the end of the post.
First I made the modification on TouchwizHome this way:
Go to: Touhcwizhome_2016\smali\com\android\launcher2\PagedView.smali
Find this line:
Code:
.method public setDefaultTransitionEffect(Lcom/android/launcher2/PagedView$TransitionEffect;)V
It replaces the complete method with this here:
Code:
.method public setDefaultTransitionEffect(Lcom/android/launcher2/PagedView$TransitionEffect;)V
.locals 4
.param p1, "transitionEffect" # Lcom/android/launcher2/PagedView$TransitionEffect;
.prologue
.line 3487
invoke-virtual {p0}, Lcom/android/launcher2/PagedView;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "tw_page_effect"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7
if-eq v1, v2, :cond_6
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->CARD:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_0
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->NONE:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_1
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->CASCADE:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_2
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->OUTERCUBE:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_3
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->INNERCUBE:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_4
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->CAROUSAL:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_5
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->PLAIN:Lcom/android/launcher2/PagedView$TransitionEffect;
goto :goto_0
:cond_6
sget-object v0, Lcom/android/launcher2/PagedView$TransitionEffect;->CONVEYOR:Lcom/android/launcher2/PagedView$TransitionEffect;
:goto_0
iput-object v0, p0, Lcom/android/launcher2/PagedView;->mDefaultTransitionEffect:Lcom/android/launcher2/PagedView$TransitionEffect;
iput-object v0, p0, Lcom/android/launcher2/PagedView;->mCurrentTransitionEffect:Lcom/android/launcher2/PagedView$TransitionEffect;
.line 3488
return-void
.end method
Okay, I've recompiled.
Now I have to make the modification in SecSettings2 (In the original guide, it stays in the RomControl)
Go to: SecSettings\res\values\strings.xml add the text below at the end (before /resources)
Code:
<string-array name="tw_effect_entries">
<item>None</item>
<item>Cascade</item>
<item>Outer cube</item>
<item>Inner Cube</item>
<item>Carousal</item>
<item>Plain</item>
<item>Conveyor</item>
<item>Card</item>
</string-array>
<string-array name="tw_effect_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</string-array>
Go to: SecSettings\res\xml\display_settings.xml and add this text in the end, before </ PreferenceScreen>:
Code:
ListPreference android:entries="@array/tw_effect_entries" android:title="Touchwiz Transition Effect" android:key="tw_page_effect" android:defaultValue="1" android:entryValues="@array/tw_effect_values" />
After that, I recompiled. The option appears in Settings> Display. But even selecting one of the effects did not work. I need help to finish this mod. Please help me!
Below, the link to the original guide using RomControl. Credits to @tamirda
How to enable Touchwiz Page Transition effects

Categories

Resources