[Camera] [Mod] Armani + power button focusing + video recording - Captivate Q&A, Help & Troubleshooting

Time for a big update to this post.
The andromeda roms have now a camera that not only uses the power button for taking stills, but also for video recording.
More interestingly, the power button in still images function now as the grey button on the display, i.e., one quick press takes a still as is, while a long press focuses until the key is released, and then takes the still.
The second mod required a change in android.policy.jar to prevent the power button long press to bring the power menu up. Thus, it will only work in the andromeda rom unless other rom developers decide to implement the change also.
You can find the diffs between the original armani camera app and this one attached here. For the actual app, please take a look at the andromeda page for the reason stated above.
I will explain the changes in posts below (20-23) so I don't clutter this one too much.
GlobalActions.smali is part of android.policy.jar, while the other three belong to the camera app.
BTW: This does not belong any more to Q&A. Dear Mods, would you please move the thread to a more suitable forum (apps or dev)?

+1, how do I do this?

subscribed...

Same here... Any rom removes this?

subscribed... really, that is annoying...

If this helps in the search:
I installed dropbox, and noticed that dropbox now shows as one of the upload options. This suggests (to me) that there is a configuration file or database entry somewhere where this was added.
If we can find out where, there is a possibility of just removing the lockbox entry.
I doubt that its built into the app, they would want to sell this to different providers, and each will have (or not) its own version of the AT&T lockbox.
I did spend an hour or so this morning perusing databases, but didn't find anything.

PhilipPeake said:
If this helps in the search:
I installed dropbox, and noticed that dropbox now shows as one of the upload options. This suggests (to me) that there is a configuration file or database entry somewhere where this was added.
If we can find out where, there is a possibility of just removing the lockbox entry.
I doubt that its built into the app, they would want to sell this to different providers, and each will have (or not) its own version of the AT&T lockbox.
I did spend an hour or so this morning perusing databases, but didn't find anything.
Click to expand...
Click to collapse
Lol! I almost forgot about this thread already! So many roms now and I always saw that button that I learned to be careful
I just decompiled it and this is what I found:
Code:
$:~/android/apk_manager/out$ grep -i -r -n 'locker' *
res/values/strings.xml:271: <string name="menu_qsend">Send to Online Locker</string>
smali/com/sec/android/app/camera/ReviewImage.smali:2346:.method public onSendToOnlineLocker()V
smali/com/sec/android/app/camera/ReviewImage$9.smali:57: invoke-virtual {v0}, Lcom/sec/android/app/camera/ReviewImage;->onSendToOnlineLocker()V
$:~/android/apk_manager/out$ grep -i -r -n 'menu_qsend' *
res/values-it/strings.xml:261: <string name="menu_qsend">Invia a Armadietto online</string>
res/values-de/strings.xml:261: <string name="menu_qsend">Senden an Online-Schließfach</string>
res/values/public.xml:1563: <public type="string" name="menu_qsend" id="0x7f07010c" />
res/values/strings.xml:271: <string name="menu_qsend">Send to Online Locker</string>
res/values-fr/strings.xml:261: <string name="menu_qsend">Envoyer à Casier en ligne</string>
res/values-es/strings.xml:261: <string name="menu_qsend">Enviar a Bloqueo en línea</string>
res/values-ko/strings.xml:261: <string name="menu_qsend">온라인 보관함으로 전송</string>
smali/com/sec/android/app/camera/R$string.smali:506:.field public static final menu_qsend:I = 0x7f07010c
I'll dig a little more into it

PhilipPeake said:
If this helps in the search:
I installed dropbox, and noticed that dropbox now shows as one of the upload options. This suggests (to me) that there is a configuration file or database entry somewhere where this was added.
If we can find out where, there is a possibility of just removing the lockbox entry.
I doubt that its built into the app, they would want to sell this to different providers, and each will have (or not) its own version of the AT&T lockbox.
I did spend an hour or so this morning perusing databases, but didn't find anything.
Click to expand...
Click to collapse
You made me look again into this
Check the first post

aleadam said:
You made me look again into this
Check the first post
Click to expand...
Click to collapse
On JPY, the Video says "Camera Failed" and exits the app. Pictures work fine.
EDIT: The stock camera app is doing that too... so it's not a problem with this.

MikeyMike01 said:
On JPY, the Video says "Camera Failed" and exits the app. Pictures work fine.
EDIT: The stock camera app is doing that too... so it's not a problem with this.
Click to expand...
Click to collapse
I don't think it's a jpy problem. I just tested on Doc's rom and the video works fine. On glitterballs kernel in case it's important.

So what makes this different from the other modded camera.apk?

moosefist said:
So what makes this different from the other modded camera.apk?
Click to expand...
Click to collapse
I thought it was quite clear from the title
When reviewing the images, you don't have to click on more->delete to delete a picture. It's just there. More important, you don't have the option for at&t online locker above delete. Too many times I clicked on that (fat thumbs, maybe?) instead of the delete button.
It is just a minimal mod, for the few of us that hate the online locker. Nothing more.

The Camera app in JPY is (in some stupid way) reliant on the Email.apk, which I had removed.
Got that squared away, and now it's working.

MikeyMike01 said:
The Camera app in JPY is (in some stupid way) reliant on the Email.apk, which I had removed.
Got that squared away, and now it's working.
Click to expand...
Click to collapse
Well, that should be obvious... how do you plan to take a picture without a proper email application?????

I'm getting FC's on the stock I-9000 froyo rom with Setiron's kernel after installing through cwm

vaiol123 said:
I'm getting FC's on the stock I-9000 froyo rom with Setiron's kernel after installing through cwm
Click to expand...
Click to collapse
If you're using an sgs i9000 then I would suggest you to use the original apk from fr4gg0r. This one is for captivates so you don't get FFC references and avoid at&t crap.

Oh yeah what I meant was I am using an i9000 rom on a cappy and wanted to get rid of ffc references but it would just fc haha. I can live with it though

vaiol123 said:
I'm getting FC's on the stock I-9000 froyo rom with Setiron's kernel after installing through cwm
Click to expand...
Click to collapse
Sorry I didn't check this thread in a while. With a stock i9000 rom I would try an i9000 camera.apk, like the one in the original thread from fr4gg0r
I can't say much without a logcat to know where is the error.

New Camera.apk that does respond to the home button after pressing the power button. It's a dirty trick so haptic feedback won't work on it.
EDIT: Now video recording should also keep working with a low battery.

Diff explanations
Let's start with the camera:
Code:
diff -ru armani_Camera/Camera/smali/com/sec/android/app/camera/Camera.smali new_Camera/Camera/smali/com/sec/android/app/camera/Camera.smali
--- armani_Camera/Camera/smali/com/sec/android/app/camera/Camera.smali 2011-02-09 23:53:00.459447001 -0500
+++ new_Camera/Camera/smali/com/sec/android/app/camera/Camera.smali 2011-02-09 23:52:27.407447002 -0500
Nothing new in this part, just to make it keep working when the battery is very low
Code:
@@ -588,9 +588,6 @@
if-eq v3, v8, :cond_0
- .line 1665
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->handleLowBattery()V
-
.line 1668
:cond_0
if-eq v1, v8, :cond_1
This is at the very beginning of the onKeyDown method and is the hack to fix the issue with the home button not responding after pressing the power button. As I said in the other thread, I don't think this is the real solution but it works well enough for now.
Code:
@@ -7641,6 +7638,42 @@
.prologue
const/4 v4, 0x1
+ const/16 v1, 0x3
+
+ if-ne p1, v1, :cond_0
+
+ new-instance v0, Landroid/content/Intent;
+
+ const-string v1, "android.intent.action.MAIN"
+
+ invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
+
+ .local v0, startMain:Landroid/content/Intent;
+ const-string v1, "android.intent.category.HOME"
+
+ invoke-virtual {v0, v1}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
+
+ const/high16 v1, 0x1000
+
+ invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
+
+ invoke-virtual {p0, v0}, Lcom/sec/android/app/camera/Camera;->startActivity(Landroid/content/Intent;)V
+
Now we're talking! This little piece here adds a new global setting, named "camera_in_use" that I made it be either 0 (not in use) or 1 (in use). As soon as the power key is pressed, this setting becomes 1. This is the int that will be read by android.policy.jar. We could use this idea to prevent android.policy.jar to respond to the power key altogether to solve the issue above, but I did not look into it yet.
Code:
+ .line 593
+ :cond_0
+ invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getApplicationContext()Landroid/content/Context;
+
+ move-result-object v0
+
+ invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
+
+ move-result-object v0
+
+ .line 594
+ const-string v2, "camera_in_use"
+
+ invoke-static {v0, v2, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
+
const-string v3, "Camera"
.line 595
I removed all the garbage here, to focus on the switch part. By making it jump to :sswitch_2 instead of _sswitch_0 i force it to evaluate it as a camera button.
Code:
@@ -7930,32 +7963,34 @@
:sswitch_data_0
.sparse-switch
0x4 -> :sswitch_0
0x17 -> :sswitch_2
0x18 -> :sswitch_3
0x19 -> :sswitch_3
- 0x1a -> :sswitch_0
+ 0x1a -> :sswitch_2
0x1b -> :sswitch_2
0x42 -> :sswitch_2
0x50 -> :sswitch_1
Beginning of onKeyUp method. Now the power menu cannot longer be called by the power button, so I changed camera_in_use back to 0. I thought it was the safest location to allow android.policy.jar to respond to the button in any other circumstance.
Code:
@@ -7971,6 +8057,20 @@
.prologue
const/4 v4, 0x0
+ .line 687
+ invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getApplicationContext()Landroid/content/Context;
+
+ move-result-object v0
+
+ invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
+
+ move-result-object v0
+
+ .line 688
+ const-string v2, "camera_in_use"
+
+ invoke-static {v0, v2, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
+
const/4 v2, 0x1
const-string v3, "Camera"
Actual code to make the power button to take the shot. To be honest, I don't really know how much of all this is required. I will trim it if I have the time.
Code:
@@ -8030,72 +8130,92 @@
:cond_0
const/16 v0, 0x1a
- if-ne p1, v0, :cond_1
+ if-ne p1, v0, :cond_2
.line 700
- invoke-direct {p0}, Lcom/sec/android/app/camera/Camera;->resetFocusDueToZoom()V
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraEngine:Lcom/sec/android/app/camera/CameraEngine;
- .line 701
- iget-object v0, p0, Lcom/sec/android/app/camera/Camera;->mCameraBaseIndicators:Lcom/sec/android/app/camera/CameraBaseIndicators;
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->isTouchAutoFocusing()Z
- invoke-virtual {v0}, Lcom/sec/android/app/camera/CameraBaseIndicators;->showFocusIndicator()V
+ move-result v1
- .line 702
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getCameraSettings()Lcom/sec/android/app/camera/CameraSettings;
+ if-eqz v1, :cond_1
- move-result-object v0
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraEngine:Lcom/sec/android/app/camera/CameraEngine;
- invoke-virtual {v0}, Lcom/sec/android/app/camera/CameraSettings;->getLock()Z
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->stopTouchAutoFocus()V
- move-result v0
+ :cond_1
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraEngine:Lcom/sec/android/app/camera/CameraEngine;
- if-eqz v0, :cond_2
+ const/16 v3, 0x190
- .line 703
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getCameraSettings()Lcom/sec/android/app/camera/CameraSettings;
+ const/16 v4, 0xf0
- move-result-object v0
+ const/16 v0, 0x320
- invoke-virtual {v0, v4}, Lcom/sec/android/app/camera/CameraSettings;->setLock(Z)V
+ const/16 v2, 0x1e0
- .line 712
- :cond_1
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getCameraSettings()Lcom/sec/android/app/camera/CameraSettings;
+ invoke-virtual {v1, v3, v4}, Lcom/sec/android/app/camera/CameraEngine;->setTouchFocusPosition(II)V
- move-result-object v0
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraEngine:Lcom/sec/android/app/camera/CameraEngine;
- invoke-virtual {v0}, Lcom/sec/android/app/camera/CameraSettings;->getLock()Z
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->startTouchAutoFocus()V
- move-result v0
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraBaseIndicators:Lcom/sec/android/app/camera/CameraBaseIndicators;
- if-eqz v0, :cond_3
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraBaseIndicators;->hideFocusIndicator()V
- move v0, v2
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraBaseIndicators:Lcom/sec/android/app/camera/CameraBaseIndicators;
+
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraBaseIndicators;->resetTouchFocusRectView()V
+
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraBaseIndicators:Lcom/sec/android/app/camera/CameraBaseIndicators;
+
+ invoke-virtual {v1, v3, v4, v0, v2}, Lcom/sec/android/app/camera/CameraBaseIndicators;->setTouchFocusRectCenter(IIII)V
+
+ const/4 v1, 0x1
+
+ iput-boolean v1, p0, Lcom/sec/android/app/camera/Camera;->mChkAllowFocusTouch:Z
+
+ iget-object v1, p0, Lcom/sec/android/app/camera/Camera;->mCameraEngine:Lcom/sec/android/app/camera/CameraEngine;
+
+ invoke-direct {p0}, Lcom/sec/android/app/camera/Camera;->handleShutterKey()Z
+
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->handleShutterEvent()V
+
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->scheduleAutoFocus()V
+
+ invoke-direct {p0}, Lcom/sec/android/app/camera/Camera;->handleShutterKeyReleased()Z
+
+ invoke-virtual {v1}, Lcom/sec/android/app/camera/CameraEngine;->handleShutterReleaseEvent()V
+
+ const/4 v0, 0x1
- .line 713
goto :goto_0
- .line 705
+ .line 702
+ .line 703
+ .line 712
:cond_2
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->getCameraSettings()Lcom/sec/android/app/camera/CameraSettings;
move-result-object v0
- invoke-virtual {v0, v2}, Lcom/sec/android/app/camera/CameraSettings;->setLock(Z)V
-
- .line 706
- :goto_1
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->isCaptureEnabled()Z
+ invoke-virtual {v0}, Lcom/sec/android/app/camera/CameraSettings;->getLock()Z
move-result v0
- if-nez v0, :cond_1
+ if-eqz v0, :cond_3
- .line 707
- invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->processBack()V
+ move v0, v2
- goto :goto_1
+ .line 713
+ goto :goto_0
+ .line 705
+ .line 706
+ .line 707
.line 716
:cond_3
const-string v0, "Camera"

Related

[MOD] status bar bluetooth/silent toggles improved - update 10/23/2010

s0niqu3 brought it to my attention how much the status bar bluetooth toggle
sucked so I changed the onClick method to toggle the bluetooth state instead
of opening settings to the bluetooth page
this is the replacement method for com/android/server/status/StatusBarService$31
which is in the services file in framework.
Code:
.method public onClick(Landroid/view/View;)V
.registers 7
.parameter "v"
.prologue
const-string v1, "StatusBar"
iget-object v3, p0, Lcom/android/server/status/StatusBarService$31;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v3, v3, Lcom/android/server/status/StatusBarService;->mContentResolver:Landroid/content/ContentResolver;
const-string v4, "airplane_mode_on"
const/4 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :exit
invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;
move-result-object v0
if-eqz v0, :exit
const/4 v5, 0x1
const-string v3, "bluetooth"
invoke-static {v3}, Landroid/os/ServiceManager;->checkService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v3
invoke-static {v3}, Landroid/bluetooth/IBluetooth$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetooth;
move-result-object v2
invoke-interface {v2}, Landroid/bluetooth/IBluetooth;->getBluetoothState()I
move-result v3
const/16 v4, 0xc
if-ne v3, v4, :toggleOn
:toggleOff
const-string v4, "Disabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->disable(Z)Z
goto :exit
:toggleOn
const/16 v4, 0xa
if-ne v3, v4, :exit
const-string v4, "Enabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->enable(Z)Z
:exit
return-void
.end method
I added flashables to this post use the stock updater to install, these should
be compatible with any JI6 based ROM because I don't think there are a lot
of mods for /system/framework/services.*. I also killed the battery full notification.
EDIT:
added 3 state toggle to the silent button so now you can toggle from Ringer on --> Vibrate --> Silent
below is the replacement onClick method com/android/server/status/StatusBarService$33
which is in the services file in framework.
Code:
.method public onClick(Landroid/view/View;)V
.registers 7
.parameter "v"
.prologue
const/4 v2, 0x0
const/4 v3, 0x1
const/4 v4, 0x2
.line 3641
iget-object v0, p0, Lcom/android/server/status/StatusBarService$33;->this$0:Lcom/android/server/status/StatusBarService;
iget-boolean v0, v0, Lcom/android/server/status/StatusBarService;->mSilentStatus:Z
if-nez v0, :cond_10
.line 3642
iget-object v0, p0, Lcom/android/server/status/StatusBarService$33;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v0, v0, Lcom/android/server/status/StatusBarService;->mContentResolver:Landroid/content/ContentResolver;
const-string v1, "driving_mode_on"
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 3646
:cond_10
iget-object v0, p0, Lcom/android/server/status/StatusBarService$33;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v0, v0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
const-string v1, "audio"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
iget-object v1, p0, Lcom/android/server/status/StatusBarService$33;->this$0:Lcom/android/server/status/StatusBarService;
iget v1, v1, Lcom/android/server/status/StatusBarService;->mSoundProfile:I
if-eqz v1, :ringerOn
if-eq v1, v4, :vibrate
if-eq v1, v3, :ringerOff
:ringerOn
move v1, v4
:goto_23
invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V
.line 3648
return-void
:ringerOff
move v1, v2
goto :goto_23
:vibrate
iget-object v1, p0, Lcom/android/server/status/StatusBarService$33;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v1, v1, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
const-string v2, "vibrator"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/os/Vibrator;
const-wide/16 v2, 0x32
invoke-virtual {v1, v2, p3}, Landroid/os/Vibrator;->vibrate(J)V
const/4 v1, 0x1
goto :goto_23
.end method
replacement method for StatusBarService.smali, this enables the 3 icons for the silent button.
you also have to add the image resource to twframework-res.apk and a line in public.xml
Code:
<public type="drawable" name="quick_panel_icon_vibrate" id="0x020200d8" />
Code:
.method private prepareQuickPanelSettingIcon(I)V
.registers 7
.parameter "mask"
.prologue
.line 1344
const/4 v2, 0x0
.line 1345
.local v2, textColor:I
const/4 v0, 0x0
.line 1346
.local v0, btnTextView:Landroid/widget/TextView;
const/4 v1, 0x0
.line 1348
.local v1, settingIcon:Landroid/graphics/drawable/Drawable;
packed-switch p1, :pswitch_data_c6
.line 1400
:goto_6
:pswitch_6
invoke-direct {p0, v0, v1, v2}, Lcom/android/server/status/StatusBarService;->updateQuickPanelSettingIcon(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;I)V
.line 1401
return-void
.line 1350
:pswitch_a
iget-object v0, p0, Lcom/android/server/status/StatusBarService;->mWiFiBtn:Landroid/widget/TextView;
.line 1352
iget-boolean v3, p0, Lcom/android/server/status/StatusBarService;->mWiFiStatus:Z
if-eqz v3, :cond_2a
.line 1353
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x2020062
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1354
const v2, -0xff8b34
.line 1355
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mWiFiBtn:Landroid/widget/TextView;
const-string v4, "WI-FI(ON)"
invoke-virtual {v3, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 1360
:goto_27
iget-object v0, p0, Lcom/android/server/status/StatusBarService;->mWiFiBtn:Landroid/widget/TextView;
.line 1361
goto :goto_6
.line 1357
:cond_2a
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x202005f
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1358
const/4 v2, -0x1
goto :goto_27
.line 1364
:pswitch_39
iget-object v0, p0, Lcom/android/server/status/StatusBarService;->mBTBtn:Landroid/widget/TextView;
.line 1366
iget-boolean v3, p0, Lcom/android/server/status/StatusBarService;->mBTStatus:Z
if-eqz v3, :cond_50
.line 1367
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x202005d
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1368
const v2, -0xff8b34
goto :goto_6
.line 1370
:cond_50
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x202005c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1371
const/4 v2, -0x1
.line 1373
goto :goto_6
.line 1376
:pswitch_5f
iget-object v0, p0, Lcom/android/server/status/StatusBarService;->mSoundBtn:Landroid/widget/TextView;
.line 1378
iget v3, p0, Lcom/android/server/status/StatusBarService;->mSoundProfile:I
const/4 v2, 0x2
if-eq v3, v2, :cond_8c
const/4 v2, 0x1
if-eq v3, v2, :cond_7a
.line 1379
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x20200b3
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1380
const v2, -0xff8b34
goto :goto_6
:cond_7a
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x20200d8
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1380
const v2, -0xff8b34
goto/16 :goto_6
.line 1382
:cond_8c
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x20200b2
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1383
const/4 v2, -0x1
.line 1385
goto/16 :goto_6
.line 1388
:pswitch_9c
iget-object v0, p0, Lcom/android/server/status/StatusBarService;->mGpsBtn:Landroid/widget/TextView;
.line 1390
iget-boolean v3, p0, Lcom/android/server/status/StatusBarService;->mGpsStatus:Z
if-eqz v3, :cond_b4
.line 1391
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x202005e
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1392
const v2, -0xff8b34
goto/16 :goto_6
.line 1394
:cond_b4
iget-object v3, p0, Lcom/android/server/status/StatusBarService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x20200b4
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 1395
const/4 v2, -0x1
goto/16 :goto_6
.line 1348
nop
nop
:pswitch_data_c6
.packed-switch 0x1
:pswitch_a
:pswitch_39
:pswitch_6
:pswitch_5f
:pswitch_6
:pswitch_6
:pswitch_6
:pswitch_9c
.end packed-switch
.end method
Sounds great, one less widget I will have to use, any way someone could make it a flashable zip so us none coders can use it?
I added flashables to this thread use the stock updater to install, these should
be compatible with any JI6 based ROM because I don't think there are a lot
of mods for /system/framework/services.*. I also killed the battery full notification.
which I don't think any one will miss.
untermensch said:
s0niqu3 brought it to my attention how much the status bar bluetooth toggle
sucked so I changed the onClick method to toggle the bluetooth state instead
of opening settings to the bluetooth page
this is the replacement method for com/android/server/status/StatusBarService$31
which is in the services file in framework.
Code:
.method public onClick(Landroid/view/View;)V
.registers 7
.parameter "v"
.prologue
const-string v1, "StatusBar"
iget-object v3, p0, Lcom/android/server/status/StatusBarService$31;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v3, v3, Lcom/android/server/status/StatusBarService;->mContentResolver:Landroid/content/ContentResolver;
const-string v4, "airplane_mode_on"
const/4 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :exit
invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;
move-result-object v0
if-eqz v0, :exit
const/4 v5, 0x1
const-string v3, "bluetooth"
invoke-static {v3}, Landroid/os/ServiceManager;->checkService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v3
invoke-static {v3}, Landroid/bluetooth/IBluetooth$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetooth;
move-result-object v2
invoke-interface {v2}, Landroid/bluetooth/IBluetooth;->getBluetoothState()I
move-result v3
const/16 v4, 0xc
if-ne v3, v4, :toggleOn
:toggleOff
const-string v4, "Disabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->disable(Z)Z
goto :exit
:toggleOn
const/16 v4, 0xa
if-ne v3, v4, :exit
const-string v4, "Enabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->enable(Z)Z
:exit
return-void
.end method
I added flashables to this post use the stock updater to install, these should
be compatible with any JI6 based ROM because I don't think there are a lot
of mods for /system/framework/services.*. I also killed the battery full notification.
Click to expand...
Click to collapse
Thanks again for everything you've done, glad to have so many annoying samsung bugs fixed by such awesome people in the community.
Cheers, =)
Thanks for a fix to a very annoying issue. Noob question: which of these would I use with the Bionix. ROMs?
Sent from my SGH-T959 using XDA App
murse said:
Thanks for a fix to a very annoying issue. Noob question: which of these would I use with the Bionix. ROMs?
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
Hi,
I can't guarantee anything, but always try the JI6 deodexed version on the bionix roms first.
Cheers, =)
Not sure why but JI6 deodexed would not install in clockwork, just got stuck saying installing update, So i just had to just pull the services.jar and use root explorer and pasted it in system/framework. It hung when restarting, but then I rebooted into recovery wiped both caches and that fixed the hang issue. Works great thanks for this. One of these days I will learn some coding stuff so i can do it myself.
For those interested, that is what i had to do to get it to work on fusion1.1 with the King Klicks Kernel.
mikey98277 said:
Not sure why but it would not install in clockwork, just got stuck saying installing update, So i just had to just pull the services.jar and use root explorer and pasted it in system/framework. It hung when restarting, but then I rebooted into recovery wiped both caches and that fixed the hang issue. Works great thanks for this. One of these days I will learn some coding stuff so i can do it myself.
For those interested, that is what i had to do to get it to work on fusion1.1 with the King Klicks Kernel.
Click to expand...
Click to collapse
FYI, the flashable update.zip is in the download file.
EDIT: Just installed on Bionix FINAL and the bluetooth status update works great. Nice addition. Haven't tried to charge 100%, but I certainly won't miss that notification. Thanks untermensch for all of your mods!!!
a400meter said:
FYI, the flashable update.zip is in the download file.
Not sure what you meant by that, As I said I tried the update.zip file and it did not work on Fusion 1.1 with KK Kernel. So I pulled the file from it and pushed it manually.
Click to expand...
Click to collapse
mikey98277 said:
a400meter said:
FYI, the flashable update.zip is in the download file.
Not sure what you meant by that, As I said I tried the update.zip file and it did not work on Fusion 1.1 with KK Kernel. So I pulled the file from it and pushed it manually.
Click to expand...
Click to collapse
What that means is that the update.zip file that is located inside the zip you downloaded is not meant to be installed through clockwork, but instead through the stock phone recovery menu. Replace the clockwork update.zip on your internal memory with the downloaded one, and then go to the phone recovery and hit "Reinstall Packages".
I know you already installed the file manually, the clarification is more for others who may need help.
Click to expand...
Click to collapse
untermensch said:
s0niqu3 brought it to my attention how much the status bar bluetooth toggle
sucked so I changed the onClick method to toggle the bluetooth state instead
of opening settings to the bluetooth page
this is the replacement method for com/android/server/status/StatusBarService$31
which is in the services file in framework.
Code:
.method public onClick(Landroid/view/View;)V
.registers 7
.parameter "v"
.prologue
const-string v1, "StatusBar"
iget-object v3, p0, Lcom/android/server/status/StatusBarService$31;->this$0:Lcom/android/server/status/StatusBarService;
iget-object v3, v3, Lcom/android/server/status/StatusBarService;->mContentResolver:Landroid/content/ContentResolver;
const-string v4, "airplane_mode_on"
const/4 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :exit
invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;
move-result-object v0
if-eqz v0, :exit
const/4 v5, 0x1
const-string v3, "bluetooth"
invoke-static {v3}, Landroid/os/ServiceManager;->checkService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v3
invoke-static {v3}, Landroid/bluetooth/IBluetooth$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetooth;
move-result-object v2
invoke-interface {v2}, Landroid/bluetooth/IBluetooth;->getBluetoothState()I
move-result v3
const/16 v4, 0xc
if-ne v3, v4, :toggleOn
:toggleOff
const-string v4, "Disabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->disable(Z)Z
goto :exit
:toggleOn
const/16 v4, 0xa
if-ne v3, v4, :exit
const-string v4, "Enabling Bluetooth"
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface {v2, v5}, Landroid/bluetooth/IBluetooth;->enable(Z)Z
:exit
return-void
.end method
I added flashables to this post use the stock updater to install, these should
be compatible with any JI6 based ROM because I don't think there are a lot
of mods for /system/framework/services.*. I also killed the battery full notification.
Click to expand...
Click to collapse
First of all, great work with this fix.
Is there any way that this method could be used to change the Silent shortcut to a Vibrate shortcut? I'm not sure about others, but I personally never use Silent mode, and it bugs the hell out of me that it's so easily accessible yet useless for me.
gilbar said:
mikey98277 said:
What that means is that the update.zip file that is located inside the zip you downloaded is not meant to be installed through clockwork, but instead through the stock phone recovery menu. Replace the clockwork update.zip on your internal memory with the downloaded one, and then go to the phone recovery and hit "Reinstall Packages".
I know you already installed the file manually, the clarification is more for others who may need help.
Click to expand...
Click to collapse
ahh... i get it now, maybe thats why it didnt work, well I got it going anyways thanks.
Click to expand...
Click to collapse
So the deodexed one should work fine with Eugene's frankin final?
Thanks, this makes life easier.
I used RootExplorer to copy your services.odex into android's /system/framework folder. Painless and it works perfectly.
I wish the notification bar had the option to enable/disable TV out.
Thanks for this - works well to turn BT off, but to turn on it's very slow. Is that just me?
Turns on or off in less than 2 or 3 seconds here.
Colt1911 said:
Turns on or off in less than 2 or 3 seconds here.
Click to expand...
Click to collapse
Wow, that's instant compared to my phone.
My phone takes usually 10-11 seconds to turn on bluetooth, and that's totally independent of how I go about turning it on. If I use the notification toggle, or turn on directly from the settings menu, or use the default android power control widget, they all take 10-11 seconds to turn on bluetooth.
So, my guess is that maybe bluetooth on/off speed is affected by custom kernels or custom roms, or a combination of both and still unknown factors.
Honestly, I don't really mind how long it takes, I don't use bluetooth all that often, but the few times I do, the toggle has always annoyed me that it just opened bluetooth settings, so this mod is perfect for me.
Thanks again, cheers everyone, =)
s0niqu3 said:
Wow, that's instant compared to my phone.
My phone takes usually 10-11 seconds to turn on bluetooth, and that's totally independent of how I go about turning it on. If I use the notification toggle, or turn on directly from the settings menu, or use the default android power control widget, they all take 10-11 seconds to turn on bluetooth.
So, my guess is that maybe bluetooth on/off speed is affected by custom kernels or custom roms, or a combination of both and still unknown factors.
Honestly, I don't really mind how long it takes, I don't use bluetooth all that often, but the few times I do, the toggle has always annoyed me that it just opened bluetooth settings, so this mod is perfect for me.
Thanks again, cheers everyone, =)
Click to expand...
Click to collapse
I have the same issue, and it started exactly when i started installing Bionix ROMs on both my phone and my wife's. I figured it was something about how he built his ROM, and just deided to live with it. It could either be Bionix orJAC. I havent tried Bionix with stock kernel to try and troubleshoot.
I updated the OP files, you can now toggle from Ringer On --> Vibrate --> Silent
seems like the button icon should be changed to 3 state also for a more finished
look.
untermensch said:
I updated the OP files, you can now toggle from Ringer On --> Vibrate --> Silent
seems like the button icon should be changed to 3 state also for a more finished
look.
Click to expand...
Click to collapse
Sounds great, thanks!
Would you mind posting the code to make the silent/vibrate change manually?
Thanks again, cheers, =)

[MOD/Source] [KB5] Signal Strength in dBm

More or less set out to try this just to see if I can do it, and it so happens the possibilities are endless!
Here's how to do it:
decompile services.jar
open com/android/server/status/StatusBarPolicy.smali
do the edits below
compile
push/flash
Find (around line 690)
Code:
.line 530
const-string v3, "phone_signal"
then comment (or remove) the following two lines out, and add these:
Code:
const-string v4, ""
invoke-static {v3, v4}, Lcom/android/server/status/IconData;->makeText(Ljava/lang/String;Ljava/lang/CharSequence;)Lcom/android/server/status/IconData;
here's what my final block of code looks like
Code:
.line 530
const-string v3, "phone_signal"
# const v4, 0x10802fe
# invoke-static {v3, v7, v4, v6, v6}, Lcom/android/server/status/IconData;->makeIcon(Ljava/lang/String;Ljava/lang/String;III)Lcom/android/server/status/IconData;
const-string v4, ""
invoke-static {v3, v4}, Lcom/android/server/status/IconData;->makeText(Ljava/lang/String;Ljava/lang/CharSequence;)Lcom/android/server/status/IconData;
move-result-object v3
iput-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
.line 532
iget-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
k that takes care of changing what type of image it is, next we replace the updateSignalStrength() method
starts on line 5368 for me
Code:
.method private final updateSignalStrength()V
.registers 7
.prologue
const/4 v5, 0x0
.line 1314
const/4 v0, -0x1
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mServiceState:Landroid/telephony/ServiceState;
if-eqz v2, :cond_35
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mServiceState:Landroid/telephony/ServiceState;
invoke-virtual {v2}, Landroid/telephony/ServiceState;->isEmergencyOnly()Z
move-result v2
if-nez v2, :cond_35
.line 1320
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "airplane_mode_on"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
const/4 v3, 0x1
# flight mode is on
if-ne v2, v3, :cond_3d
.line 1322
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
const-string v3, " fl "
iput-object v3, v2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
.line 1326
:goto_2b
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;
iget-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneIcon:Landroid/os/IBinder;
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
const v5, 0x0
invoke-virtual {v2, v3, v4, v5}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V
.line 1373
:cond_34
return-void
.line 1324
:cond_35
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
# no service or signal
const-string v3, " X "
iput-object v3, v2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
goto :goto_2b
.line 1330
:cond_3d
# check if there's a signal
.line 1318
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->hasService()Z
move-result v3
if-eqz v3, :cond_35
# ok there's signal, do something
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
# add minus sign
const-string v1, "-"
invoke-virtual {v5, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mSignalStrength:Landroid/telephony/SignalStrength;
invoke-virtual {v0}, Landroid/telephony/SignalStrength;->getGsmSignalStrength()I
move-result v0
const v3, 0x2
mul-int v4, v0, v3
const v3, 0x71
sub-int v0, v3, v4
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v5
# add extra padding
const-string v1, " "
invoke-virtual {v5, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mPhoneData:Lcom/android/server/status/IconData;
iput-object v5, v2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
goto :goto_2b
.end method
If you look, you can see I manually added a couple of strings towards the very bottom, like the minus sign and a space afterwords. You can customize it to say what you want (maybe if you want it to say dBm)
Note: I basically rewrote the whole method, and I took the non-GSM stuff out of there, so if any of you Epic/Fascinate/Other guys want to do it (by chance), be sure to give me a holler if you're lost. Also, you can display the asu instead if you want, the dBm is actually calculated from it (asu*2) - 113, so you would just comment out a couple lines.
The attached smali already has edits for clock toggle/ampm toggle
BT, out
(battery percentage next? watch out jocelyn!)
Ba dum dum
Great job!
Is this a rewrite on the way we view the strength or will this mod get us better strength,sorry for my noobness
mike216 said:
Is this a rewrite on the way we view the strength or will this mod get us better strength,sorry for my noobness
Click to expand...
Click to collapse
It just changes how it is displayed, it will not affect your signal what-so-ever
mike216 said:
Is this a rewrite on the way we view the strength or will this mod get us better strength,sorry for my noobness
Click to expand...
Click to collapse
It's just a different way to view the signal bars. This just shows you the actual signal strength. It doesn't increase your signal strength.
Great work dude, can't wait to play with this.
Sent from my SGH-T959 using Tapatalk
Dude, not only did you make this so freaking easy I could do it... you did something I have been hoping for, for a long time.
I think you may have just gotten some more of my Fat Tire....
Hoping this is the default/option on the next ROM you (and Whitehawk) release!
Awesome work man ...
Thanks............ easy enough EVEN a Caveman can do it !!!
excellent work, thanks!
s15274n said:
Hoping this is the default/option on the next ROM you (and Whitehawk) release!
Click to expand...
Click to collapse
This would be a pretty cool idea but can you imagine the questions/comments?
"hey were r my signal bars"
"omg y dnt i hav any signal/omg i hav 80 signal"
Regardless, thanks a bunch for this, birgertime! Especially with the modem swapping I've been doing this saves me a good 10-15 seconds finding the actual signal strength.
lol Qaeda said:
This would be a pretty cool idea but can you imagine the questions/comments?
"hey were r my signal bars"
"omg y dnt i hav any signal/omg i hav 80 signal"
Regardless, thanks a bunch for this, birgertime! Especially with the modem swapping I've been doing this saves me a good 10-15 seconds finding the actual signal strength.
Click to expand...
Click to collapse
It will be toggle-able. Check my twitter
Sent from my SGH-T959 using Tapatalk
birgertime said:
It will be toggle-able. Check my twitter
Click to expand...
Click to collapse
Yeah, I was thinking if it got done at all it'd be a on-off thing. Awesome... one more thing to look forward to in the next release of Trigger!

On-Screen Button Alpha/Transparency

Does anyone realize, that the on-screen button is not fully opaque.
I've checked every png of the button in the SystemUI, for example ic_sysbar_home.png
The color is 100% opaque and white (ffffff) (See screenshot #1)
But, what appears on the screen, the color is b0b0b0 (see screenshot #2)
I tried to see every xml and smali in SystemUI and framework, but what I've got, maybe it's in the smali of SystemUI, maybe in this file
"SystemUI\smali\com\android\systemui\statusbar\phone\NavigationBarView.smali"
There is setAlpha function in there, that controls the transparency of the buttons. But I don't have idea how to make it 100% opaque..
Can someone help?
See this for example :
:goto_1
invoke-virtual {v1, v2}, Landroid/view/View;->setAlpha(F)V
.line 283
if-eqz p1, :cond_2
:goto_2
invoke-virtual {v0, v4}, Landroid/view/View;->setAlpha(F)V
Click to expand...
Click to collapse
.line 293
invoke-virtual {v0, v3}, Landroid/view/View;->setAlpha(F)V
Click to expand...
Click to collapse
:goto_1
invoke-virtual {v3, v0}, Landroid/view/View;->setAlpha(F)V
.line 204
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getHomeButton()Landroid/view/View;
move-result-object v3
and-int/lit8 v0, p1, 0x2
if-eqz v0, :cond_2
move v0, v1
:goto_2
invoke-virtual {v3, v0}, Landroid/view/View;->setAlpha(F)V
.line 206
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getRecentsButton()Landroid/view/View;
move-result-object v0
and-int/lit8 v3, p1, 0x4
if-eqz v3, :cond_3
:goto_3
invoke-virtual {v0, v1}, Landroid/view/View;->setAlpha(F)V
Click to expand...
Click to collapse

[MOD][Guide]Toggles for devs to add to Custom Settings [Lollipop]

Couple Status Bar Icon Toggles I'll share. Thanks to @loserskater for his guides pointing me in the right direction. Also to @Goldie for the smali guide. And a little bit of digging through @tdunham and @rompnit's SystemUI from MOAR. I've gotten their permission to post these guides and I plan to expand upon it. Figured I'd give it its own thread too.
Add Toggle On/Off for Alarm Icon
First you will want to increase .locals by 1. Mine was .locals 5 and I changed it to .locals 6 for this. The basic idea when doing these is that you need to look at the locals you have right now. They are always 1 higher than what the highest value or v in the method is. Noting this so that this can be done on other devices besides the S5 in case code has changed and the values.
For a quick example of what values you need for the new code we're adding. We will look at what I've done with this alarm on/off toggle. We are adding 2 new values so look at the locals now. Look at the method and see what the highest value is. Where I have v4 in all the lines we're adding you will be putting it 1 value (v) higher than what the highest one in the file is. Next is the string for the toggle itself in this case it is const-string v5, "statusbar_hide_alarm". This is you key that the toggle runs off of. It will need to be 1 higher than the others. Next you will see this line with 3 values. v4 which we just went over is the first value. Then v5 which is the key will be second. And lastly v1 which is going to always be from the setIconVisibility line that was originally in the code where we are modifying to add the toggle. In this case. "invoke-virtual {v2, v3, v1}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V" As you can see it is v1 in that line so you will place it last in the getInt line and replace it in the const/4 v1, 0x0 near the end of what we're adding.
invoke-static {v4, v5, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
As far as the cond (condition) lines go you can make them :condtm or whatever you want as long as the condition isn't already used in the method. Similar to the values.​
In SystemUI.apk edit com/android/statusbar/phone/StatusBarPhonePolicy.smali
Search for .method private updateAlarm()V
Add lines in blue. Change lines in green.
Code:
.method private updateAlarm()V
[COLOR="Green"].locals 6[/COLOR]
.prologue
.line 221
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const-string v3, "alarm"
invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/AlarmManager;
.line 222
.local v0, "alarmManager":Landroid/app/AlarmManager;
const/4 v2, -0x2
invoke-virtual {v0, v2}, Landroid/app/AlarmManager;->getNextAlarmClock(I)Landroid/app/AlarmManager$AlarmClockInfo;
move-result-object v2
if-eqz v2, :cond_0
const/4 v1, 0x1
.line 223
.local v1, "alarmSet":Z
:goto_0
[COLOR="Blue"]iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "statusbar_hide_alarm"
invoke-static {v4, v5, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-nez v4, :cond_tm
const/4 v1, 0x0
:cond_tm[/COLOR]
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v3, "alarm_clock"
invoke-virtual {v2, v3, v1}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 224
return-void
.line 222
.end local v1 # "alarmSet":Z
:cond_0
const/4 v1, 0x0
goto :goto_0
.end method
In your CustomSettings.apk add this line to preferences.xml where you want the toggle to appear.
<CheckBoxPreference android:title="Hide Alarm Icon" android:key="statusbar_hide_alarm" android:summaryOn="Alarm icon is visible." android:summaryOff="Alarm icon is hidden." />
Add Toggle On/Off for Bluetooth Icon
In SystemUI.apk edit com/android/statusbar/phone/StatusBarPhonePolicy.smali
First you will want to increase .locals by 2 because we are adding 2 new values. Mine was .locals 6 and I changed it to .locals 8 for this. The basic idea when doing these is that you need to look at the locals you have right now. They are always 1 higher than what the highest value or v in the method is. Noting this so that this can be done on other devices besides the S5 in case code has changed and the values.
Code:
.method private final updateBluetooth()V
[COLOR="green"].locals 8[/COLOR]
.prologue
const/4 v4, 0x0
.line 393
invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;
move-result-object v0
.line 394
.local v0, "adapter":Landroid/bluetooth/BluetoothAdapter;
const v2, 0x7f0202a8
.line 395
.local v2, "iconId":I
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v5, 0x7f0c020a
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
.line 397
.local v1, "contentDescription":Ljava/lang/String;
if-eqz v0, :cond_2
.line 398
invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getState()I
move-result v3
const/16 v5, 0xc
if-ne v3, v5, :cond_1
const/4 v3, 0x1
:goto_0
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
.line 399
invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getConnectionState()I
move-result v3
const/4 v5, 0x2
if-ne v3, v5, :cond_0
.line 400
const v2, 0x7f0202a9
.line 401
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v5, 0x7f0c0209
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
.line 407
:cond_0
:goto_1
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v5, "bluetooth"
invoke-virtual {v3, v5, v2, v4, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
.line 408
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v4, "bluetooth"
iget-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
[COLOR="Blue"]iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v6
const-string v7, "statusbar_hide_bluetooth"
invoke-static {v6, v7, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-nez v6, :cond_tm
const/4 v5, 0x0
:cond_tm[/COLOR]
invoke-virtual {v3, v4, v5}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 409
return-void
:cond_1
move v3, v4
.line 398
goto :goto_0
.line 367
:cond_2
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
goto :goto_1
.end method
In your CustomSettings.apk add this line to preferences.xml where you want the toggle to appear.
<CheckBoxPreference android:title="Hide Bluetooth Icon" android:key="statusbar_hide_bluetooth" android:summaryOn="Bluetooth Icon is visible." android:summaryOff="Bluetooth Icon is hidden." />
Volume Icons (Vibrate/Silent) on/off
This guide will be split into 2 parts. 1st for those that have enough registers left in this method we're adding then for those that don't. How to tell if you have enough room? If the locals is higher than 13 than you have too many in the method from the start for us to add these. Again I raised the locals by 2 since we're adding 2 more to it. So from 13 to 15 (the max). So if its 13 you'll be changing them to 15 like so
Code:
.method private final updateVolumeZen()V
[COLOR="Green"].locals 15[/COLOR]
Now that we fixed the locals search in the same method for these strings. It will make life easier than posting the long method for this since they're toward the end.
Search for Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V and add the blue lines above it.
Code:
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v8, "volume"
[COLOR="Blue"] iget-object v14, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v14}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v14
const-string v13, "statusbar_hide_volume"
invoke-static {v14, v13, [COLOR="Purple"]v3[/COLOR]}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v14
if-nez v14, :cond_tm
const/4 [COLOR="Purple"]v3[/COLOR], 0x0
:cond_tm[/COLOR]
invoke-virtual {v7, v8, [COLOR="Purple"]v3[/COLOR]}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
Now we will have to repeat this a 2nd time for the 2nd icon.
Search again for Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V and add the blue lines above it.
I will make the values match those above because thats what it needs so adjust accordingly. Then you need to input the correct value from setIconVisibilty line like I showed in the first guide. It will be the 3rd Value(v) in this line which I marked them with purple. So as you'll see they match.
Code:
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v8, "zen"
[COLOR="Blue"]iget-object v14, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v14}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v14
const-string v13, "statusbar_hide_volume"
invoke-static {v14, v13, [COLOR="Purple"]v6[/COLOR]}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v14
if-nez v14, :cond_b
const/4 [COLOR="Purple"]v6[/COLOR], 0x0
:cond_b[/COLOR]
invoke-virtual {v7, v8, [COLOR="Purple"]v6}[/COLOR], Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
iput-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mZenVisible:Z
Now to add the toggle to custom settings. Add it in with the last 2 in preferences.xml
<CheckBoxPreference android:title="Hide Volume Icons" android:key="statusbar_hide_volume" android:summaryOn="Vibration and Silent Icons are visible." android:summaryOff="Vibration and Silent Icons are hidden." />
Part 2 for those of you like me who have too many registers.
Haven't figured this one out yet. Having some trouble with it.
Reserved 2
Awesome, thank you for this.
Almost forgot I did one for Home Key Wake too. I'll add this one in this post in a few minutes. Thanks to @rompnit and @tdunham for their guide for disabling this which pointed me in the right direction.
[Guide] How To Add Toggle for Home Key Wake
Edit android.policy.jar edit the smali/com/android/interal/policy/impl/PhoneWindowManager.smali
Search for .method private isWakeKeyWhenScreenOff(I)Z
Add lines in blue. Change ones in green.
Ignore .line codes they probably will be different. I changed the locals for this method from 3 to 5 because we're adding 2 more values here. The basic idea when doing these is that you need to look at the locals you have right now in the method. They are always 1 higher than what the highest value or v in the method is.
Code:
.method private isWakeKeyWhenScreenOff(I)Z
[COLOR="Green"] .locals 5[/COLOR]
.param p1, "keyCode" # I
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 5966
sparse-switch p1, :sswitch_data_0
.line 5992
:cond_0
:goto_0
return v0
.line 5971
:sswitch_0
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDockMode:I
if-nez v2, :cond_0
move v0, v1
goto :goto_0
:sswitch_1
move v0, v1
.line 5990
goto :goto_0
[COLOR="Blue"]:sswitch_2
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "wake_home"
const v4, 0x1
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_0
return v1[/COLOR]
.line 5966
:sswitch_data_0
.sparse-switch
[COLOR="Green"]0x3 -> :sswitch_2[/COLOR]
0x19 -> :sswitch_0
0x1b -> :sswitch_1
0x4f -> :sswitch_1
0x55 -> :sswitch_1
0x56 -> :sswitch_1
0x57 -> :sswitch_1
0x58 -> :sswitch_1
0x59 -> :sswitch_1
0x5a -> :sswitch_1
0x5b -> :sswitch_1
0x7e -> :sswitch_1
0x7f -> :sswitch_1
0x82 -> :sswitch_1
0xa4 -> :sswitch_0
0xde -> :sswitch_1
0x149 -> :sswitch_1
.end sparse-switch
.end method
Now to add it to CustomSettings.apk. This will add a screen just for Hardware Key Mods. You can just add the part in red wherever if you don't want it in its own screen.
<PreferenceScreen android:title="Hardware Key Mods">
<PreferenceScreen android:title="Home Button Wake" android:summary="Prevents screen wake with Home button.">
<CheckBoxPreference android:title="Disable Home Button Wake" android:key="wake_home" android:defaultValue="false" android:summaryOn="Home Button Enabled" android:summaryOff="Home Button Disabled" />
</PreferenceScreen>
</PreferenceScreen>
Very nice guides! I'm going to try these out on my S6. I'll let you know how it goes when I get a chance to try them. Thanks.
Awesome guides @talkingmonkeys keep em coming!! Can't wait to try these!
Perhaps @Goldie or @txr33 or @daxgirl if any of you have the time you could any of you help me with adding the code for a toggle when theres already too many values in the method? I have 23 locals for the method that the volume icons for status bar are in. @tdunham suggested trying to find some between 1-15 that were unused but after trying every one its always telling me its wrong on the compile. Thanks for any help! I'll provide files if needed.
I will gladly have a look
And btw although I was the first one with thanks, still didn't get time to congratulate! You always do amazing job! Any guide you make is amazing! Keep'em coming!
Sent from my awesome g920f powered by 6thGear
daxgirl said:
I will gladly have a look
And btw although I was the first one with thanks, still didn't get time to congratulate! You always do amazing job! Any guide you make is amazing! Keep'em coming!
Sent from my awesome g920f powered by 6thGear
Click to expand...
Click to collapse
Sent you what needs looked at in a pm. Thank you but if it wasn't for you, goldie, tdunham and rompnit I would still be lost with all of this.
talkingmonkeys said:
Couple Status Bar Icon Toggles I'll share. Thanks to @loserskater for his guides pointing me in the right direction. Also to @Goldie for the smali guide. And a little bit of digging through @tdunham and @rompnit's SystemUI from MOAR. I've gotten their permission to post these guides and I plan to expand upon it. Figured I'd give it its own thread too.
Add Toggle On/Off for Alarm Icon
First you will want to increase .locals by 1. Mine was .locals 5 and I changed it to .locals 6 for this. The basic idea when doing these is that you need to look at the locals you have right now. They are always 1 higher than what the highest value or v in the method is. Noting this so that this can be done on other devices besides the S5 in case code has changed and the values.
For a quick example of what values you need for the new code we're adding. We will look at what I've done with this alarm on/off toggle. We are adding 2 new values so look at the locals now. Look at the method and see what the highest value is. Where I have v4 in all the lines we're adding you will be putting it 1 value (v) higher than what the highest one in the file is. Next is the string for the toggle itself in this case it is const-string v5, "statusbar_hide_alarm". This is you key that the toggle runs off of. It will need to be 1 higher than the others. Next you will see this line with 3 values. v4 which we just went over is the first value. Then v5 which is the key will be second. And lastly v1 which is going to always be from the setIconVisibility line that was originally in the code where we are modifying to add the toggle. In this case. "invoke-virtual {v2, v3, v1}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V" As you can see it is v1 in that line so you will place it last in the getInt line and replace it in the const/4 v1, 0x0 near the end of what we're adding.
invoke-static {v4, v5, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
As far as the cond (condition) lines go you can make them :condtm or whatever you want as long as the condition isn't already used in the method. Similar to the values.​
In SystemUI.apk edit com/android/statusbar/phone/StatusBarPhonePolicy.smali
Search for .method private updateAlarm()V
Add lines in blue. Change lines in green.
Code:
.method private updateAlarm()V
[COLOR="Green"].locals 6[/COLOR]
.prologue
.line 221
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const-string v3, "alarm"
invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/AlarmManager;
.line 222
.local v0, "alarmManager":Landroid/app/AlarmManager;
const/4 v2, -0x2
invoke-virtual {v0, v2}, Landroid/app/AlarmManager;->getNextAlarmClock(I)Landroid/app/AlarmManager$AlarmClockInfo;
move-result-object v2
if-eqz v2, :cond_0
const/4 v1, 0x1
.line 223
.local v1, "alarmSet":Z
:goto_0
[COLOR="Blue"]iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "statusbar_hide_alarm"
invoke-static {v4, v5, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-nez v4, :cond_tm
const/4 v1, 0x0
:cond_tm[/COLOR]
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v3, "alarm_clock"
invoke-virtual {v2, v3, v1}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 224
return-void
.line 222
.end local v1 # "alarmSet":Z
:cond_0
const/4 v1, 0x0
goto :goto_0
.end method
In your CustomSettings.apk add this line to preferences.xml where you want the toggle to appear.
<CheckBoxPreference android:title="Hide Alarm Icon" android:key="statusbar_hide_alarm" android:summaryOn="Alarm icon is visible." android:summaryOff="Alarm icon is hidden." />
Add Toggle On/Off for Bluetooth Icon
In SystemUI.apk edit com/android/statusbar/phone/StatusBarPhonePolicy.smali
First you will want to increase .locals by 2 because we are adding 2 new values. Mine was .locals 6 and I changed it to .locals 8 for this. The basic idea when doing these is that you need to look at the locals you have right now. They are always 1 higher than what the highest value or v in the method is. Noting this so that this can be done on other devices besides the S5 in case code has changed and the values.
Code:
.method private final updateBluetooth()V
[COLOR="green"].locals 8[/COLOR]
.prologue
const/4 v4, 0x0
.line 393
invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;
move-result-object v0
.line 394
.local v0, "adapter":Landroid/bluetooth/BluetoothAdapter;
const v2, 0x7f0202a8
.line 395
.local v2, "iconId":I
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v5, 0x7f0c020a
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
.line 397
.local v1, "contentDescription":Ljava/lang/String;
if-eqz v0, :cond_2
.line 398
invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getState()I
move-result v3
const/16 v5, 0xc
if-ne v3, v5, :cond_1
const/4 v3, 0x1
:goto_0
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
.line 399
invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getConnectionState()I
move-result v3
const/4 v5, 0x2
if-ne v3, v5, :cond_0
.line 400
const v2, 0x7f0202a9
.line 401
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
const v5, 0x7f0c0209
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
.line 407
:cond_0
:goto_1
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v5, "bluetooth"
invoke-virtual {v3, v5, v2, v4, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
.line 408
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v4, "bluetooth"
iget-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
[COLOR="Blue"]iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v6
const-string v7, "statusbar_hide_bluetooth"
invoke-static {v6, v7, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-nez v6, :cond_tm
const/4 v5, 0x0
:cond_tm[/COLOR]
invoke-virtual {v3, v4, v5}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 409
return-void
:cond_1
move v3, v4
.line 398
goto :goto_0
.line 367
:cond_2
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
goto :goto_1
.end method
In your CustomSettings.apk add this line to preferences.xml where you want the toggle to appear.
<CheckBoxPreference android:title="Hide Bluetooth Icon" android:key="statusbar_hide_bluetooth" android:summaryOn="Bluetooth Icon is visible." android:summaryOff="Bluetooth Icon is hidden." />
Click to expand...
Click to collapse
with .local 4 .local change and would be 5 or more things have to change?
talkingmonkeys said:
Almost forgot I did one for Home Key Wake too. I'll add this one in this post in a few minutes. Thanks to @rompnit and @tdunham for their guide for disabling this which pointed me in the right direction.
[Guide] How To Add Toggle for Home Key Wake
Edit android.policy.jar edit the smali/com/android/interal/policy/impl/PhoneWindowManager.smali
Search for .method private isWakeKeyWhenScreenOff(I)Z
Add lines in blue. Change ones in green.
Ignore .line codes they probably will be different. I changed the locals for this method from 3 to 5 because we're adding 2 more values here. The basic idea when doing these is that you need to look at the locals you have right now in the method. They are always 1 higher than what the highest value or v in the method is.
Code:
.method private isWakeKeyWhenScreenOff(I)Z
[COLOR="Green"] .locals 5[/COLOR]
.param p1, "keyCode" # I
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 5966
sparse-switch p1, :sswitch_data_0
.line 5992
:cond_0
:goto_0
return v0
.line 5971
:sswitch_0
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDockMode:I
if-nez v2, :cond_0
move v0, v1
goto :goto_0
:sswitch_1
move v0, v1
.line 5990
goto :goto_0
[COLOR="Blue"]:sswitch_2
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "wake_home"
const v4, 0x1
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_0
return v1[/COLOR]
.line 5966
:sswitch_data_0
.sparse-switch
[COLOR="Green"]0x3 -> :sswitch_2[/COLOR]
0x19 -> :sswitch_0
0x1b -> :sswitch_1
0x4f -> :sswitch_1
0x55 -> :sswitch_1
0x56 -> :sswitch_1
0x57 -> :sswitch_1
0x58 -> :sswitch_1
0x59 -> :sswitch_1
0x5a -> :sswitch_1
0x5b -> :sswitch_1
0x7e -> :sswitch_1
0x7f -> :sswitch_1
0x82 -> :sswitch_1
0xa4 -> :sswitch_0
0xde -> :sswitch_1
0x149 -> :sswitch_1
.end sparse-switch
.end method
Now to add it to CustomSettings.apk. This will add a screen just for Hardware Key Mods. You can just add the part in red wherever if you don't want it in its own screen.
<PreferenceScreen android:title="Hardware Key Mods">
<PreferenceScreen android:title="Home Button Wake" android:summary="Prevents screen wake with Home button.">
<CheckBoxPreference android:title="Disable Home Button Wake" android:key="wake_home" android:defaultValue="false" android:summaryOn="Home Button Enabled" android:summaryOff="Home Button Disabled" />
</PreferenceScreen>
</PreferenceScreen>
Click to expand...
Click to collapse
bro in the latest version of lollipop for note 4 there have been some changes .locals have been changed to .registers
does this make any difference ??
and i get bootloop when ever i try to make changes
i have attached stock file if you can take a look
Er. Aditya said:
bro in the latest version of lollipop for note 4 there have been some changes .locals have been changed to .registers
does this make any difference ??
and i get bootloop when ever i try to make changes
i have attached stock file if you can take a look
Click to expand...
Click to collapse
The registers instead of locals is because of the version of apktool you are using. It won't make any difference just for those.
tdunham said:
The registers instead of locals is because of the version of apktool you are using. It won't make any difference just for those.
Click to expand...
Click to collapse
il try again sir , but it gave me bootloop and report back here with all the reports
Didn't read all the posts
Can we utilize some .end local for hiding of the sound icon? Just thinking out loud.
evilvoice said:
Can we utilize some .end local for hiding of the sound icon? Just thinking out loud.
Click to expand...
Click to collapse
@daxgirl do you think we would?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
talkingmonkeys said:
@daxgirl do you think we would?
Click to expand...
Click to collapse
I think it should be noted that there is only 1 setIconVisibility in the updateVolumeZen method. Also, in talking about .end local. I see v15 is never restarted. They also end a bunch of locals from dnd and noti settings. These are restarted AFTER the setIconVisibility. There is also this at the beginning of the mthod
Code:
.line 278
.local v18, "zenVisible":Z
const/16 v17, 0x0
.
.
.
.line 282
.local v14, "volumeVisible":Z
const/4 v13, 0x0
.
.
.
## and further down
.
.
.
:cond_5
if-eqz v14, :cond_6
.line 387
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
move-object/from16 v19, v0
const-string v20, "volume"
const/16 v21, 0x0
move-object/from16 v0, v19
move-object/from16 v1, v20
move/from16 v2, v21
invoke-virtual {v0, v1, v13, v2, v12}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
.line 389
:cond_6
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
move/from16 v19, v0
move/from16 v0, v19
if-eq v14, v0, :cond_7
.line 390
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
move-object/from16 v19, v0
const-string v20, "volume"
move-object/from16 v0, v19
move-object/from16 v1, v20
invoke-virtual {v0, v1, v14}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 391
move-object/from16 v0, p0
iput-boolean v14, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
.line 393
:cond_7
return-void
What stands out to me is the Visible portions of the code...maybe we can manipulate these to work for us
Very well written, thanks for sharing. I'm trying to add a toggle for center clock, and to add options for normal/small/no am/pm. No crazy color changing or size changing for the clock. If you have any input on that I would be very grateful!
Okay, so back to the volume hide mod, tdunham just posted a mod that increased locals from 31 to 33, so it is possible to go higher than 15. Maybe just try the mod and see what happens? I do know that only the 1st part of the mod is contained in that method, the 2nd part is contained in the public constructor and a bit different.

[REQUEST] Screen Mirroring/WfdService Fix for Sony Xperia XZ1 Compact

Request to kindly create a magisk module that would fix WiFi Display/ Screen Mirroring on Xperia XZ1 compact. The procedure for how it is done currently can be found here crediting to @M-Rom. A magisk module that does this would be great. Posting the method again in this thread below.
M-Rom said:
[oreo] WifiDisplay fix
WfdService.apk
smali\com\sonymobile\wifidisplay\WFDSessionHelper.smali
Remove red
.method public monitorForegroundApp()V
.locals 3
.prologue
.line 107
const-string/jumbo v0, "user"
sget-object v1, Landroid/os/Build;->TYPE:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
if-nez v0, :cond_0
.line 108
const-string/jumbo v0, "1"
const-string/jumbo v1, "persist.debug.wfd.appmonitoring"
const-string/jumbo v2, "0"
invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/StringLjava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
.line 107
if-eqz v0, :cond_0
.line 109
const-string/jumbo v0, "WFDSessionHelper"
const-string/jumbo v1, "Disable foreground application monitoring"
invoke-static {v0, v1}, Lcom/qualcomm/wfd/Log;->d(Ljava/lang/String;Ljava/lang/StringV
.line 110
return-void
.line 113
:cond_0
new-instance v0, Ljava/lang/Thread;
new-instance v1, Lcom/sonymobile/wifidisplay/WFDSessionHelper$1;
invoke-direct {v1, p0}, Lcom/sonymobile/wifidisplay/WFDSessionHelper$1;-><init>(Lcom/sonymobile/wifidisplay/WFDSessionHelperV
invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/RunnableV
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
.line 140
return-void
.end method
Click to expand...
Click to collapse
system\etc\wfdconfig.xml
Modify 1 to 0
<!-- enable HDCP by default -->
<ContentProtection>
<Valid>1</Valid>
<!--
Valid values WFD_HDCP_2_0,
WFD_HDCP_2_1 and WFD_HDCP_2_2
-->
<Version>WFD_HDCP_2_2</Version>
<CPPort>6789</CPPort>
<!--
turn on/off audio encryption
-->
<EncryptAudio>1</EncryptAudio>
</ContentProtection>
Click to expand...
Click to collapse
system\build.prop
Delete persist.debug.wfd.enable=1
Add persist.debug.wfd.appmonitoring=1
Click to expand...
Click to collapse
Thanks to @russel5 for creating the magisk module to fix this. Linking back to original fix thread.
https://forum.xda-developers.com/showpost.php?p=77757846&postcount=10

Categories

Resources