[Sprint Samsung Galaxy S III] tdunham:
[How-to] Make Toggles Stick in QuickPanel

[How-to] Make Toggles Stick in QuickPanel

(Please do not Quote when replying to this post as it is rather lengthy. ;))

For the Devs (a work in progress).

I am running 4.4.2 on the Galaxy S5 and to get the extra hidden toggles and flashlight toggle to stick permanently through a notification panel reset I edited the settings.db file via a script. I'm sure the script can be implemented into a full rom to make your new toggles a permanent addition too. :)

If you want to see how I did it, refer to the flashlight toggle mod I did HERE (download v2.x NOT v2 for the best example) and follow the bread crumbs through the installer script to see how the script is implemented via a flashable zip.

First of all, while my database script may work as it is, you REALLY need to get the database entries for YOUR phone.

Using SQL Editor, I navigate to data/data/com.android.providers.settings/database/settings.db.

I copy & pasted the entire stock entries for these three entries to a text file on the phone. I'm sure you could write them all down but be careful the names are case sensitive.:

[B]notification_panel_active_app_list_for_reset
[/B]Wifi;Location;SilentMode;AutoRotate;Bluetooth;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;

[B]notification_panel_default_active_app_list[/B]
Wifi;Location;SilentMode;AutoRotate;Bluetooth;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;

[B]notification_panel_active_app_list
[/B]Wifi;Location;Bluetooth;AutoRotate;SilentMode;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;

Then I add the new Flashlight; entry to the end of each line (it can be placed anywhere as long as you make certain you keep the naming convention with the ';' beween each entry and at the end of code).

Here is an example of the script that I run. It REPLACES the entire database entry instead of appends. Again, check the thread quoted above to see how it was implemented. Thanks to [MENTION=4645794]CNexus[/MENTION] for the original installer and [MENTION=3065070]Goldie[/MENTION] for the method to update the database:

#!/sbin/sh
/sbin/mount -a
#add extra toggles on boot
if [ -e /data/data/com.android.providers.settings/databases/settings.db ];
then
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='Wifi;Location;Bluetooth;AutoRotate;SilentMode;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;MobileData;WiFiHotspot;Flashlight;' where name='notification_panel_active_app_list'";
fi
if [ -e /data/data/com.android.providers.settings/databases/settings.db ];
then
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='Wifi;Location;SilentMode;AutoRotate;Bluetooth;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;MobileData;WiFiHotspot;Flashlight;' where name='notification_panel_active_app_list_for_reset'";
fi
if [ -e /data/data/com.android.providers.settings/databases/settings.db ];
then
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='Wifi;Location;SilentMode;AutoRotate;Bluetooth;UltraPowerSaving;MultiWindow;Toolbox;AllShareCast;Nfc;Sync;SmartStay;SmartPause;PowerSaving;DormantMode;AirplaneMode;PersonalMode;TouchSensitivity;MobileData;WiFiHotspot;Flashlight;' where name='notification_panel_default_active_app_list'";
fi
if [ -e /data/data/com.android.providers.settings/databases/settings.db ];
then
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='15' where name='notification_panel_active_number_of_apps'";
fi
if [ -e /data/data/com.android.providers.settings/databases/settings.db ];
then
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='15' where name='notification_panel_active_number_of_apps_for_reset'";
fi;

Hope this helps someone and if you find a different method to add toggles, please share.

Cheers - TD