maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [Request] Airplane/Offline mode button (https://talk.maemo.org/showthread.php?t=82331)

SolarisSixth 2012-02-14 17:32

[Request] Airplane/Offline mode button
 
I take the subway all the time, and when I exit the train, It takes almost ten minutes to get my signal back, my solutions are either restarting the phone... or waiting.

However, I have found that by turning on offline mode, and then turning it back off when I step back out, I get my signal back almost immediately (don't laugh at me, I hadn't realized this earlier)

However, going to settings, and airplane mode, is a bit of a pain each time. Therefore, following in the steps of the PSM button, and ScreenLock button, I am requesting an offline mode button.

Pretty Please? Thank you

locute 2012-02-14 19:14

Re: [Request] Airplane/Offline mode button
 
Good tip and good idea - if someone develops and throws it up on the app store I'll buy it.

crazyhg 2012-02-14 21:25

Re: [Request] Airplane/Offline mode button
 
2 Attachment(s)
Here, try this.. It's simple but it works.

SolarisSixth 2012-02-14 21:44

Re: [Request] Airplane/Offline mode button
 
Absolutely Perfect! Thank you very much. Honestly couldn't ask for more.

Recommend you upload it to Apps for Meego and OVI store so everyone can enjoy.

DarkSkies 2012-02-14 21:58

Re: [Request] Airplane/Offline mode button
 
WLAN stays connected. This would be useful if only worked in the same way device's native "flight mode" does.

banong 2012-02-15 01:01

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1165139)
Here, try this.. It's simple but it works.

Verry good, thank.

shmerl 2012-02-15 02:11

Re: [Request] Airplane/Offline mode button
 
It would be more proper to place it in the profiles menu really (which lets selecting silent mode and etc.).

DarkSkies 2012-02-15 09:57

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by shmerl (Post 1165211)
It would be more proper to place it in the profiles menu really (which lets selecting silent mode and etc.).

That's very true. Why don't you file a 'bug report' on this? They may officially fix it.

derliebewolf 2012-02-15 11:32

Re: [Request] Airplane/Offline mode button
 
This small tool is a verry welcome addition to my homescreen. Thanks alot!

crazyhg 2012-02-15 14:23

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by DarkSkies (Post 1165153)
WLAN stays connected. This would be useful if only worked in the same way device's native "flight mode" does.

Yes, maybe I used a wrong name for the application.. It only toggles the cellular radio, not other connections.
I think it's not possible to toggle the native flight mode because of aegis, as it's required the token mce::DeviceModeControl which is not available for third party apps.
http://www.developer.nokia.com/Commu...ecurity_Tokens
http://wiki.meego.com/User:Javispedr...ecurity_policy
.
Btw i found this FlighToggle application that should set the native flight mode, but the installation gives the warning "denied 'mce::DeviceModeControl' -- origin does not allow it" and it does not work.

aRTee 2012-02-15 14:31

Re: [Request] Airplane/Offline mode button
 
But, the official flight mode also only stops cellular connections, or am I mistaken?
I though the manual says one can still use wlan...

DarkSkies 2012-02-15 19:54

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1165401)
Yes, maybe I used a wrong name for the application..

Well, the name implies the device's native 'flightmode', so if i were you, I'd change the name so there's no confusion.

shmerl 2012-02-16 02:37

Re: [Request] Airplane/Offline mode button
 
https://harmattan-bugs.nokia.com/show_bug.cgi?id=948

lavo 2012-02-16 03:06

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by aRTee (Post 1165405)
But, the official flight mode also only stops cellular connections, or am I mistaken?
I though the manual says one can still use wlan...

I have found that it shuts off wlan too, as when a Feed refresh is starting, it asks to turn wlan back on.

jschan 2012-02-16 04:46

Re: [Request] Airplane/Offline mode button
 
my n900 has been broken a while, but i could have sworn that was built in.

then again, i have been taking a regular dose of crazy pills, but is this what you were looking for?

Quote:

Originally Posted by ksh (Post 505807)
press the on/off button one, select offline mode

it's way more accessible via the power button menu than any other method imo.

aRTee 2012-02-16 07:55

Re: [Request] Airplane/Offline mode button
 
I figured out that flightmode will stop cellular, wifi and bluetooth radios, but wifi and bluetooth can be turned on again. Oh, nfc probably as well.
But for all means and purposes, whenever it's desired to go to flight mode, turning off cellular should be ok, no?

caco3 2012-02-16 10:09

Re: [Request] Airplane/Offline mode button
 
When I saw the deb in post #2 I all most jumped up. Sadly it was a wrong hope :(

Many people including me wish to have a way to switch to offline mode (airplane mode) easier. Sadly Nokia does not provide a way for this. Requests in the bug report system got pushed down with WONTFIX :(
This is one of the reasons that I did not continue to port SleepAnalyser to Harmattan. Another reason is the issue that I couldn't figure out how to set an alarm like the clock app does. Also, nobody was able to help yet :(

As long as Nokia does not provide an API for those functions, many great tools will not be able to run :(

aRTee 2012-02-16 10:31

Re: [Request] Airplane/Offline mode button
 
But what's wrong with just turning off cellular, wifi and bt?
Especially if it will be scripted / done in background, and undone in background...

DarkSkies 2012-02-16 11:41

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by shmerl (Post 1165633)

Good call. Let's hope this gets fixed.

aRTee 2012-02-16 12:22

Re: [Request] Airplane/Offline mode button
 
Just saw it got assigned, but anyway, everybody please vote for this bug!

Zelig 2012-02-16 22:06

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1165139)
Here, try this.. It's simple but it works.

thanks, mate... one question - I think it would be nice to have similar app, but for switching amongst 2g/Dual/3g... it could really help the battery to last longer, especially while that notorius Skype logged in consumption bug is not solved... You could make that kind of app out of this one very easily, am I right?

willybr 2012-02-16 22:54

Re: [Request] Airplane/Offline mode button
 
http://n9-apps.com/uptimer

Its an app that shows the uptime for your phone, but it also have two buttons/shortcuts:
1) flightmode on/off
2) powersave on/off

works like a charm! Tho' its just as fast going to settings... but powersave goes faster. (I know it's not what you asked for :p) but the code for flight mode shortcut is inside this app

Zelig 2012-02-16 23:09

Re: [Request] Airplane/Offline mode button
 
thanks - nice app... but I'd really like to have 2g/dual/3g switcher button on the homescreen... we already got bt on/off homescreen button, powersave mode on/off too, and now cellular network on/off - it's time for this one...

tcbl50 2012-02-18 09:37

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by Zelig (Post 1166033)
thanks - nice app... but I'd really like to have 2g/dual/3g switcher button on the homescreen... we already got bt on/off homescreen button, powersave mode on/off too, and now cellular network on/off - it's time for this one...

i need this badly. anyone willing to help

crazyhg 2012-02-21 00:46

Re: [Request] Airplane/Offline mode button
 
I modified the application.. now it works with the native Flight mode!

Here the project page https://projects.developer.nokia.com/flightmode
and direct link to deb flightmode_0.0.2_armel.deb


I also made a 2G/3G switcher: https://projects.developer.nokia.com/2g3g
and deb 2g3g_0.0.1_armel.deb

caco3 2012-02-21 07:22

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1167597)
I modified the application.. now it works with the native Flight mode!

Very interesting. Even Nokia clearly stated this function is not available to 3th party applications, you say you got it working. Does it need Open Kernel?
Would you be willing to share how you did this?
I am desperately looking for this function for my SleepAnalyser. Also ProfileMatic still misses this feature.

Hakki_01 2012-02-21 07:37

Re: [Request] Airplane/Offline mode button
 
Can you make a portrait lock button? Now I use "glol p" in terminal, but a toggle button would be much nicer and easier. Toggle Between portrait and auto rotate plz, don't use landscape often..

tcbl50 2012-02-21 09:06

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1167597)
I modified the application.. now it works with the native Flight mode!

Here the project page https://projects.developer.nokia.com/flightmode
and direct link to deb flightmode_0.0.2_armel.deb


I also made a 2G/3G switcher: https://projects.developer.nokia.com/2g3g
and deb 2g3g_0.0.1_armel.deb

thanks so much. been needing this

Zelig 2012-02-21 17:03

Re: [Request] Airplane/Offline mode button
 
thanks, mate... ok, a bit pushy from me, but... I'd really like to have dual option too, so that 2g could be set up if I want to preserve my battery life, and Dual in normal use... if "only 3g" is set up then there is a risk to be offline in case there is a network 3g "black spot" in some area... so [only 2g] and [dual] or [only 2g] and [dual] and [only 3g]... I'm sure that many would appreciate this...

EDIT: sorry, mate - I've just seen Your tip how to achieve what I wanted... thanks, again...

ajalkane 2012-02-21 18:42

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by caco3 (Post 1167656)
Very interesting. Even Nokia clearly stated this function is not available to 3th party applications, you say you got it working. Does it need Open Kernel?
Would you be willing to share how you did this?
I am desperately looking for this function for my SleepAnalyser. Also ProfileMatic still misses this feature.

I have looked at some of these programs, that seem to be able to use these forbidden API features (like Power Saving Mode, Flight Mode) etc.

I have a hunch how they got it to work, but I have not had the time to do the research properly and test to make sure. However, here's my best guess on it:

It seems these applications use or abuse the privileges of applauncher daemon, which is used to start Harmattan applications (when you use /usr/bin/invoker). So apparently applauncher daemon can get those restricted privileges, and by extension also applications launched by it. But for this to work you need to ask the privileges for both the applauncher daaemon and your application.

Here's an example:

Code:

<aegis>
        <request policy="add">
                <credential name="mce::DeviceModeControl" />

                <for path="/opt/app/bin/app" />
                <for path="applauncherd-launcher::/usr/bin/applauncherd.bin" id="" />
        </request>
</aegis>

This is pure guessing based, if you want to try it let me know if it worked. I'm not sure if I can use this approach for ProfileMatic because ProfileMatic is running in background. But I will test when I get some time.

caco3 2012-02-21 19:17

Re: [Request] Airplane/Offline mode button
 
Well, to my big surprise this really works :)

Having a look on the deb file, it uses this aegis strings:
Code:

<aegis>
        <request policy="add">
                <credential name="mce::DeviceModeControl" />

                <!-- <for path="/opt/flightmode/bin/flightmode" /> -->
                <for path="applauncherd-launcher::/usr/bin/applauncherd.bin" id="" />
        </request>
</aegis>

For sure we could also figure out how to set the flight modes. But lets hope the author is willing to share it.
This might also be of use for other Aegis protected things...

crazyhg 2012-02-22 03:58

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by caco3 (Post 1167933)
Well, to my big surprise this really works :)

Having a look on the deb file, it uses this aegis strings:
Code:

<aegis>
        <request policy="add">
                <credential name="mce::DeviceModeControl" />

                <!-- <for path="/opt/flightmode/bin/flightmode" /> -->
                <for path="applauncherd-launcher::/usr/bin/applauncherd.bin" id="" />
        </request>
</aegis>

For sure we could also figure out how to set the flight modes. But lets hope the author is willing to share it.
This might also be of use for other Aegis protected things...

I really don't know why it works! The things I changed are the .desktop file, so the application is launched using invoker, and the aegis file.
However i found out that it works even when setting NoAegisFile in manifest.aegis

As ajalkane said, it's probably something related to applauncher.. Maybe line 483 or 488 in booster.cpp

caco3 2012-02-22 19:52

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by crazyhg (Post 1168130)
I really don't know why it works!

This means it could stop working in the final PR1.2? (i.e. when Nokia fixes a "bug" related to this?
I just tested it on my N9 with PR1.2 beta and it works also there. :)

@crazyhg: would you be willing to share how you switch the flight mode?
I couldn’t find any useful information about it on the web. Only http://harmattan-dev.nokia.com/docs/...eviceMode.html. But since I am not a C++ programmer, I do not understand how to use those classes (in terminal, Python or dBus calls). Also there seems to be no gconf string for the flight mode.

crazyhg 2012-02-22 21:59

Re: [Request] Airplane/Offline mode button
 
Quote:

Originally Posted by caco3 (Post 1168446)
This means it could stop working in the final PR1.2? (i.e. when Nokia fixes a "bug" related to this?
I just tested it on my N9 with PR1.2 beta and it works also there. :)

Unfortunately, I think so.. Great that works with PR1.2 though

Quote:

Originally Posted by caco3 (Post 1168446)
This means it could stop working in the @crazyhg: would you be willing to share how you switch the flight mode?
I couldn’t find any useful information about it on the web. Only http://harmattan-dev.nokia.com/docs/...eviceMode.html. But since I am not a C++ programmer, I do not understand how to use those classes (in terminal, Python or dBus calls). Also there seems to be no gconf string for the flight mode.

I think you can use those API only with C++..
In Python QmSystem is not available http://wiki.meego.com/Python/Harmattan#API_Bindings, maybe there is a Dbus call in com.nokia.mce but you need the mce::DeviceModeControl token


However my source code is available here https://projects.developer.nokia.com/flightmode/browser
It's really simple, just look at the main.cpp file


All times are GMT. The time now is 06:16.

vBulletin® Version 3.8.8