[Samsung Epic 4G Touch] majdinj:
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).

I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..

I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM

Here are the changes that I noticed:

1) For SystemUI.apk:

- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.

- I added the following strings to strings.xml in values folder:

<string name="quickpanel_flashlight_text">Torch</string>

other strings for airplane and notifications are already there.

- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk

- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder

- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:

.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"

.prologue
const/4 v6, 0x0

.line 35
const/4 v2, 0x0

const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]

const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]

const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]

move-object v0, p0

- Then I recompiled the finished SystemUI project.

2) For SecSettings.apk:

- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]

- Then I added these strings to strings.xml in values folder:

<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>

- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.

- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):

.method public MakeConvertPanelName()V
.locals 3

.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "Wifi"

const-string v2, "notification_panel_wifi"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

..
..
..
const-string v1, "Sync"

const-string v2, "notification_panel_sync"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "Flashlight"

const-string v2, "notification_panel_flashlight"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

const-string v1, "Empty"

const-string v2, "notification_panel_empty"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "AirplaneMode"

const-string v2, "notification_panel_airplane"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

const-string v1, "Empty"

const-string v2, "notification_panel_empty"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "DoNotDisturb"

const-string v2, "notification_panel_notification"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

const-string v1, "Empty"

const-string v2, "notification_panel_empty"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]

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

const-string v1, "Empty"

const-string v2, "notification_panel_empty"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "notification_panel_wifi"

const-string v2, "Wifi"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "notification_panel_gps"

const-string v2, "Location"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

..
..
..

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

const-string v1, "notification_panel_sync"

const-string v2, "Sync"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "notification_panel_flashlight"

const-string v2, "Flashlight"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "notification_panel_airplane"

const-string v2, "AirplaneMode"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

const-string v1, "notification_panel_notification"

const-string v2, "DoNotDisturb"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "notification_panel_empty"

const-string v2, "Empty"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

.line 153
return-void
.end method

- Then I recompiled the finished project...

Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..

I consulted Mirko_ddd again and he said:

I added the new toggles name to strings in SecSettingsProvider.apk like what he did:

<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>

But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..

This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,

Resources are in the attachment ;)

Cheers