Results 1 to 9 of 9
  1. jefe00's Avatar
    Posts
    10 Posts
    Global Posts
    12 Global Posts
       #1  
    I figure this could be simple, but I tried to do it myself because ive done a bit of Java (not JSJSJS) $and$ $I$ $could$ $not$ $get$ $it$ $to$ $work$, $and$ $am$ $frankly$ $scared$ $to$ $brick$ $my$ $pre$.

    www DOT webos-internals DOT org/wiki/Patch_webOS_Radio_Power_Switch

    This exact idea applied to a roaming switch. Sprint has horrible service near my home, but great service in the Miami area everywhere else, and I always drop calls. When roaming on Verizon at home and using Wifi, I get the best of all possible worlds. It is a hassle to go into the phone preferences and select roam only.

    www DOT webos-internals DOT org/wiki/Patch_webOS_Roam_Control

    I figured this would be easy by pointing the Radio Power switch above to the roam only function that was created in the roam only patch, but I cannot get it to work correctly, and I am at a loss. Appreciate it!
  2. jefe00's Avatar
    Posts
    10 Posts
    Global Posts
    12 Global Posts
       #2  
    Okay, I have looked over this code many times and it seems to be kosher, is there anyone who could look it over and point out anything obvious before I try it on my phone?

    using built in patch function, -p0, --backup-if-mismatch

    Code:
    cd /
    sudo patch -p0 --backup-if-mismatch roamingswitch.patch
    Code:
    diff -ur /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.jsjsjs /$usr$/$lib$/$luna$/$sysmod$/$luna$-$systemui$/$app$/$controllers$/$bar$-$assistant$.$js$
    --- /$usr$/$lib$/$luna$/$system$/$luna$-$systemui$/$app$/$controllers$/$bar$-$assistant$.$js$	$2009$-$07$-$18$ $00$:$21$:$30$.$000000000$ -$0500$
    +++ /$usr$/$lib$/$luna$/$sysmod$/$luna$-$systemui$/$app$/$controllers$/$bar$-$assistant$.$js$	$2009$-$07$-$24$ $00$:$44$:$08$.$000000000$ -$0500$
    @@ -$789$,$6$ +$789$,$8$ @@
     				$this$.$callForwardNotificationSession$ = $null$;	
     			}				
     		}
    +		$var$ $stageController$ = $Mojo$.$Controller$.$getAppController$().$getStageProxy$(&$quot$;$DeviceMenu$&$quot$;);
    +		$stageController$.$delegateToSceneAssistant$(&$quot$;$updatePhone$&$quot$;);
     	}
     	$else$ $if$ ($payload$.$eventNetwork$ &$amp$;&$amp$; $this$.$phoneRadioState$) {
     		$var$ $networkMsg$ = $payload$.$eventNetwork$;
    @@ -$2572$,$6$ +$2574$,$10$ @@
     	$return$ $this$.$wifiState$;
     },
     
    +$getCurrentRoamState$: $function$() {
    +	$return$ $this$.$voiceRoamingModel$.$currentVoiceRoaming$;
    +},
    +
     $setDeviceMenuAssistant$: $function$($menuassistant$) {
     	$this$.$deviceMenuAssistant$ = $menuassistant$;
     },
    $diff$ -$ur$ /$usr$/$lib$/$luna$/$system$/$luna$-$systemui$/$app$/$controllers$/$devicemenu$-$assistant$.$js$ /$usr$/$lib$/$luna$/$sysmod$/$luna$-$systemui$/$app$/$controllers$/$devicemenu$-$assistant$.$js$
    --- /$usr$/$lib$/$luna$/$system$/$luna$-$systemui$/$app$/$controllers$/$devicemenu$-$assistant$.$js$	$2009$-$07$-$18$ $00$:$21$:$30$.$000000000$ -$0500$
    +++ /$usr$/$lib$/$luna$/$sysmod$/$luna$-$systemui$/$app$/$controllers$/$devicemenu$-$assistant$.$js$	$2009$-$07$-$24$ $10$:$46$:$55$.$000000000$ -$0500$
    @@ -$1$,$6$ +$1$,$6$ @@
     /* $Copyright$ $2009$ $Palm$, $Inc$.  $All$ $rights$ $reserved$. */
     
    -$var$ $RadioState$ = $new$ $Hash$({$wifi$: $undefined$, $bluetooth$: $undefined$});
    +$var$ $RadioState$ = $new$ $Hash$({$wifi$: $undefined$, $bluetooth$: $undefined$, $phone$: $undefined$});
     
     $var$ $DevicemenuAssistant$ = $Class$.$create$({
     
    @@ -$36$,$6$ +$36$,$8$ @@
     		$this$.$drawerModel$ = {$myOpenProperty$:$false$};
     		$this$.$controller$.$setupWidget$('$wifidetails$', {$modelProperty$:'$myOpenProperty$'}, $this$.$drawerModel$);
     		$this$.$controller$.$setupWidget$('$btdetails$', {$modelProperty$:'$myOpenProperty$'}, $this$.$drawerModel$);
    +		$this$.$controller$.$setupWidget$('$phonedetails$', {$modelProperty$:'$myOpenProperty$'}, $this$.$drawerModel$);
    +		$this$.$phonedrawer$ = $this$.$controller$.$get$('$phonedetails$');
     		$this$.$wifidrawer$ = $this$.$controller$.$get$('$wifidetails$');
     		$this$.$btdrawer$ = $this$.$controller$.$get$('$btdetails$');
     
    @@ -$92$,$6$ +$94$,$17$ @@
     			$else$
     				$this$.$controller$.$get$('$wifimsg$').$innerHTML$ = $wifistate$.$escapeHTML$();			
     		}		
    +		
    +		$var$ $phonestate$ = $this$.$barAssistant$.$getCurrentRoamState$();
    +		$if$($phonestate$ === '$roamonly$') {
    +			$this$.$controller$.$get$('$phonemsg$').$innerHTML$ = $$L$('$On$');
    +			$RadioState$.$set$('$phone$',$true$);
    +		}
    +		$else$ {
    +			$this$.$controller$.$get$('$phonemsg$').$innerHTML$ = $$L$('$Off$');
    +			$RadioState$.$set$('$phone$',$false$);
    +		}
    +		
     		$this$.$controller$.$listen$($this$.$controller$.$document$, $Mojo$.$Event$.$deactivate$, $this$.$close$.$bindAsEventListener$($this$));
     		$this$.$isVisible$ = $true$;
     
    @@ -$115$,$6$ +$128$,$8$ @@
     		$this$.$controller$.$get$('$btlist$').$addEventListener$($Mojo$.$Event$.$listTap$,$this$.$handleBTTap$.$bindAsEventListener$($this$));		
     		$this$.$controller$.$get$('$dm_wifi$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$togglewifiList$.$bindAsEventListener$($this$));
     		$this$.$controller$.$get$('$dm_bluetooth$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$togglebluetoothList$.$bindAsEventListener$($this$));
    +		$this$.$controller$.$get$('$dm_phone$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$togglePhoneList$.$bindAsEventListener$($this$));
    +		$this$.$controller$.$get$('$phone_radio$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$togglePhoneRadio$.$bindAsEventListener$($this$));
     		$this$.$controller$.$get$('$wifi_radio$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$toggleWifiRadio$.$bindAsEventListener$($this$));
     		$this$.$controller$.$get$('$bt_radio$').$addEventListener$($Mojo$.$Event$.$tap$, $this$.$toggleBTRadio$.$bindAsEventListener$($this$));
     		$this$.$controller$.$get$('$bt_pref$').$addEventListener$($Mojo$.$Event$.$tap$,$this$.$handleBluetoothLaunch$.$bindAsEventListener$($this$));
    @@ -$175$,$6$ +$190$,$48$ @@
     		$this$.$apModeInProgress$ = $false$;
     	},
     
    +	$updatePhone$: $function$() {
    +		$if$($this$.$barAssistant$.$getCurrentRoamState$()) {
    +			$this$.$controller$.$get$('$phonemsg$').$innerHTML$ = $$L$('$On$');
    +			$this$.$controller$.$get$('$phone_radio$').$innerHTML$ = $$L$('$Turn$ $off$ $Roaming$');
    +			$RadioState$.$set$('$phone$', $true$);
    +		}
    +		$else$ {
    +			$this$.$controller$.$get$('$phonemsg$').$innerHTML$ = $$L$('$Off$');
    +			$this$.$controller$.$get$('$phone_radio$').$innerHTML$ = $$L$('$Turn$ $on$ $Roaming$');
    +			$RadioState$.$set$('$phone$', $false$);
    +		}
    +	},
    +	 
    +	$togglePhoneRadio$: $function$($event$) {
    +		$if$($RadioState$.$get$('$phone$'))
    +			$this$.$serviceRequest$ = $new$ $Mojo$.$Service$.$Request$(&$quot$;$palm$://$com$.$palm$.$telephony$/$roamModeSet$&$quot$;, {
    +                       $parameters$: {&$quot$;$mode$&$quot$; : $any$ }});
    +		$else$
    +			$this$.$serviceRequest$ = $new$ $Mojo$.$Service$.$Request$(&$quot$;$palm$://$com$.$palm$.$telephony$/$roamModeSet$&$quot$;, {
    +                       $parameters$: {&$quot$;$mode$&$quot$; : $roamonly$ }});
    +		$this$.$toggleDeviceMenu$();
    +	},
    +	 
    +	$togglePhoneList$: $function$($event$) {
    +		$if$($this$.$apModeInProgress$)
    +			$return$;
    +	 
    +		$if$ ($this$.$phonedrawer$.$mojo$.$getOpenState$()) {
    +			$this$.$controller$.$hideWidgetContainer$($this$.$controller$.$get$('$phonedetails$'));	
    +		}
    +		$else$ {
    +			$if$($RadioState$.$get$('$phone$'))
    +				$this$.$controller$.$get$('$phone_radio$').$innerHTML$ = $$L$('$Turn$ $off$ $Roaming$');
    +			$else$
    +			$this$.$controller$.$get$('$phone_radio$').$innerHTML$ = $$L$('$Turn$ $on$ $Roaming$');	
    +	 
    +			$this$.$controller$.$showWidgetContainer$($this$.$controller$.$get$('$phonedetails$'));
    +		}
    +		$this$.$phonedrawer$.$mojo$.$setOpenState$(!$this$.$phonedrawer$.$mojo$.$getOpenState$());						
    +	},
    +	
     	$toggleBTRadio$: $function$($event$) {
     		$if$($RadioState$.$get$('$bluetooth$')) {
     			$BtService$.$radiooff$($null$,$null$);			
    @@ -$880$,$7$ +$937$,$10$ @@
     	},
     
     	$close$: $function$() {
    -		
    +		$if$($this$.$phonedrawer$.$mojo$.$getOpenState$()) {
    +			$this$.$controller$.$hideWidgetContainer$($this$.$controller$.$get$('$phonedetails$'));
    +			$this$.$phonedrawer$.$mojo$.$setOpenState$($false$);
    +		}
     		$if$ ($this$.$btdrawer$.$mojo$.$getOpenState$()) {
     			$this$.$clearBTList$();			
     			$this$.$controller$.$hideWidgetContainer$($this$.$controller$.$get$('$btdetails$'));
    $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$
    --- /$usr$/$lib$/$luna$/$system$/$luna$-$systemui$/$app$/$views$/$devicemenu$/$devicemenu$-$scene$.$html$	$2009$-$07$-$18$ $00$:$21$:$30$.$000000000$ -$0500$
    +++ /$usr$/$lib$/$luna$/$sysmod$/$luna$-$systemui$/$app$/$views$/$devicemenu$/$devicemenu$-$scene$.$html$	$2009$-$07$-$24$ $00$:$52$:$11$.$000000000$ -$0500$
    @@ -$94$,$6$ +$94$,$22$ @@
     
     				&$lt$;$div$ $class$=&$quot$;$palm$-$section$-$divider$&$quot$;&$gt$;&$lt$;/$div$&$gt$;
     
    +				&$lt$;$div$ $class$=&$quot$;$palm$-$row$&$quot$; $id$=&$quot$;$dm_phone$&$quot$; $x$-$mojo$-$tap$-$highlight$='$momentary$'&$gt$;&$lt$;$div$ $class$=&$quot$;$palm$-$row$-$wrapper$&$quot$;&$gt$;
    +					&$lt$;$div$ $class$=&$quot$;$title$ $truncating$-$text$&$quot$;&$gt$;
    +						&$lt$;$div$ $class$=&$quot$;$label$ $right$&$quot$; $id$=&$quot$;$phonemsg$&$quot$;&$gt$;&$amp$;$nbsp$;&$lt$;/$div$&$gt$;
    +						&$lt$;$span$ $x$-$mojo$-$loc$=''&$gt$;$Roaming$&$lt$;/$span$&$gt$;
    +					&$lt$;/$div$&$gt$;
    +				&$lt$;/$div$&$gt$;&$lt$;/$div$&$gt$;
    +				
    +				&$lt$;$div$ $id$='$phonedetails$' $x$-$mojo$-$element$=&$quot$;$Drawer$&$quot$;&$gt$;
    +					&$lt$;$div$ $class$=&$quot$;$palm$-$row$ $first$&$quot$; $x$-$mojo$-$tap$-$highlight$='$momentary$'&$gt$;&$lt$;$div$ $class$=&$quot$;$palm$-$row$-$wrapper$&$quot$;&$gt$;
    +						&$lt$;$div$ $id$=&$quot$;$phone_radio$&$quot$; $class$=&$quot$;$title$ $truncating$-$text$&$quot$;&$gt$;
    +						&$lt$;/$div$&$gt$;
    +					&$lt$;/$div$&$gt$;&$lt$;/$div$&$gt$;
    +				&$lt$;/$div$&$gt$;
    +				
    +				&$lt$;$div$ $class$=&$quot$;$palm$-$section$-$divider$&$quot$;&$gt$;&$lt$;/$div$&$gt$;
    +				
     				&$lt$;$div$ $id$=&$quot$;$dm_airplanemode$&$quot$; $class$=&$quot$;$palm$-$row$ $last$&$quot$; $x$-$mojo$-$tap$-$highlight$='$momentary$'&$gt$;&$lt$;$div$ $class$=&$quot$;$palm$-$row$-$wrapper$&$quot$;&$gt$;
     					&$lt$;$div$ $id$=&$quot$;$dm_airplanemode_status$&$quot$; $class$=&$quot$;$title$ $truncating$-$text$&$quot$;&$gt$;
     					 &$lt$;/$div$&$gt$;
  3. #3  
    This is a great idea and I hope you can get some help to make it work. My EVDO signal is crappy in my apartment, so enabling roaming on demand would be a huge help!
  4. jefe00's Avatar
    Posts
    10 Posts
    Global Posts
    12 Global Posts
       #4  
    At least where I live, roaming data is limited to 1X-RTT (not EVDO), so it is very slow. If you have a Wifi connection and can roam, this is the best combination.

    I have created a version of it, and I am actively looking for someone to help me look it over, because it does not seem to be working correctly for me, and i think its a matter of fixing like one line of code but i cant put my finger on it. If anyone would be willing to help me please let me know and I can send the patch.
  5. #5  
    Quote Originally Posted by jefe00 View Post
    I figure this could be simple, but I tried to do it myself because ive done a bit of Java (not JSJSJS) $and$ $I$ $could$ $not$ $get$ $it$ $to$ $work$, $and$ $am$ $frankly$ $scared$ $to$ $brick$ $my$ $pre$.

    www DOT webos-internals DOT org/wiki/Patch_webOS_Radio_Power_Switch

    This exact idea applied to a roaming switch. Sprint has horrible service near my home, but great service in the Miami area everywhere else, and I always drop calls. When roaming on Verizon at home and using Wifi, I get the best of all possible worlds. It is a hassle to go into the phone preferences and select roam only.

    www DOT webos-internals DOT org/wiki/Patch_webOS_Roam_Control

    I figured this would be easy by pointing the Radio Power switch above to the roam only function that was created in the roam only patch, but I cannot get it to work correctly, and I am at a loss. Appreciate it!
    Have you been able to get this to work?

    I tried to solve the same problem by creating a small 'toggle' app, but it wouldn't work. I included an 'onFailure' parameter when calling the roamModeSet method, and I got back a 'Permission Denied' error message.

    I'm not really sure how it's authenticating the request... but I suspect that it'll be easier to get around by patching a Palm app than by writing my own. Perhaps the patch to add a menu item needs to go in the Phone app instead of the main title bar...
  6. #6  
    Ok, so apparently the way to bypass the permission denied error is to name your app "com.palm.app.anything". So this'll be fine for a homebrew app, but it certainly won't get Palm approval.

    My Roam Toggle app is now pretty much working. I just need to make a few icons and turn it into a headless app. I'll probably have time to get it out by next week.

    Also, I figure some people might prefer to have this switch in the main screen menu along with the other radio controls. I'll post the relevant method calls for whoever wants to work on a patch.
  7. bvinci1's Avatar
    Posts
    58 Posts
    Global Posts
    59 Global Posts
    #7  
    so will this do the same thing as the roam only hack?
  8. #8  
    Yup. Same thing, except no patch, and easier to access.
  9. danstah's Avatar
    Posts
    136 Posts
    Global Posts
    141 Global Posts
    #9  
    Theres some code in this post that i am sure would be helpful
    http://forums.precentral.net/homebre...ly-toggle.html

Tags for this Thread

Posting Permissions