yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S III] The Sickness:
Yes they are added. But I just noticed that when I go to edit the tiles the flashlight isn't there. I will decompile settings again to make sure the image is there. That's probably the problem
[Sprint Samsung Galaxy S III] The Sickness:
OK. I decompiled SecSettings.apk and the notification_panel_flashlight png was in my drawable-xxhdpi folder. It is also present in my SystemUI.apk. I do have the toggle, and it does work when pressed. But its just a blank toggle that says Flashlight under it.

I looked over all of the steps again, and I dont believe I missed anything. Ideas?
[Sprint Samsung Galaxy S III] CNexus:
The only thing it could be would be that you either forgot to add the images, or you renamed the images when you added them to sysui
[Sprint Samsung Galaxy S III] The Sickness:
Images are there. I just looked. And I didnt rename them. I copied and paste the ones you provided. Im going to redo the entire process and see what happens.
[Sprint Samsung Galaxy S III] CNexus:
Try booting into recovery and doing a dalvik cache wipe first
[Sprint Samsung Galaxy S III] The Sickness:
No change
[Sprint Samsung Galaxy S III] CNexus:
Try redoing the mod just for systemui then

You used the right files from the OP right?
[Sprint Samsung Galaxy S III] The Sickness:
Yes, I used what you provided.

---------- Post added at 06:10 PM ---------- Previous post was at 05:51 PM ----------

That did it bro.....Im all good now. Thank you very much for your help.

---------- Post added at 06:20 PM ---------- Previous post was at 06:10 PM ----------

Thanks for all of your help bro.....
[Sprint Samsung Galaxy S III] The Sickness:
LOL....I just noticed that the flashlight IS NOT in the notifications panel......but the toggle works. Man this is tripping me out. Is this correct?

.line 666
iget-object v0, p0, Lcom/android/settings/NotificationPanelMenu;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "Flashlight"

const-string v2, "notification_panel_flashlight"

const-string v1, "Flashlight"

const-string v2, "notification_panel_flashlight"

Im just trying to figure out WHY the tile isnt showing up in notification panel.....
[Sprint Samsung Galaxy S III] CNexus:
No, that's not correct. You literally just need to copy the code that I provide.
[Sprint Samsung Galaxy S III] decalman:
On SecSettings/smali/com/android/settings i was adding the lines all the way at the bottom. i searched for

.method private makeConvertPanelName

and at the end of that section i added the needed lines

and on SecSettings/res/values/strings.xml i was also adding the needed lines all the way at the end. i looked for where the strings started to look like

<string name="notification_panel_

and i place the line here

My Tapatalk Signature

http://youtu.be/53ovtKPdrPE

http://youtu.be/FBkGF1XfvZI
[Sprint Samsung Galaxy S III] SAMERKAD:
[MENTION=4645794]CNexus[/MENTION] how to add Smart network toggle and network restriction Toggle ? to 4.4.2 Stock ROM? rooted though on Note 3 N9005
[Sprint Samsung Galaxy S III] The Sickness:
Problem was I used out dated smali mod. I updated it and I'm all good.

Thanks for your help and support.

My Kat Is Insane

Deviant Development Team Member
[Sprint Samsung Galaxy S III] CNexus:
:thumbup:
[Sprint Samsung Galaxy S III] Netuser:
[MENTION=4645794]CNexus[/MENTION] Thanks for this great guide, i learn some stuff :)

I need a little bit of your help please, I don't want to have those 2 underline bars under the icon, what part of the code should I edit/delete to get rid of it please ?

The fat one i can get rid of it by deleting and image file in my drawable folder (but maybe this image serve other purpose so I want to keep it if possible) but the thin line in 2nd screenshot is some where in your code, and I cant find it how to get rid of it :(

See attach screenshot:

Thanks a lot for your help :)
[Sprint Samsung Galaxy S III] lijianjunyonghu:
Can you help me? Kitkat 4.4.2 N7100:crying:
[Sprint Samsung Galaxy S III] CNexus:
QuickSettingButton.smali you need to set that view to GONE (0x8) using a call to setVisibility

I forget what the field that holds that view is called but it'll be something like this

iget-object v0, p0, Lcom/android/systemui/policy/quicksetting/QuickSettingButton;->FIELD_NAME_HERE:Landroid/view/View;
const v1, 0x8
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
[Sprint Samsung Galaxy S III] Netuser:
Thanks for the reply :)

I am sorry I know nothing about smali or java :( What should i do with this code ? And how become other icons don't have underline but only the flash light ?

can you please give a little more noob instructions

Thanks
[Sprint Samsung Galaxy S III] Netuser:
[MENTION=4645794]CNexus[/MENTION]

I searched by image id and find this in Quicksetting button that refer to that image which is the Thicker underline : Can i comment or edit any part to make it not load the underline ? What about the thinner underline which is not part of any image, dont know from where it is coming :(

.line 285
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mBtnLED:Landroid/widget/ImageView;

const v1, 0x7f0201a1

invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V
[Sprint Samsung Galaxy S III] CNexus:
Place this code immediately after the setImageResource line

const v1, 0x8
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
[Sprint Samsung Galaxy S III] Netuser:
Thanks :) Ok I will try it now, But i posted the wrong code :( that was for dim image

Here is the On and Off bottom bar image id that are all together :

.method public setActivateStatus(I)V
.locals 4
.parameter "activateStatus"

.prologue
const v3, 0x7f02022a

const v2, 0x7f02022b

.line 245
iput p1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mActivateStatus:I

.line 247
iget v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mTextID:I

if-eqz v0, :cond_0

---------- Post added at 10:51 PM ---------- Previous post was at 10:31 PM ----------

[MENTION=4645794]CNexus[/MENTION] YESSS You are Amazing :D it worked here is the code I put as you told but after v2 and v3 But now I still have that 2nd thin line left :( How to get rid of that now (screenshot added, think line gone thin one is still here )?

invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setImageResource(I)V

const v2, 0x8
invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

Also I have another question, all my other toggle are not shown by ON and Off image but only 1 image called round at the end of image for exemple : tw_quick_panel_icon_airplane_round.png

Then if I turn on it will show these above mention image on a background image which is : tw_quick_panel_quick_setting_button_round_bg_on.png or if it is turn on it will show it on tw_quick_panel_quick_setting_button_round_bg_off.png

Is it possible to modify your code to do same with Flashlight meaning I have 1 image called tw_quick_panel_icon_flashlight_round.png that will show on aboive mentioned BG On and Off image instead of different On off image ? : or I am forced to use On and Off image ?

Thanks so much for all your help. I am also learning so much with all these edit :)
[Sprint Samsung Galaxy S III] Netuser:
[MENTION=4645794]CNexus[/MENTION] sorry to bump this, do you have any idea how to do those 2 things ?

-Remove thin underline

-Use 1 icon with flash light with On and Off background image change.

Do you need me to post any files that can help you how it is done for other toggles ?

Thanks again for all your help :)
[Sprint Samsung Galaxy S III] CNexus:
I'm not sure...since it doesn't work like that on my device that is

I hesitate to do things that I can't test myself unless it's really simple, and this looks to require some more digging...maybe ask for help from one of your local forum devs?
[Sprint Samsung Galaxy S III] Netuser:
Ok thanks :)

Will see for that part with the developer of the Rom I hope he can help me. :)

And what about the Thin line how can get rid of it ? Where it is coming from As I see many other who posted there Screenshot with just icons and no underline in those icons. Do you have any idea ? I also tried with plain Stock systemui and I am getting same result with that underline :S
[Sprint Samsung Galaxy S III] icedventimocha:
Great guide. Got the SystemUI.apk edited successfully, but when I build SecSettings.apk it will not smali file. I just copied and pasted the lines provided in the OP, not sure what I'm doing wrong. Tried with 2 versions of apktool several times with no success. Any ideas would be tits. Verizon Galaxy Note II on 4.3 touchwiz.

EDIT:Nevermind, had to have been doing something basic wrong. I guess 112th times a charm lol.

Sent from my Galaxy Note II
[Sprint Samsung Galaxy S III] android.zealot.fervor:
Your files are romoved. Can you reupload them please ?

Thanks
[Sprint Samsung Galaxy S III] 1brainsurgeon:
Thanks again cnexus for eliminating the need to use a 3rd party apk. Gotta have my flashlight easily accessible. It gets dark, especially on garbage-to-the-curb nights.
[Sprint Samsung Galaxy S III] CNexus:
What for? The method has been updated and it's extremely easy now, add to strings.xml and then copy/paste the smali for the toggle
[Sprint Samsung Galaxy S III] android.zealot.fervor:
I just wanted to use them as reference. Anyways I got it working. Thanks once again for your efforts brother :)

One thing.....brother can post more guides like how to port note 3 water colour effect ?
[Sprint Samsung Galaxy S III] deuce_biggins:
I'm experiencing an issue. The flashlight works great until I reset my notification panel...then it disappears. Has anyone else had this problem or can someone help with a solution?
[Sprint Samsung Galaxy S III] icedventimocha:
You will need to reflash the zip provided every time you reset the toggles/ wipe caches if i'm not mistaken as it edits a db file.

Sent from my Galaxy Note II
[Sprint Samsung Galaxy S III] :
Thanks [MENTION=4645794]CNexus[/MENTION] for the info on the mod.
[Sprint Samsung Galaxy S III] Androidwarrior:
I've been trying to figure this out for my note 3 but i can't seem to get it..
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
Hey there [MENTION=4645794]CNexus[/MENTION], I've been trying to impliment this into 4.4.2 but I'm getting the following error. It appears to be in the smali file I dled from the OP. I'm not good with smali so I thought I would ask if you know what I need to be changing here? (Yes I used the 4.4 zip.)

Recompiling "SystemUI.apk" With Original Signature,
using "apktool_2.0.0b9.jar"

With Tickle My Android v9.0.
(tinyurl.com\ticklemyandroid)

----------------

I: Using Apktool 2.0.0-Beta9 on SystemUI.apk
I: Smaling...
..\_working\SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting\Flashlig
htQuickSettingButton.smali[22,4] Error for input '.parameter': Invalid directive
..\_working\SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting\Flashlig
htQuickSettingButton.smali[22,15] mismatched input '"context"' expecting END_METHOD_DIRECT
IVE
..\_working\SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting\Flashlig
htQuickSettingButton.smali[121,4] Error for input '.parameter': Invalid directive
..\_working\SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting\Flashlig
htQuickSettingButton.smali[121,15] mismatched input '"paramBoolean"' expecting END_METHOD_
DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/andr
oid/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

----------------

Recompile Not Successful!
[Sprint Samsung Galaxy S III] CNexus:
Use apktool 1.5.2
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
Thanks that got it to recompile. :good: However the toggle doesn't show up in either the pull down or the settings. Do I need to enable it somehow in 4.4.2?
[Sprint Samsung Galaxy S III] CNexus:
Yeah you can't just add the code and it will show

Flash the enable zip from the OP
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
DOUGH! I can't believe I missed that. Thanks.
[Sprint Samsung Galaxy S III] Versatile1:
I can't get SystemUI to recompile using 1.5.2 either.
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
This is the tool I wound up using to get it to recompile.

http://xdaforums.com/showthread.php?t=2326604

I should mention though that I still haven't been able to get this mod to work on my device. I can get the toggle to show up in settings but not in the quicksetting toggles.
[Sprint Samsung Galaxy S III] Versatile1:
Yeah I finally pulled it from another 4.4 system then added it and recompiled. I'm in the same spot. Toggle shows in Quicksettings menu but not Status bar.
[Sprint Samsung Galaxy S III] and2:
Did you install the first file from the OP? Because it has to be written in the settings.db. The other options are use a sql editor or a factory reset.
[Sprint Samsung Galaxy S III] Versatile1:
I used the SQLite app, but yes the edits are there
[Sprint Samsung Galaxy S III] tdunham:
+1

Android 4.4.2 ND2 build, Galaxy S5.

Same boat. I can't get the database to load with SQLite (error 14, I made sure the SD write permission fix is there but no go with the editor still) but I can still view it with romtoolbox and The Flashlight entry is there. It only shows in the notifications panel editor.
[Sprint Samsung Galaxy S III] tdunham:
Here are the database entries. AFIK, everything looks ok BUT if you look at the last screenshot, there is a duplicate entry for notification_panel_active_app_list and it is located as the very last entry like it was added last.

I've tried adding Flashlight entry manually to the duplicate entry and deleting the entire duplicate entry and still the same results.

Edit: FYI, I think if the entry is added to the database entry notification_panel_active_app_list_for_reset, it doesn't disappear if you do a reset to the quickpanel in edit mode or maybe its the default active app list entry.
[Sprint Samsung Galaxy S III] tdunham:
Finally got back to this.
[MENTION=4645794]CNexus[/MENTION] I'm getting this method call error. What do you think?

No force close just the error and same results as the last several posts.

Tnx - TD

[ 05-26 08:12:46.141 1148: 1148 I/dalvikvm ]

Could not find method com.android.systemui.statusbar.policy.quicksetting.FlashlightQuickSettingButton.initLayout, referenced from method com.android.systemui.statusbar.policy.quicksetting.FlashlightQuickSettingButton.<init>

[ 05-26 08:12:46.141 1148: 1148 W/dalvikvm ]

VFY: unable to resolve virtual method 4611: Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;.initLayout (IIIIII)V
[Sprint Samsung Galaxy S III] CNexus:
Ahh, looks like they did something different with our code versus the S4 KK toggle initialization

I'll take a look at it today
[Sprint Samsung Galaxy S III] tdunham:
The other fellows should submit logcats as well if possible to see if their issue is similar. :)

Edit: I wonder if I should revert back to the public values for that method instead of pulling resources. Do you think that would work?

I don't have the older method where you used that. Repost it if you think that may be the case so I can adapt it and try it out.

Tnx
[Sprint Samsung Galaxy S III] CNexus:
No it's not that

On the S4 they replaced a call to the constructor that takes all the icon ids with a call to an emptier constructor followed by a call to initLayout that did take the ids

In our code that logcat tells me that they did not do it that way on kitkat for us, so I'll have to see if they left it the same (you can try seeing if the 4.3 smali works meanwhile) or if they made it something different from our 4.3 code and the S4 KK code
[Sprint Samsung Galaxy S III] tdunham:
I'll try that right now and post the results.

Edit: Not sure this is right but this is all I can find.

[ 05-26 14:08:28.253 1153: 1153 W/STATUSBAR-QuickSettingPanel ]

FlashlightInvocationTargetException

[ 05-26 14:08:28.253 889: 889 W/ContextImpl ]

Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1847 android.content.ContextWrapper.startService:506 com.qualcomm.location.GeoFenceService.startAdditionalServices:131 com.qualcomm.location.GeoFenceService.onBind:97 android.app.ActivityThread.handleBindService:2762

[ 05-26 14:08:28.253 1153: 1153 W/STATUSBAR-QuickSettingPanel ]

FlashlightInvocationTargetException

Update:

I'm going to try just replacing the public constructor in the 4.4 smali from 4.3 next.

---------- Post added at 06:22 PM ---------- Previous post was at 06:02 PM ----------

Replacing just the public constructor method taken from the 4.3 smali results in the same error method not found as in post #278 I left previously.

---------- Post added at 06:43 PM ---------- Previous post was at 06:22 PM ----------

Here is the S5 decompressed smali. Maybe seeing the other quickconnect smali's will help with figuring out how to alter ours.

https://www.dropbox.com/s/amahyjigx80lv4a/smali.rar
[Sprint Samsung Galaxy S III] tdunham:
[MENTION=4549997]Chad The Pathfinder[/MENTION] [MENTION=293203]vesatile1[/MENTION]

Here is a new smali for SystemUI that is working for me on 4.4.2.

Give it a try and let me know how it works for you. I fought with this bad boy for quite a while. :rolleyes:

Instructions:

This smali requires you to compile then decompile your completed SystemUI (then compile one last time once the values are correct) to input the appropriate values for the public construct. I added fields to each line for which public values to look for. You can leave those comment lines in, they will be ignored when you compile the smali.

.method public constructor <init>(Landroid/content/Context;)V
.locals 8

const v2, 0x7f0b0211 [COLOR="Blue"]## quickpanel_flashlight_text[/COLOR]

const v1, 0x7f0b0211 [COLOR="Blue"]## quickpanel_flashlight_text[/COLOR]

const/4 v5, 0x0

const/4 v0, 0x0

sget-boolean v3, Lcom/android/systemui/statusbar/Feature;->mIsTablet:Z

invoke-direct {p0, p1, v0, v3}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V

sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mIsPhone:Z

if-eqz v0, :cond_0

const v3, 0x7f020355 [COLOR="Blue"]## tw_quick_panel_icon_flashlight_on[/COLOR]

const v4, 0x7f020354 [COLOR="Blue"]## tw_quick_panel_icon_flashlight_off[/COLOR]

move-object v0, p0

move v6, v5

move v7, v5

invoke-virtual/range {v0 .. v7}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->initLayout(IIIIIII)V

iput-object p1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mContext:Landroid/content/Context;

:goto_0
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V

return-void

:cond_0
const v0, 0x7f020354 [COLOR="Blue"]## tw_quick_panel_icon_flashlight_off
[/COLOR]
invoke-virtual {p0, v1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->initLayout(III)V

goto :goto_0
.end method

Also see this post:

http://xdaforums.com/showpost.php?p=53122589&postcount=321
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
tdunham that worked perfectly!
[Sprint Samsung Galaxy S III] tdunham:
Very nice.

That was fast. Hopefully Cnexus will give us a modified one that doesn't require the values but I wanted to get a working one out right away anyway. Plus hoping to see a few more out of him soon too. :victory:

Edit: That theme looks familiar. LOL

What phone and rom you running now?
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
I'm still in my gs3 running my own ROM based on CNexus' stock TW 4.4.2. Just haven't released it yet.

Edit: because its not ready yet...
[Sprint Samsung Galaxy S III] tdunham:
No worries man. I see you're using some of Bobcat theme. There are definitely some differences in the images but for the most part a lot of it should work fine anyway, just have to rename a few things to go to the priv-app folder now if you're just flashing it as a theme.
[Sprint Samsung Galaxy S III] talkingmonkeys:
Thanks for this tdunham. Was wondering why the one they put in there and cnexus' didn't work for me, I thought I made a mistake. Was hoping the hidden notification toggle would work since there were images for it but there is no smali. Looking forward to seeing what you can do with this and the others when you have time cnexus.
[Sprint Samsung Galaxy S III] Versatile1:
Worked Great on my S5!! Thank you for your work. I had to edit the smali just a little so it would compile with apktool 2.0.0. I also made some images for the S5 if anyone wants them let me know.

Orig:

.method public constructor <init>(Landroid/content/Context;)V
.locals 8

const v2, 0x7f0b0211 ## quickpanel_flashlight_text

const v1, 0x7f0b0211 ## quickpanel_flashlight_text

Edit:

.method public constructor <init>(Landroid/content/Context;)V
.locals 8
[COLOR="Red"].param p1, "context" # Landroid/content/Context;[/COLOR]
const v2, 0x7f0b0214 ## quickpanel_flashlight_text

const v1, 0x7f0b0214 ## quickpanel_flashlight_text

Orig:

.method public onClick(Z)V
.locals 5
.parameter "paramBoolean"

.prologue
.line 34
const/4 v2, 0x0

.line 35
.local v2, localIntent:Landroid/content/Intent;
const/4 v1, 0x0

.line 37
.local v1, bc:Ljava/lang/String;
const/4 v0, 0x2

.line 39
.local v0, activateStatus:I

Edit:

.method public onClick(Z)V
.locals 5
[COLOR="red"] .param p1, "paramBoolean" # Z[/COLOR]

.prologue
.line 34
const/4 v2, 0x0

.line 35
[COLOR="red"] .local v2, "localIntent":Landroid/content/Intent;[/COLOR]
const/4 v1, 0x0

.line 37
[COLOR="red"] .local v1, "bc":Ljava/lang/String;[/COLOR]
const/4 v0, 0x2

.line 39
[COLOR="red"].local v0, "activateStatus":I[/COLOR]

Orig:

.line 52
new-instance v2, Landroid/content/Intent;

.end local v2 #localIntent:Landroid/content/Intent;
invoke-direct {v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 54
.restart local v2 #localIntent:Landroid/content/Intent;

Edit:

.line 52
new-instance v2, Landroid/content/Intent;

[COLOR="red"].end local v2 # "localIntent":Landroid/content/Intent;[/COLOR]
invoke-direct {v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 54
[COLOR="red"].restart local v2 # "localIntent":Landroid/content/Intent;[/COLOR]

If anyone wants to use apktool 2.0.0