Deprecated: Version 2.0 is now LIVE! (12/17/2010), this version is still based on 3.29x ROM OTA, as I wanted to see this through from start to finish, rather than drop what I have been working on for many weeks, and start over again.
Deprecated:Version 2.1 is now LIVE! (12/19/2010), this version is based on 3.70x ROM OTA. Pick your poison based on the ROM you are running. There are no feature differences between 2.0/2.1, 2.1 is simply a port to the newer 3.70 OTA framework / release.
Update 3/27/2011:Version 2.2 is now LIVE, this is a maintenance release for the most part, including a fix for 4g toggle state persistence between reboots. That is, when disabling 4g via its toggle, it will remain disabled after a reboot, nice! Also, this version incorporates the fix for toggling the sprint wifi access point (toggleWifiAp). I am releasing in 2 versions. The complete mod for those that are flashing new, or the services.jar file only, which is the only file affected by this maintenance release. See towards the end of post for your applicable file.
See Here for installing the PowerWidgets Configuration Application, for controlling behavior of various widgets.
This thread supersedes the v1.0 (original) thread found here. As mentioned in the v1.0 thread, thanks to the CyanogenMod team for the original creation that this is based upon.
It should be noted that all of the various customizations found in the original thread will have to be re-done / re-incorporated into the v2.0/2.1 files attached, and I have more on my plate that I can tackle in terms of trying to provide each and every individual request for specific customizations.
New in v2.0/2.1 is the inclusion/addition of my custom built 4G toggle (toggleWimax), as well as a nice fix for keeping the icon and indicator bars in sync with the actual state of the various services controlled by the widget. This is accomplished by auto-refreshing the widgets each time the notification window is dragged open/close. This mod requires running a deodexed Sprint based ROM.
So, now, as opposed to v1.0, if you change the state of a given service elsewhere on the phone, when you drag open the notification window, your icons and indicator bar will be in sync with the actual state, without having to manually toggle a random widget to refresh. Nice!
Much of what follows is copy/paste from the original thread, for everyone's edification, with, as referenced above, mention that to add 4G toggle to your list of available power control widgets, place "toggleWimax" in your widget.txt file.
So, what does this look like you say? Below is a screen shot of the default widgets that this mod comes with:
The 6 default widgets, from left-to-right are:
toggleGPS | toggleWifi | toggleBluetooth | toggleMobileData| toggleFlashlight | toggleSound
What's great about this mod, however, is that you can override this set of default widgets in favor of any of the13 14 15 currently available widgets through a process I've built into the mod (explained later).
The power control bar allows for up to 6 different widgets to be specified. You can have less, but no more than 6 (as designed in the original CM version). As mentioned, there are a total of 15 widgets that I've ported or created successfully so far. Here are a few more screen captures of some of the remaining available widgets:
The 4 widgets, from left-to-right are:
toggleAirplane | toggleAutoRotate (disable landscape mode) | toggleBrightness (3 tiers) | toggleScreenTimeout (prevent screen from going black)
And the 4 remaining available widgets, from left-to-right are:
toggleWimax | toggleSleepMode (put phone to sleep) | toggleSync | toggleLockScreen (disable lockscreen)
Not included in the current crop of screen captures if the toggle for the built-in Sprint wifi access point toggle (toggleWifiAp).
Take note of the naming convention I've used above for each widget. This is how Android, internally, is referencing each widget for use / display in the power control bar. This is important, since, as mentioned, you can override the 6 widgets this mod provides out of the box.
How you ask?
By creating a pipe delimited list (|) of widgets in a one-line text file named widget.txt, and dropping this file into the '/system/customize/' folder on your phone.
So, say you want your power control bar to contain 4 widgets for 4G, Wifi, Bluetooth, and Sync. You would create a one-line file using the following syntax:
Note: there CANNOT be any spaces between each widget defined, and the pipe delimiter is only placed between each instance, but not at the beginning or end. The syntax has to be EXACT, and case must match EXACTLY. If you have an error in your list, the slot / position where the error exists will result in an empty slot on your power control bar. If you fubar it bad enough, you'll probably bootloop your phone, so please use caution and check your work.
Once you've created your file, again, named widget.txt, all lower-case, using adb, push to your phone (the following commands assume your widget.txt file is in the same folder where you are issuing the adb commands):
Alternatively, drop your 'widget.txt' file on your sdcard, and use root explorer to copy the file to your clipboard, navigate to your '/system/customize/' folder, mount as r/w, paste the file in place, make sure permissions on the new file are set to 'read', at a minimum, and reboot.
If you are not comfortable with either of these options, you can create a signed zip of your widget.txt file to flash to your phone via recovery instead.
Want to go back to the default widget setting? Simply rename or delete the 'widget.txt' file in your '/system/customize/' folder and reboot.
I know not everyone has (maybe most) 4G service, so I did not include 4G as a default widget. For those that do, here is a flashable zip to easily change your widgets to the following, which is what I run:
toggleGPS | toggleWifi | toggleWimax | toggleBluetooth | toggleFlashlight | toggleSound
Widget Bar with Wimax <--- Flash via recovery AFTER applying the actual mod linked below.
For your reference, when creating your 'widget.txt' file, here is the complete list of available widgets with correct syntax that you can copy / paste into your file (don't forget to pipe delimit them):
FYI, I've added in toast notification messages when toggling WiFi, Bluetooth, and 4G, so as to acknowledge your button press, as these options take a bit to instantiate. Since 4G takes even longer to establish a connection, if you attempt to toggle while it is still working, a toast notification will also display indicating that the toggle is still in progress.
This port / mod involves massive edits to your framework files, including framework.jar, services.jar, and framework-res.apk. As such, by flashing this mod, you will undo most mods / themes you have applied to your phone. There is no choice in the matter. Consider this your new / base / stock set of framework files if you wish to use, and modify to incorporate your own themes / mods accordingly. Or, if you don't want to lose your customizations, wait for your ROM dev, or themer to grab this port as a starting point to apply their changes.
You CANNOT flash this mod to implement the power control widget, and then flash a theme back over top it, if the theme replaces the framework-res.apk file (most likely do), as it will likely completely bork your phone, resulting in bootloops, as the theme will partially undo this mod, resulting in breaking both the mod and your phone
If the theme is a MetaMorph file, assuming the MetaMorph does not change any of the XML or other files that this mod does, and only changes images, etc, you should be safe in applying.
It should be noted that in the framework files provided in the flashable zip at the end of this post, the following additional mods have been included by default in the services.jar & framework.jar file:
Download Notification Window Power Control Widget v2.2 for 3.70x OTA Based ROMs <--- Flash via Recovery for entire mod. If you are already running previous v2.1, flash the services.jar file only, linked below.*
Download Services.jar Patch (v2.2) for 3.70x OTA Based ROMs <--- Flash via Recovery, ONLY if you are already running the previous v2.1, to update your services.jar file only.*
*Since this replaces framework files, your initial boot will take some time. Please be patient and NANDROID before flashing. I've also seen it take 2 boots, rather than one, to come up fully after the initial install. This is a major rework to the included files and it is certainly possible that it is incompatible with your specific setup. YMMV.
**This is provided stock. If you want a different look, colors, icons, etc, this is up to you and/or your favorite dev to have at it .
Deprecated:
Update 3/27/2011:Version 2.2 is now LIVE, this is a maintenance release for the most part, including a fix for 4g toggle state persistence between reboots. That is, when disabling 4g via its toggle, it will remain disabled after a reboot, nice! Also, this version incorporates the fix for toggling the sprint wifi access point (toggleWifiAp). I am releasing in 2 versions. The complete mod for those that are flashing new, or the services.jar file only, which is the only file affected by this maintenance release. See towards the end of post for your applicable file.
See Here for installing the PowerWidgets Configuration Application, for controlling behavior of various widgets.
This thread supersedes the v1.0 (original) thread found here. As mentioned in the v1.0 thread, thanks to the CyanogenMod team for the original creation that this is based upon.
It should be noted that all of the various customizations found in the original thread will have to be re-done / re-incorporated into the v2.0/2.1 files attached, and I have more on my plate that I can tackle in terms of trying to provide each and every individual request for specific customizations.
New in v2.0/2.1 is the inclusion/addition of my custom built 4G toggle (toggleWimax), as well as a nice fix for keeping the icon and indicator bars in sync with the actual state of the various services controlled by the widget. This is accomplished by auto-refreshing the widgets each time the notification window is dragged open/close. This mod requires running a deodexed Sprint based ROM.
So, now, as opposed to v1.0, if you change the state of a given service elsewhere on the phone, when you drag open the notification window, your icons and indicator bar will be in sync with the actual state, without having to manually toggle a random widget to refresh. Nice!
Much of what follows is copy/paste from the original thread, for everyone's edification, with, as referenced above, mention that to add 4G toggle to your list of available power control widgets, place "toggleWimax" in your widget.txt file.
So, what does this look like you say? Below is a screen shot of the default widgets that this mod comes with:
The 6 default widgets, from left-to-right are:
toggleGPS | toggleWifi | toggleBluetooth | toggleMobileData| toggleFlashlight | toggleSound
What's great about this mod, however, is that you can override this set of default widgets in favor of any of the
The power control bar allows for up to 6 different widgets to be specified. You can have less, but no more than 6 (as designed in the original CM version). As mentioned, there are a total of 15 widgets that I've ported or created successfully so far. Here are a few more screen captures of some of the remaining available widgets:
The 4 widgets, from left-to-right are:
toggleAirplane | toggleAutoRotate (disable landscape mode) | toggleBrightness (3 tiers) | toggleScreenTimeout (prevent screen from going black)
And the 4 remaining available widgets, from left-to-right are:
toggleWimax | toggleSleepMode (put phone to sleep) | toggleSync | toggleLockScreen (disable lockscreen)
Not included in the current crop of screen captures if the toggle for the built-in Sprint wifi access point toggle (toggleWifiAp).
Take note of the naming convention I've used above for each widget. This is how Android, internally, is referencing each widget for use / display in the power control bar. This is important, since, as mentioned, you can override the 6 widgets this mod provides out of the box.
How you ask?
By creating a pipe delimited list (|) of widgets in a one-line text file named widget.txt, and dropping this file into the '/system/customize/' folder on your phone.
So, say you want your power control bar to contain 4 widgets for 4G, Wifi, Bluetooth, and Sync. You would create a one-line file using the following syntax:
Code:
toggleWimax|toggleWifi|toggleBluetooth|toggleSync
Note: there CANNOT be any spaces between each widget defined, and the pipe delimiter is only placed between each instance, but not at the beginning or end. The syntax has to be EXACT, and case must match EXACTLY. If you have an error in your list, the slot / position where the error exists will result in an empty slot on your power control bar. If you fubar it bad enough, you'll probably bootloop your phone, so please use caution and check your work.
Once you've created your file, again, named widget.txt, all lower-case, using adb, push to your phone (the following commands assume your widget.txt file is in the same folder where you are issuing the adb commands):
Code:
adb remount
adb push widget.txt /system/customize/
adb reboot
Alternatively, drop your 'widget.txt' file on your sdcard, and use root explorer to copy the file to your clipboard, navigate to your '/system/customize/' folder, mount as r/w, paste the file in place, make sure permissions on the new file are set to 'read', at a minimum, and reboot.
If you are not comfortable with either of these options, you can create a signed zip of your widget.txt file to flash to your phone via recovery instead.
Want to go back to the default widget setting? Simply rename or delete the 'widget.txt' file in your '/system/customize/' folder and reboot.
I know not everyone has (maybe most) 4G service, so I did not include 4G as a default widget. For those that do, here is a flashable zip to easily change your widgets to the following, which is what I run:
toggleGPS | toggleWifi | toggleWimax | toggleBluetooth | toggleFlashlight | toggleSound
Widget Bar with Wimax <--- Flash via recovery AFTER applying the actual mod linked below.
For your reference, when creating your 'widget.txt' file, here is the complete list of available widgets with correct syntax that you can copy / paste into your file (don't forget to pipe delimit them):
Code:
toggleWifiAp
toggleWimax
toggleAirplane
toggleAutoRotate
toggleBluetooth
toggleBrightness
toggleFlashlight
toggleGPS
toggleLockScreen
toggleMobileData
toggleScreenTimeout
toggleSleepMode
toggleSound
toggleSync
toggleWifi
FYI, I've added in toast notification messages when toggling WiFi, Bluetooth, and 4G, so as to acknowledge your button press, as these options take a bit to instantiate. Since 4G takes even longer to establish a connection, if you attempt to toggle while it is still working, a toast notification will also display indicating that the toggle is still in progress.
This port / mod involves massive edits to your framework files, including framework.jar, services.jar, and framework-res.apk. As such, by flashing this mod, you will undo most mods / themes you have applied to your phone. There is no choice in the matter. Consider this your new / base / stock set of framework files if you wish to use, and modify to incorporate your own themes / mods accordingly. Or, if you don't want to lose your customizations, wait for your ROM dev, or themer to grab this port as a starting point to apply their changes.
You CANNOT flash this mod to implement the power control widget, and then flash a theme back over top it, if the theme replaces the framework-res.apk file (most likely do), as it will likely completely bork your phone, resulting in bootloops, as the theme will partially undo this mod, resulting in breaking both the mod and your phone
If the theme is a MetaMorph file, assuming the MetaMorph does not change any of the XML or other files that this mod does, and only changes images, etc, you should be safe in applying.
It should be noted that in the framework files provided in the flashable zip at the end of this post, the following additional mods have been included by default in the services.jar & framework.jar file:
- Allow for transparent notification menu background (xeudoxus & fxn)
- Remove USB Debugging icon
- Remove GPS off reticle icon, retain GPS on reticle
- USB Tether / Hotspot Fix (aamikam)
Download Notification Window Power Control Widget v2.2 for 3.70x OTA Based ROMs <--- Flash via Recovery for entire mod. If you are already running previous v2.1, flash the services.jar file only, linked below.*
Download Services.jar Patch (v2.2) for 3.70x OTA Based ROMs <--- Flash via Recovery, ONLY if you are already running the previous v2.1, to update your services.jar file only.*
*Since this replaces framework files, your initial boot will take some time. Please be patient and NANDROID before flashing. I've also seen it take 2 boots, rather than one, to come up fully after the initial install. This is a major rework to the included files and it is certainly possible that it is incompatible with your specific setup. YMMV.
**This is provided stock. If you want a different look, colors, icons, etc, this is up to you and/or your favorite dev to have at it .
Last edited: