<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Christefano</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Christefano"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/Christefano"/>
	<updated>2026-04-20T06:26:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Talk:Avahi&amp;diff=4466</id>
		<title>Talk:Avahi</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Talk:Avahi&amp;diff=4466"/>
		<updated>2009-08-17T09:09:17Z</updated>

		<summary type="html">&lt;p&gt;Christefano: fixed the S60avahi init.d script. confirming andrew's problem.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;After following the instructions in [[Avahi#Avahi_Installation]] and attempting to start Avahi, I get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;andrew@castle:~$ sudo /opt/sbin/avahi-daemon -D&lt;br /&gt;
Timeout reached while wating for return value&lt;br /&gt;
Could not receive return value from daemon process.&lt;br /&gt;
andrew@castle:~$ ps -ef | grep -i avahi                         &lt;br /&gt;
andrew    2042  2003  0 18:19 pts/0    00:00:00 grep -i avahi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I did remove Avahi, reboot the Pre and try the process from scratch but the result is the same. Thoughts?&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
I can confirm the same errors as andrew's.&lt;/div&gt;</summary>
		<author><name>Christefano</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=4465</id>
		<title>Avahi</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=4465"/>
		<updated>2009-08-17T09:04:27Z</updated>

		<summary type="html">&lt;p&gt;Christefano: fixing minor typos that prevent the init.d script from working.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Avahi=&lt;br /&gt;
[http://avahi.org Avahi] is a Linux service for providing multicast-DNS/DNS-SD (also known as [http://en.wikipedia.org/wiki/Bonjour_%28software%29 Bonjour] or mDNS/DNS-SD). Avahi allows for simple service discovery and advertisement on a local network and provides name resolution for all hosts running a mDNS/DNS-SD service.&lt;br /&gt;
&lt;br /&gt;
Using Avahi allows for easy SSH access over a local wireless network. Once installed and started, users can ssh to their device using their mDNS assigned hostname.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Avahi Installation==&lt;br /&gt;
&lt;br /&gt;
First, mount the root filesystem as writable and install the Avahi ipkg.&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; sudo mount -o remount,rw /&lt;br /&gt;
 $&amp;gt; sudo /opt/bin/ipkg-opt install avahi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avahi currently attempts to access a different dbus system socket than the one provided by the Pre's dbus, so we need to turn off dbus access for the time being. Edit &amp;lt;tt&amp;gt;/opt/etc/avahi/avahi-daemon.conf&amp;lt;/tt&amp;gt; and make the following change:&lt;br /&gt;
&lt;br /&gt;
 Replace this line:&lt;br /&gt;
 #enable-dbus=yes&lt;br /&gt;
 &lt;br /&gt;
 With this line:&lt;br /&gt;
 enable-dbus=no&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point, the Avahi daemon can be started with the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; sudo /opt/sbin/avahi-daemon -D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you would like Avahi to start up at boot, create the following two files: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/init.d/S60avahi'''&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 [ -e /opt/etc/default/avahi ] &amp;amp;&amp;amp; . /opt/etc/default/avahi&lt;br /&gt;
 &lt;br /&gt;
 if [ &amp;quot;$AVAHI_ENABLE&amp;quot; = &amp;quot;no&amp;quot; ]; then&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ -n &amp;quot;`pidof /opt/sbin/avahi-daemon`&amp;quot; ]; then &lt;br /&gt;
     killall /opt/sbin/avahi 2&amp;gt;/dev/null&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 /opt/sbin/avahi-daemon -D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/default/avahi''':&lt;br /&gt;
 AVAHI_ENABLE=yes&lt;br /&gt;
&lt;br /&gt;
Make sure you set the startup script to executable:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; sudo chmod 755 /opt/etc/init.d/S60avahi&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can create an upstart script at '''/etc/event.d/avahi''':&lt;br /&gt;
&lt;br /&gt;
 start on started PmConnectionManager                                            &lt;br /&gt;
                                                                                &lt;br /&gt;
 console output                                                                  &lt;br /&gt;
                                                                                &lt;br /&gt;
 exec /opt/sbin/avahi-daemon -D                                                  &lt;br /&gt;
 respawn &lt;br /&gt;
&lt;br /&gt;
NOTE: This script is not being stored in the /opt directory. You may have to replace it after an update, and it may cause problems with your Pre.&lt;br /&gt;
&lt;br /&gt;
==Connecting via SSH using mDNS==&lt;br /&gt;
&lt;br /&gt;
mDNS uses the system's hostname and appends it to the &amp;lt;tt&amp;gt;local.&amp;lt;/tt&amp;gt; domain. Using the Pre's default &amp;lt;tt&amp;gt;castle&amp;lt;/tt&amp;gt; hostname, the following command would be used to SSH to your Pre on port 222:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; ssh -P 222 castle.local.&lt;br /&gt;
&lt;br /&gt;
'''Note: The system that you are connecting from MUST have a mDNS service also running, else the hostname will not resolve'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Issues==&lt;br /&gt;
&lt;br /&gt;
* The ipkg binary of Avahi attempts to find the dbus socket at &amp;lt;tt&amp;gt;/opt/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;, but the Pre's dbus socket is at &amp;lt;tt&amp;gt;/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;. I haven't investigated tying these two together too much, but the expanded functionality of accessing mDNS via dbus is preferred.&lt;br /&gt;
* The avahi-daemon seems to have issues keeping the mDNS name resolution running for more than a few minutes. I don't know if this is a power management issue or something else at this point.&lt;/div&gt;</summary>
		<author><name>Christefano</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Talk:Avahi&amp;diff=4464</id>
		<title>Talk:Avahi</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Talk:Avahi&amp;diff=4464"/>
		<updated>2009-08-17T09:00:21Z</updated>

		<summary type="html">&lt;p&gt;Christefano: another bug report.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;After following the instructions in [[Avahi#Avahi_Installation]] and attempting to start Avahi, I get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;andrew@castle:~$ sudo /opt/sbin/avahi-daemon -D&lt;br /&gt;
Timeout reached while wating for return value&lt;br /&gt;
Could not receive return value from daemon process.&lt;br /&gt;
andrew@castle:~$ ps -ef | grep -i avahi                         &lt;br /&gt;
andrew    2042  2003  0 18:19 pts/0    00:00:00 grep -i avahi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I did remove Avahi, reboot the Pre and try the process from scratch but the result is the same. Thoughts?&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
There's something wrong with the Avahi instructions but I don't know what. The S60avahi init.d script is executable but I'm getting some weird errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/opt/etc/init.d/S60avahi: line 1: !/bin/sh: No such file or directory&lt;br /&gt;
/opt/sbin/avahi: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I think the &amp;quot;if [ -n &amp;quot;`pidof /opt/sbin/avahi`&amp;quot; ]; then&amp;quot; line should point to /opt/sbin/avahi-daemon but I'm not entirely sure.&lt;/div&gt;</summary>
		<author><name>Christefano</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&amp;diff=3693</id>
		<title>Patch webOS Radio Power Switch</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&amp;diff=3693"/>
		<updated>2009-08-03T09:16:04Z</updated>

		<summary type="html">&lt;p&gt;Christefano: fixing links.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{template:patch}}&lt;br /&gt;
= Seamless Interface =&lt;br /&gt;
&lt;br /&gt;
[[Image:RadioPowerSwitch.jpg|border|right|Radio Power Switch]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Works with: 1.0.x, 1.1&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
&lt;br /&gt;
Run the following commands:&lt;br /&gt;
&lt;br /&gt;
''In this example, I have the patch file located in my home directory under '''patches'''''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
sudo patch -p0 --backup-if-mismatch &amp;lt; ~/patches/radiopower.patch&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what you should see if it ran properly:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
patching file /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js&lt;br /&gt;
patching file /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js&lt;br /&gt;
patching file /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pkill LunaSysMgr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== radiopower.patch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
diff -ur /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js /usr/lib/luna/sysmod/luna-systemui/app/controllers/bar-assistant.js&lt;br /&gt;
--- /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js	2009-07-18 00:21:30.000000000 -0500&lt;br /&gt;
+++ /usr/lib/luna/sysmod/luna-systemui/app/controllers/bar-assistant.js	2009-07-24 00:44:08.000000000 -0500&lt;br /&gt;
@@ -789,6 +789,8 @@&lt;br /&gt;
 				this.callForwardNotificationSession = null;	&lt;br /&gt;
 			}				&lt;br /&gt;
 		}&lt;br /&gt;
+		var stageController = Mojo.Controller.getAppController().getStageProxy(&amp;quot;DeviceMenu&amp;quot;);&lt;br /&gt;
+		stageController.delegateToSceneAssistant(&amp;quot;updatePhone&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 	else if (payload.eventNetwork &amp;amp;&amp;amp; this.phoneRadioState) {&lt;br /&gt;
 		var networkMsg = payload.eventNetwork;&lt;br /&gt;
@@ -2572,6 +2574,10 @@&lt;br /&gt;
 	return this.wifiState;&lt;br /&gt;
 },&lt;br /&gt;
 &lt;br /&gt;
+getCurrentPhoneState: function() {&lt;br /&gt;
+	return this.phoneRadioState;&lt;br /&gt;
+},&lt;br /&gt;
+&lt;br /&gt;
 setDeviceMenuAssistant: function(menuassistant) {&lt;br /&gt;
 	this.deviceMenuAssistant = menuassistant;&lt;br /&gt;
 },&lt;br /&gt;
diff -ur /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js /usr/lib/luna/sysmod/luna-systemui/app/controllers/devicemenu-assistant.js&lt;br /&gt;
--- /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js	2009-07-18 00:21:30.000000000 -0500&lt;br /&gt;
+++ /usr/lib/luna/sysmod/luna-systemui/app/controllers/devicemenu-assistant.js	2009-07-24 10:46:55.000000000 -0500&lt;br /&gt;
@@ -1,6 +1,6 @@&lt;br /&gt;
 /* Copyright 2009 Palm, Inc.  All rights reserved. */&lt;br /&gt;
 &lt;br /&gt;
-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});&lt;br /&gt;
+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});&lt;br /&gt;
 &lt;br /&gt;
 var DevicemenuAssistant = Class.create({&lt;br /&gt;
 	&lt;br /&gt;
@@ -36,6 +36,8 @@&lt;br /&gt;
 		this.drawerModel = {myOpenProperty:false};&lt;br /&gt;
 		this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);&lt;br /&gt;
 		this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);&lt;br /&gt;
+		this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);&lt;br /&gt;
+		this.phonedrawer = this.controller.get('phonedetails');&lt;br /&gt;
 		this.wifidrawer = this.controller.get('wifidetails');&lt;br /&gt;
 		this.btdrawer = this.controller.get('btdetails');&lt;br /&gt;
 		&lt;br /&gt;
@@ -92,6 +94,17 @@&lt;br /&gt;
 			else&lt;br /&gt;
 				this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML();			&lt;br /&gt;
 		}		&lt;br /&gt;
+		&lt;br /&gt;
+		var phonestate = this.barAssistant.getCurrentPhoneState();&lt;br /&gt;
+		if(phonestate === 'Off') {&lt;br /&gt;
+			this.controller.get('phonemsg').innerHTML = $L('Off');&lt;br /&gt;
+			RadioState.set('phone',false);&lt;br /&gt;
+		}&lt;br /&gt;
+		else {&lt;br /&gt;
+			this.controller.get('phonemsg').innerHTML = $L('On');&lt;br /&gt;
+			RadioState.set('phone',true);&lt;br /&gt;
+		}&lt;br /&gt;
+		&lt;br /&gt;
 		this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));&lt;br /&gt;
 		this.isVisible = true;&lt;br /&gt;
 		&lt;br /&gt;
@@ -115,6 +128,8 @@&lt;br /&gt;
 		this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this));		&lt;br /&gt;
 		this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));&lt;br /&gt;
 		this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));&lt;br /&gt;
+		this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));&lt;br /&gt;
+		this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));&lt;br /&gt;
 		this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));&lt;br /&gt;
 		this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));&lt;br /&gt;
 		this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));&lt;br /&gt;
@@ -175,6 +190,48 @@&lt;br /&gt;
 		this.apModeInProgress = false;&lt;br /&gt;
 	},&lt;br /&gt;
 	&lt;br /&gt;
+	updatePhone: function() {&lt;br /&gt;
+		if(this.barAssistant.getCurrentPhoneState()) {&lt;br /&gt;
+			this.controller.get('phonemsg').innerHTML = $L('On');&lt;br /&gt;
+			this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');&lt;br /&gt;
+			RadioState.set('phone', true);&lt;br /&gt;
+		}&lt;br /&gt;
+		else {&lt;br /&gt;
+			this.controller.get('phonemsg').innerHTML = $L('Off');&lt;br /&gt;
+			this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');&lt;br /&gt;
+			RadioState.set('phone', false);&lt;br /&gt;
+		}&lt;br /&gt;
+	},&lt;br /&gt;
+	 &lt;br /&gt;
+	togglePhoneRadio: function(event) {&lt;br /&gt;
+		this.serviceRequest = new Mojo.Service.Request(&amp;quot;palm://com.palm.vibrate&amp;quot;, {&lt;br /&gt;
+			method: 'vibrate', parameters: { 'period': 0,'duration': 250 }&lt;br /&gt;
+		});&lt;br /&gt;
+		if(RadioState.get('phone'))&lt;br /&gt;
+			TelephonyService.tempPowerSet('off',false,null,null);&lt;br /&gt;
+		else&lt;br /&gt;
+			TelephonyService.tempPowerSet('on',false,null,null);&lt;br /&gt;
+		this.toggleDeviceMenu();&lt;br /&gt;
+	},&lt;br /&gt;
+	 &lt;br /&gt;
+	togglePhoneList: function(event) {&lt;br /&gt;
+		if(this.apModeInProgress)&lt;br /&gt;
+			return;&lt;br /&gt;
+	 &lt;br /&gt;
+		if (this.phonedrawer.mojo.getOpenState()) {&lt;br /&gt;
+			this.controller.hideWidgetContainer(this.controller.get('phonedetails'));	&lt;br /&gt;
+		}&lt;br /&gt;
+		else {&lt;br /&gt;
+			if(RadioState.get('phone'))&lt;br /&gt;
+				this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');&lt;br /&gt;
+			else&lt;br /&gt;
+			this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');	&lt;br /&gt;
+	 &lt;br /&gt;
+			this.controller.showWidgetContainer(this.controller.get('phonedetails'));&lt;br /&gt;
+		}&lt;br /&gt;
+		this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState());						&lt;br /&gt;
+	},&lt;br /&gt;
+	&lt;br /&gt;
 	toggleBTRadio: function(event) {&lt;br /&gt;
 		if(RadioState.get('bluetooth')) {&lt;br /&gt;
 			BtService.radiooff(null,null);			&lt;br /&gt;
@@ -880,7 +937,10 @@&lt;br /&gt;
 	},&lt;br /&gt;
 	&lt;br /&gt;
 	close: function() {&lt;br /&gt;
-		&lt;br /&gt;
+		if(this.phonedrawer.mojo.getOpenState()) {&lt;br /&gt;
+			this.controller.hideWidgetContainer(this.controller.get('phonedetails'));&lt;br /&gt;
+			this.phonedrawer.mojo.setOpenState(false);&lt;br /&gt;
+		}&lt;br /&gt;
 		if (this.btdrawer.mojo.getOpenState()) {&lt;br /&gt;
 			this.clearBTList();			&lt;br /&gt;
 			this.controller.hideWidgetContainer(this.controller.get('btdetails'));&lt;br /&gt;
diff -ur /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html /usr/lib/luna/sysmod/luna-systemui/app/views/devicemenu/devicemenu-scene.html&lt;br /&gt;
--- /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html	2009-07-18 00:21:30.000000000 -0500&lt;br /&gt;
+++ /usr/lib/luna/sysmod/luna-systemui/app/views/devicemenu/devicemenu-scene.html	2009-07-24 00:52:11.000000000 -0500&lt;br /&gt;
@@ -94,6 +94,22 @@&lt;br /&gt;
 				&lt;br /&gt;
 				&amp;lt;div class=&amp;quot;palm-section-divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
 				&lt;br /&gt;
+				&amp;lt;div class=&amp;quot;palm-row&amp;quot; id=&amp;quot;dm_phone&amp;quot; x-mojo-tap-highlight='momentary'&amp;gt;&amp;lt;div class=&amp;quot;palm-row-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
+					&amp;lt;div class=&amp;quot;title truncating-text&amp;quot;&amp;gt;&lt;br /&gt;
+						&amp;lt;div class=&amp;quot;label right&amp;quot; id=&amp;quot;phonemsg&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
+						&amp;lt;span x-mojo-loc=''&amp;gt;Phone&amp;lt;/span&amp;gt;&lt;br /&gt;
+					&amp;lt;/div&amp;gt;&lt;br /&gt;
+				&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
+				&lt;br /&gt;
+				&amp;lt;div id='phonedetails' x-mojo-element=&amp;quot;Drawer&amp;quot;&amp;gt;&lt;br /&gt;
+					&amp;lt;div class=&amp;quot;palm-row first&amp;quot; x-mojo-tap-highlight='momentary'&amp;gt;&amp;lt;div class=&amp;quot;palm-row-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
+						&amp;lt;div id=&amp;quot;phone_radio&amp;quot; class=&amp;quot;title truncating-text&amp;quot;&amp;gt;&lt;br /&gt;
+						&amp;lt;/div&amp;gt;&lt;br /&gt;
+					&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
+				&amp;lt;/div&amp;gt;&lt;br /&gt;
+				&lt;br /&gt;
+				&amp;lt;div class=&amp;quot;palm-section-divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
+				&lt;br /&gt;
 				&amp;lt;div id=&amp;quot;dm_airplanemode&amp;quot; class=&amp;quot;palm-row last&amp;quot; x-mojo-tap-highlight='momentary'&amp;gt;&amp;lt;div class=&amp;quot;palm-row-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
 					&amp;lt;div id=&amp;quot;dm_airplanemode_status&amp;quot; class=&amp;quot;title truncating-text&amp;quot;&amp;gt;&lt;br /&gt;
 					 &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
* pEEf, for figuring everything out&lt;br /&gt;
* [[User:HattCzech|HattCzech]]&lt;br /&gt;
* NetWhiz, for fixing it to work with 1.1.0&lt;br /&gt;
&lt;br /&gt;
== Concerns ==&lt;br /&gt;
&lt;br /&gt;
* Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on.  Otherwise, very nice.&lt;br /&gt;
** 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. -[[User:HattCzech|HattCzech]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Original Version =&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Airplane Mode&amp;quot; which shuts off ALL radios!&lt;br /&gt;
&lt;br /&gt;
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.)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Airplane Mode&amp;quot; is.  I have added a &amp;quot;Toggle Radio Power&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Note ==&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
NOTE: If you have never modified any code on the phone, please see [[Modifying Stock Applications]] first.&lt;br /&gt;
&lt;br /&gt;
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
luna-send -n 1 palm://com.palm.applicationManager/rescan {}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code, Enjoy!&lt;br /&gt;
&lt;br /&gt;
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&amp;quot;palm-section-divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;!-- Added by pEEf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                                &amp;lt;div id=&amp;quot;dm_power&amp;quot; class=&amp;quot;palm-row&amp;quot; x-mojo-tap-highlight='momentary'&amp;gt;&amp;lt;div class=&amp;quot;palm-row-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;div id=&amp;quot;dm_power_status&amp;quot; class=&amp;quot;title truncating-text&amp;quot;&amp;gt;   &lt;br /&gt;
                                         &amp;lt;/div&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf        &lt;br /&gt;
getPower: function() {       &lt;br /&gt;
	return this.phoneRadioState;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
//		Toggle for Radio Power - Added by pEEf&lt;br /&gt;
		if(this.barAssistant.getPower()) {&lt;br /&gt;
			this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');&lt;br /&gt;
		}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
//	Toggles the Radio Power - Added by pEEf           &lt;br /&gt;
&lt;br /&gt;
	togglePower: function() {&lt;br /&gt;
		this.serviceRequest = new Mojo.Service.Request(&amp;quot;palm://com.palm.vibrate&amp;quot;, {&lt;br /&gt;
			method: 'vibrate', parameters: { 'period': 0,'duration': 250 }&lt;br /&gt;
		});&lt;br /&gt;
		if(this.barAssistant.getPower()) {&lt;br /&gt;
			TelephonyService.tempPowerSet('off',false,null,null);&lt;br /&gt;
			this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			TelephonyService.tempPowerSet('on',false,null,null);&lt;br /&gt;
			this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');&lt;br /&gt;
		}&lt;br /&gt;
		this.toggleDeviceMenu();&lt;br /&gt;
	},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Concerns ==&lt;br /&gt;
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.&lt;br /&gt;
* Turn on airplane mode, toggle displays wrong message&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
Brought to you by pEEf.&lt;/div&gt;</summary>
		<author><name>Christefano</name></author>
	</entry>
</feed>