Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - yoram

Pages: [1]
1
Gemini PDA - Sailfish OS / Use case for silver button
« on: September 13, 2018, 02:46:39 pm »
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:
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
[EVDEV]
KEY_SEND=KEY_HOME
[/div]

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
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']--- 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 {
[/div]    
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

Pages: [1]