Patch webOS Radio Power Switch

= Seamless Interface =



Introduction
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.

Works with: 1.0.x, 1.1

Procedure
Run the following commands:

In this example, I have the patch file located in my home directory under patches

This is what you should see if it ran properly:

These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:

Acknowledgements

 * pEEf, for figuring everything out
 * HattCzech
 * NetWhiz, for fixing it to work with 1.1.0

Concerns

 * Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.
 * I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -HattCzech

= Original Version =

I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!

I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See Bypassing Activation for info on how to do this.)

This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.

Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.

How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.

Note
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba

Installation
NOTE: If you have never modified any code on the phone, please see Modifying Stock Applications first.

This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!

I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:

Here is the code, Enjoy!

/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:

/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:

/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:

/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:

/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:

Concerns

 * Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.
 * Turn on airplane mode, toggle displays wrong message

Credits
Brought to you by pEEf.