OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Use case for silver button, How I made silver button answer/disconnect calls
yoram
post Sep 13 2018, 10:46 AM
Post #1





Group: Members
Posts: 15
Joined: 10-August 18
Member No.: 827,976



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
Go to the top of the page
 
+Quote Post
epninety
post Sep 14 2018, 05:12 AM
Post #2





Group: Members
Posts: 11
Joined: 21-July 18
Member No.: 826,550



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)
Go to the top of the page
 
+Quote Post
yoram
post Sep 14 2018, 09:56 AM
Post #3





Group: Members
Posts: 15
Joined: 10-August 18
Member No.: 827,976



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
Go to the top of the page
 
+Quote Post
yoram
post Sep 15 2018, 01:09 PM
Post #4





Group: Members
Posts: 15
Joined: 10-August 18
Member No.: 827,976



BTW, every feedback and suggestion on how to do it better, is welcome
Go to the top of the page
 
+Quote Post
epninety
post Sep 16 2018, 04:00 AM
Post #5





Group: Members
Posts: 11
Joined: 21-July 18
Member No.: 826,550



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.
Go to the top of the page
 
+Quote Post
yoram
post Sep 16 2018, 04:19 AM
Post #6





Group: Members
Posts: 15
Joined: 10-August 18
Member No.: 827,976



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
Go to the top of the page
 
+Quote Post
yoram
post Sep 19 2018, 10:11 AM
Post #7





Group: Members
Posts: 15
Joined: 10-August 18
Member No.: 827,976



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 12th December 2018 - 08:12 PM