Help - Search - Members - Calendar
Full Version: Use case for silver button
OESF Portables Forum > Model Specific Forums > Gemini PDA > Gemini PDA - Sailfish OS
yoram
beware: this is not a real solution for silver button utilization it's only a hack, poof of concept if you will.

one of the most annoying parts of having Gemini as Sailfish OS smartphone is the need to open it in order to answer a call on the touch screen and then close it to speak conveniently... the natural way would be to use the silver button, but I could not change voicecall-ui or lipstick compositor to read it's events from /dev/input/event1. why ? needs more investigation...

so here is how I did hack to make it happen:
I created mce configuration file with the collowing line:
CODE

[EVDEV]
KEY_SEND=KEY_HOME


that will tell mce to translate silver button event to "home" key event, which makes it raise a powerkey signal with "home-key" argument

in /usr/share/voicecall-ui-jolla I added the following patch
CODE
--- main.qml.orig 2018-09-13 21:40:34.440266047 +0300
+++ /usr/share/voicecall-ui-jolla/main.qml 2018-09-13 17:07:11.751154474 +0300
@@ -336,6 +336,24 @@
}
}

+ NemoDBus.DBusInterface {
+ bus: NemoDBus.DBus.SystemBus
+ service: 'com.nokia.mce'
+ path: '/com/nokia/mce/signal'
+ iface: 'com.nokia.mce.signal'
+ signalsEnabled: true
+
+ function power_button_trigger(event) {
+ if (event == "home-key") {
+ if (main.state === 'incoming') {
+ telephony.incomingCall.answer()
+ } else if (telephony.primaryCall) {
+ telephony.primaryCall.hangup()
+ }
+ }
+ }
+ }
+
MessagesInterface { id: messaging }

VoiceCallManager {

this patch tells the application to handle dbus signal (the one we raised from mce) by answer/hangup according to call state.

this is bad engineering and it sends all running application to "cover" state, which is not nice, but it works.
I'm hoping to create a better solution soon, will be happy to get any leads for Sailfish QML documentation and specific Gemini PDA modifications (if any) in order to do a good job.

have fun
epninety
Thanks for your efforts, I've been hoping someone would come up with a patch for this - it's one of my very few bugbears with SFOS on Gemini.

One question (ok, two!) , where does the mce configuration file need to be placed? (and does it need a specific name?) (I don't know anything about mce)
yoram
QUOTE(epninety @ Sep 14 2018, 05:12 AM) *
Thanks for your efforts, I've been hoping someone would come up with a patch for this - it's one of my very few bugbears with SFOS on Gemini.

One question (ok, two!) , where does the mce configuration file need to be placed? (and does it need a specific name?) (I don't know anything about mce)


mce configuration files are scanned in /etc/mce
the name is only important for order, i use /etc/mce/20-evdev.ini
yoram
BTW, every feedback and suggestion on how to do it better, is welcome
epninety
I tried it out quickly on Friday but it didn't work and I didn't have time to investigate.

It looks like my mce file went missing somehow, I've replaced it and now the silver button sends all apps to cover state as expected.
I can't make it answer the call though, it simply mutes the ringing for some reason.
I will play some more when I have some free time.
yoram
QUOTE(epninety @ Sep 16 2018, 04:00 AM) *
I tried it out quickly on Friday but it didn't work and I didn't have time to investigate.

It looks like my mce file went missing somehow, I've replaced it and now the silver button sends all apps to cover state as expected.
I can't make it answer the call though, it simply mutes the ringing for some reason.
I will play some more when I have some free time.


I'm sorry, I forgot to mention that for patching voicecall-ui you should:
killall voicecall-ui
do the patching
run voicecall-ui again

I also prefer to kill mce (it is triggered back right away) after chanign it's configuration
yoram
QUOTE(yoram @ Sep 16 2018, 04:19 AM) *
QUOTE(epninety @ Sep 16 2018, 04:00 AM) *
I tried it out quickly on Friday but it didn't work and I didn't have time to investigate.

It looks like my mce file went missing somehow, I've replaced it and now the silver button sends all apps to cover state as expected.
I can't make it answer the call though, it simply mutes the ringing for some reason.
I will play some more when I have some free time.


I'm sorry, I forgot to mention that for patching voicecall-ui you should:
killall voicecall-ui
do the patching
run voicecall-ui again

I also prefer to kill mce (it is triggered back right away) after chanign it's configuration


Looks like I'm not very good at giving the full details. here is the full patch to voicecall-ui-jolla
CODE
--- main.qml.orig 2018-09-19 21:09:09.981556905 +0300
+++ /usr/share/voicecall-ui-jolla/main.qml 2018-09-19 21:09:37.170700448 +0300
@@ -9,6 +9,7 @@
import org.nemomobile.contacts 1.0
import org.nemomobile.notifications 1.0
import org.nemomobile.voicecall 1.0 as VoiceCall
+import org.nemomobile.dbus 2.0 as NemoDBus

import "common/CallLog.js" as CallLog
import "common"
@@ -334,6 +335,24 @@
}
}

+ NemoDBus.DBusInterface {
+ bus: NemoDBus.DBus.SystemBus
+ service: 'com.nokia.mce'
+ path: '/com/nokia/mce/signal'
+ iface: 'com.nokia.mce.signal'
+ signalsEnabled: true
+
+ function power_button_trigger(event) {
+ if (event == "home-key") {
+ if (main.state === 'incoming') {
+ telephony.incomingCall.answer()
+ } else if (telephony.primaryCall) {
+ telephony.primaryCall.hangup()
+ }
+ }
+ }
+ }
+
MessagesInterface { id: messaging }

VoiceCallManager {


sorry for the mess.
please comment on how (if at all) did it work for you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.