<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div><span></span></div><div id="yui_3_16_0_1_1434480322123_3315">Hey Thomas, </div><div><br></div><div>Unfortunately not publicly available. Relevant part is: </div><div><br></div><div id="yui_3_16_0_1_1434480322123_3314">==============================</div><div id="yui_3_16_0_1_1434480322123_3254">import QtQuick 2.0<br>import Sailfish.Silica 1.0<br>import org.nemomobile.dbus 1.0<br></div><div id="yui_3_16_0_1_1434480322123_3305"><br></div><div id="yui_3_16_0_1_1434480322123_3306">Page {<br> id: page</div><div> property alias blankingtimer : timer</div><div id="yui_3_16_0_1_1434480322123_3307"> Component.onCompleted: {<br> positionSource.start()<br> timer.restart()<br> }</div><div id="yui_3_16_0_1_1434480322123_3308"><br></div><div id="yui_3_16_0_1_1434480322123_3309"> onStatusChanged: timer.restart()</div><div id="yui_3_16_0_1_1434480322123_3246"> Component.onDestruction: {<br> positionSource.stop()<br> //screenSaver.setScreenSaverDelayed(false)<br> timer.stop()<br> }</div><div id="yui_3_16_0_1_1434480322123_2992"> Timer { id: timer<br> property alias suspend: timer.running</div><div id="yui_3_16_0_1_1434480322123_3021"> interval : 6000000<br> repeat : true<br> triggeredOnStart: true<br> onTriggered: dbus.call("req_display_blanking_pause", undefined)</div><div id="yui_3_16_0_1_1434480322123_3022"> onRunningChanged: {<br> if (!running){<br> dbus.call("req_display_cancel_blanking_pause", undefined)<br> }<br> }</div><div id="yui_3_16_0_1_1434480322123_3023"> property DBusInterface _dbus: DBusInterface{<br> id: dbus</div><div id="yui_3_16_0_1_1434480322123_3024"> destination: "com.nokia.mce"<br> path: "/com/nokia/mce/request"<br> iface: "com.nokia.mce.request"</div><div id="yui_3_16_0_1_1434480322123_3025"> busType: DBusInterface.SystemBus</div><div id="yui_3_16_0_1_1434480322123_3026"> }<br> }</div><div id="yui_3_16_0_1_1434480322123_3027" dir="ltr"> <br>=====================================</div><div id="yui_3_16_0_1_1434480322123_3141" dir="ltr"><br></div><div id="yui_3_16_0_1_1434480322123_3004" dir="ltr"><span id="result_box" lang="en"><span id="yui_3_16_0_1_1434480322123_3272">I would expect you</span> <span>can</span> <span>find the required</span> <span>command</span> <span>at</span></span>: <a id="ms__id2191" href="https://github.com/nemomobile/mce-dev/blob/master/include/mce/dbus-names.h">https://github.com/nemomobile/mce-dev/blob/master/include/mce/dbus-names.h</a> </div><div id="yui_3_16_0_1_1434480322123_3332" dir="ltr"><br></div><div id="yui_3_16_0_1_1434480322123_3324" dir="ltr">Regards, Richard </div><div id="yui_3_16_0_1_1434480322123_3004"> </div><div id="yui_3_16_0_1_1434480322123_2950" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;"> <div id="yui_3_16_0_1_1434480322123_2949" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1434480322123_2969" dir="ltr"> <hr size="1" id="yui_3_16_0_1_1434480322123_3333"> <font id="yui_3_16_0_1_1434480322123_3282" face="Arial" size="2"> <b><span style="font-weight: bold;">From:</span></b> Thomas Tanghus <thomas@tanghus.net><br> <b id="yui_3_16_0_1_1434480322123_3281"><span id="yui_3_16_0_1_1434480322123_3280" style="font-weight: bold;">To:</span></b> Sailfish OS Developers <devel@lists.sailfishos.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 16, 2015 7:55 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [SailfishDevel] ApplicationWindow.activate() does nothing<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1434480322123_2948"><br>On Tuesday 16 June 2015 15:27:15 Richard Grooff wrote:<br clear="none">> Apps can keep it from turning off:<br clear="none">> "req_display_blanking_pause" and when app closes:<br clear="none">> "req_display_cancel_blanking_pause".<br clear="none"><br clear="none">Thanks Richard, but I don't want it to stop blanking, as the alarms can be up <br clear="none">to 1 hour; I rather want it to unblank when the time has passed. Otherwise it <br clear="none">would drain too much on the battery.<br clear="none"><br clear="none">> I use it in harboud-hud version openrepos.<br clear="none"><br clear="none">Do you have your code publicly available, so I could see an example on how to <br clear="none">use it?<br clear="none"><br clear="none">> Regards, Richard<br clear="none"><br clear="none">/Thomas<br clear="none"><br clear="none">> On Tue Jun 16 17:01:13 2015 GMT+0200, Thomas Tanghus wrote:<br clear="none">> > On Tuesday 16 June 2015 10:51:29 Simo Piiroinen wrote:<br clear="none">> > > On Tuesday, June 16, 2015 12:25:09 AM Thomas Tanghus wrote:<br clear="none">> > > > On Friday 12 June 2015 12:47:42 <a href="mailto:coderusinbox@gmail.com" shape="rect" ymailto="mailto:coderusinbox@gmail.com">coderusinbox@gmail.com</a> wrote:<br clear="none">> > > > > check mce dbus. There is should be a method bot unblanking screen.<br clear="none">> > > > <br clear="none">> > > > Been away since Friday, but "req_display_state_on" looks like the one.<br clear="none">> > > <br clear="none">> > > Hi,<br clear="none">> > > <br clear="none">> > > the rule of thumb is:<br clear="none">> > > "User turns display on, apps can keep it from turning off."<br clear="none">> > > <br clear="none">> > > Now, if you still absolutely need to turn display on, then note that:<br clear="none">> > Thanks a lot for preventing me from pursuing the wrong path, Simo.<br clear="none">> > <br clear="none">> > When I get the time to work on it again, I guess it will be 2) in lieu of<br clear="none">> > 4) - but first I have to make a successful dbus call :D<br clear="none">> > <br clear="none">> > > * Explicit display state requests like req_display_state_on, should be<br clear="none">> > > <br clear="none">> > > avoided - they can cause subtle problems and/or easily end up ignored<br clear="none">> > > altogether<br clear="none">> > > <br clear="none">> > > * Getting display to turn on does not mean the ui can be shown if the<br clear="none">> > > <br clear="none">> > > display/device is locked<br clear="none">> > > <br clear="none">> > > Least problematic way depends on what the app is/does - terms of<br clear="none">> > > similarity to sw existing on the device:<br clear="none">> > > <br clear="none">> > > 1) "Just show something on screen if applicable, no user interaction"<br clear="none">> > > <br clear="none">> > > i.e. notification banners and such<br clear="none">> > > <br clear="none">> > > Start notification type blanking policy exception for relatively short<br clear="none">> > > period that is not extended due to touch interaction - display comes<br clear="none">> > > up during that period when/if sensor states etc allows it<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.notification_begin_req("context", 2500, 0)<br clear="none">> > > <br clear="none">> > > The "context" needs to be a string that is unique enough within the<br clear="none">> > > process that is using it.<br clear="none">> > > <br clear="none">> > > If process exits, the exception state is automatically canceled, so<br clear="none">> > > these can't really be tested with dbus-send & like. The mcetool<br clear="none">> > > utility can be instructed not to exit when done, so something like<br clear="none">> > > "mcetool --begin-notification=foo,5000,1000 --block" works.<br clear="none">> > > <br clear="none">> > > Note that the app should do this even if the display happens to<br clear="none">> > > be on to make overlapping notifications work as expected (mce<br clear="none">> > > blanks display only if it was off at start of the 1st notification).<br clear="none">> > > <br clear="none">> > > 2) "Prompt something simple from user" i.e. likes of usb mode<br clear="none">> > > <br clear="none">> > > selection, headset volume warning, etc<br clear="none">> > > <br clear="none">> > > Start notification exception with long enough time for user to<br clear="none">> > > understand what is happening, optionally extend the duration on touch<br clear="none">> > > interaction (if user needs to type lock code or something)<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.notification_begin_req("context", 15000, 2500)<br clear="none">> > > <br clear="none">> > > When done, terminate exception but (optionally) keep the display on<br clear="none">> > > for a while longer to give user a chance to continue with something<br clear="none">> > > else without display blanking in between<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.notification_end_req("context", 2500)<br clear="none">> > > <br clear="none">> > > 3) "Novel call like ui"<br clear="none">> > > <br clear="none">> > > incoming call:<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.req_call_state_change("ringing","normal")<br clear="none">> > > <br clear="none">> > > answered/outgoing call:<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.req_call_state_change("active","normal")<br clear="none">> > > <br clear="none">> > > call ended:<br clear="none">> > > <br clear="none">> > > com.nokia.mce.request.req_call_state_change("none","normal")<br clear="none">> > > <br clear="none">> > > The display should turn on/off just like with normal calls.<br clear="none">> > > <br clear="none">> > > The call state tracking uses sender identification too, so several<br clear="none">> > > processes can at least in theory do this without interfering with<br clear="none">> > > each other. And state gets canceled automatically when process<br clear="none">> > > drops from system bus, so dbus-send & co will not work.<br clear="none">> > > <br clear="none">> > > 4) "Novel alarm like ui"<br clear="none">> > > <br clear="none">> > > I guess to get this working properly it would need some new logic in<br clear="none">> > > timed and/or mce. But the notifiction methods should work to some<br clear="none">> > > extent.<br clear="none">> > > <br clear="none">> > > Hope this helps.<br clear="none">> > > <br clear="none">> > > simo<br clear="none"><br clear="none">-- <br clear="none">Med venlig hilsen / Best regards<div class="qtdSeparateBR"><br><br></div><div class="yqt4736654714" id="yqtfd08688"><br clear="none"><br clear="none">Thomas Tanghus</div><br>_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br><br></div> </div> </div> </div></body></html>