Switched to use repowerd compatible dbus messages
This commit is contained in:
		
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							@@ -42,8 +42,7 @@ SRC = \
 | 
				
			|||||||
  mce_proxy.c \
 | 
					  mce_proxy.c \
 | 
				
			||||||
  mce_tklock.c
 | 
					  mce_tklock.c
 | 
				
			||||||
GEN_SRC = \
 | 
					GEN_SRC = \
 | 
				
			||||||
  com.nokia.mce.request.c \
 | 
					  com.canonical.Unity.Screen.c
 | 
				
			||||||
  com.nokia.mce.signal.c
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Directories
 | 
					# Directories
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					# Repowerd compatibility layer for sailfish ofono-ril
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MCE Client switched to reference repowerd
 | 
				
			||||||
							
								
								
									
										20
									
								
								spec/com.canonical.Unity.Screen.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								spec/com.canonical.Unity.Screen.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?>
 | 
				
			||||||
 | 
					<!DOCTYPE node PUBLIC
 | 
				
			||||||
 | 
					  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
 | 
				
			||||||
 | 
					  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 | 
				
			||||||
 | 
					<node name="/com/canonical/Unity/Screen">
 | 
				
			||||||
 | 
					  <interface name="com.canonical.Unity.Screen">
 | 
				
			||||||
 | 
					    <method name="getDisplayStatus">
 | 
				
			||||||
 | 
					      <arg direction="out" name="displayState" type="s"/>
 | 
				
			||||||
 | 
					    </method>
 | 
				
			||||||
 | 
					    <method name="getTklockMode">
 | 
				
			||||||
 | 
					      <arg direction="out" name="modeName" type="s"/>
 | 
				
			||||||
 | 
					    </method>
 | 
				
			||||||
 | 
					    <signal name="displayStatusInd">
 | 
				
			||||||
 | 
					      <arg name="displayState" type="s"/>
 | 
				
			||||||
 | 
					    </signal>
 | 
				
			||||||
 | 
					    <signal name="tklockModeInd">
 | 
				
			||||||
 | 
					      <arg name="modeName" type="s"/>
 | 
				
			||||||
 | 
					    </signal>
 | 
				
			||||||
 | 
					  </interface>
 | 
				
			||||||
 | 
					</node>
 | 
				
			||||||
@@ -1,14 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8" ?>
 | 
					 | 
				
			||||||
<!DOCTYPE node PUBLIC
 | 
					 | 
				
			||||||
  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
 | 
					 | 
				
			||||||
  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 | 
					 | 
				
			||||||
<node name="/com/nokia/mce/request">
 | 
					 | 
				
			||||||
  <interface name="com.nokia.mce.request">
 | 
					 | 
				
			||||||
    <method name="get_display_status">
 | 
					 | 
				
			||||||
      <arg direction="out" name="display_state" type="s"/>
 | 
					 | 
				
			||||||
    </method>
 | 
					 | 
				
			||||||
    <method name="get_tklock_mode">
 | 
					 | 
				
			||||||
      <arg direction="out" name="mode_name" type="s"/>
 | 
					 | 
				
			||||||
    </method>
 | 
					 | 
				
			||||||
  </interface>
 | 
					 | 
				
			||||||
</node>
 | 
					 | 
				
			||||||
@@ -1,14 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8" ?>
 | 
					 | 
				
			||||||
<!DOCTYPE node PUBLIC
 | 
					 | 
				
			||||||
  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
 | 
					 | 
				
			||||||
  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 | 
					 | 
				
			||||||
<node name="/com/nokia/mce/signal">
 | 
					 | 
				
			||||||
  <interface name="com.nokia.mce.signal">
 | 
					 | 
				
			||||||
    <signal name="display_status_ind">
 | 
					 | 
				
			||||||
      <arg name="display_state" type="s"/>
 | 
					 | 
				
			||||||
    </signal>
 | 
					 | 
				
			||||||
    <signal name="tklock_mode_ind">
 | 
					 | 
				
			||||||
      <arg name="tklock_mode" type="s"/>
 | 
					 | 
				
			||||||
    </signal>
 | 
					 | 
				
			||||||
  </interface>
 | 
					 | 
				
			||||||
</node>
 | 
					 | 
				
			||||||
@@ -38,14 +38,10 @@
 | 
				
			|||||||
#include "mce_proxy.h"
 | 
					#include "mce_proxy.h"
 | 
				
			||||||
#include "mce_log_p.h"
 | 
					#include "mce_log_p.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <mce/dbus-names.h>
 | 
					 | 
				
			||||||
#include <mce/mode-names.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <gutil_misc.h>
 | 
					#include <gutil_misc.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Generated headers */
 | 
					/* Generated headers */
 | 
				
			||||||
#include "com.nokia.mce.request.h"
 | 
					#include "com.canonical.Unity.Screen.h"
 | 
				
			||||||
#include "com.nokia.mce.signal.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mce_display_priv {
 | 
					struct mce_display_priv {
 | 
				
			||||||
    MceProxy* proxy;
 | 
					    MceProxy* proxy;
 | 
				
			||||||
@@ -62,6 +58,12 @@ enum mce_display_signal {
 | 
				
			|||||||
#define SIGNAL_VALID_CHANGED_NAME   "mce-display-valid-changed"
 | 
					#define SIGNAL_VALID_CHANGED_NAME   "mce-display-valid-changed"
 | 
				
			||||||
#define SIGNAL_STATE_CHANGED_NAME   "mce-display-state-changed"
 | 
					#define SIGNAL_STATE_CHANGED_NAME   "mce-display-state-changed"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MCE_DISPLAY_OFF_STRING "off"
 | 
				
			||||||
 | 
					#define MCE_DISPLAY_DIM_STRING "dim"
 | 
				
			||||||
 | 
					#define MCE_DISPLAY_ON_STRING "on"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MCE_DISPLAY_SIG "displayStatusInd"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static guint mce_display_signals[SIGNAL_COUNT] = { 0 };
 | 
					static guint mce_display_signals[SIGNAL_COUNT] = { 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef GObjectClass MceDisplayClass;
 | 
					typedef GObjectClass MceDisplayClass;
 | 
				
			||||||
@@ -113,8 +115,8 @@ mce_display_status_query_done(
 | 
				
			|||||||
    char* status = NULL;
 | 
					    char* status = NULL;
 | 
				
			||||||
    MceDisplay* self = MCE_DISPLAY(arg);
 | 
					    MceDisplay* self = MCE_DISPLAY(arg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (com_nokia_mce_request_call_get_display_status_finish(
 | 
					    if (com_canonical_unity_screen_call_get_display_status_finish(
 | 
				
			||||||
        COM_NOKIA_MCE_REQUEST(proxy), &status, result, &error)) {
 | 
					        COM_CANONICAL_UNITY_SCREEN(proxy), &status, result, &error)) {
 | 
				
			||||||
        GDEBUG("Display is currently %s", status);
 | 
					        GDEBUG("Display is currently %s", status);
 | 
				
			||||||
        mce_display_status_update(self, status);
 | 
					        mce_display_status_update(self, status);
 | 
				
			||||||
        g_free(status);
 | 
					        g_free(status);
 | 
				
			||||||
@@ -134,7 +136,7 @@ mce_display_status_query_done(
 | 
				
			|||||||
static
 | 
					static
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
mce_display_status_ind(
 | 
					mce_display_status_ind(
 | 
				
			||||||
    ComNokiaMceSignal* proxy,
 | 
					    ComCanonicalUnityScreen* proxy,
 | 
				
			||||||
    const char* status,
 | 
					    const char* status,
 | 
				
			||||||
    gpointer arg)
 | 
					    gpointer arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -161,7 +163,7 @@ mce_display_status_query(
 | 
				
			|||||||
            MCE_DISPLAY_SIG, G_CALLBACK(mce_display_status_ind), self);
 | 
					            MCE_DISPLAY_SIG, G_CALLBACK(mce_display_status_ind), self);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (proxy->request && proxy->valid) {
 | 
					    if (proxy->request && proxy->valid) {
 | 
				
			||||||
        com_nokia_mce_request_call_get_display_status(proxy->request, NULL,
 | 
					        com_canonical_unity_screen_call_get_display_status(proxy->request, NULL,
 | 
				
			||||||
            mce_display_status_query_done, mce_display_ref(self));
 | 
					            mce_display_status_query_done, mce_display_ref(self));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,11 +37,8 @@
 | 
				
			|||||||
#include "mce_proxy.h"
 | 
					#include "mce_proxy.h"
 | 
				
			||||||
#include "mce_log_p.h"
 | 
					#include "mce_log_p.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "mce/dbus-names.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Generated headers */
 | 
					/* Generated headers */
 | 
				
			||||||
#include "com.nokia.mce.request.h"
 | 
					#include "com.canonical.Unity.Screen.h"
 | 
				
			||||||
#include "com.nokia.mce.signal.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
GLOG_MODULE_DEFINE("mce");
 | 
					GLOG_MODULE_DEFINE("mce");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -57,6 +54,10 @@ enum mce_proxy_signal {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define SIGNAL_VALID_CHANGED_NAME   "mce-proxy-valid-changed"
 | 
					#define SIGNAL_VALID_CHANGED_NAME   "mce-proxy-valid-changed"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MCE_SERVICE "com.canonical.Unity.Screen"
 | 
				
			||||||
 | 
					#define MCE_REQUEST_PATH "/com/canonical/Unity/Screen"
 | 
				
			||||||
 | 
					#define MCE_SIGNAL_PATH "/com/canonical/Unity/Screen"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static guint mce_proxy_signals[SIGNAL_COUNT] = { 0 };
 | 
					static guint mce_proxy_signals[SIGNAL_COUNT] = { 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef GObjectClass MceProxyClass;
 | 
					typedef GObjectClass MceProxyClass;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,15 +40,14 @@
 | 
				
			|||||||
#include "mce_types.h"
 | 
					#include "mce_types.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct mce_proxy_priv MceProxyPriv;
 | 
					typedef struct mce_proxy_priv MceProxyPriv;
 | 
				
			||||||
struct _ComNokiaMceSignal;
 | 
					struct _ComCanonicalUnityScreen;
 | 
				
			||||||
struct _ComNokiaMceRequest;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct mce_proxy {
 | 
					typedef struct mce_proxy {
 | 
				
			||||||
    GObject object;
 | 
					    GObject object;
 | 
				
			||||||
    MceProxyPriv* priv;
 | 
					    MceProxyPriv* priv;
 | 
				
			||||||
    gboolean valid;
 | 
					    gboolean valid;
 | 
				
			||||||
    struct _ComNokiaMceSignal* signal;
 | 
					    struct _ComCanonicalUnityScreen* signal;
 | 
				
			||||||
    struct _ComNokiaMceRequest* request;
 | 
					    struct _ComCanonicalUnityScreen* request;
 | 
				
			||||||
} MceProxy;
 | 
					} MceProxy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef void
 | 
					typedef void
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,14 +38,10 @@
 | 
				
			|||||||
#include "mce_proxy.h"
 | 
					#include "mce_proxy.h"
 | 
				
			||||||
#include "mce_log_p.h"
 | 
					#include "mce_log_p.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <mce/dbus-names.h>
 | 
					 | 
				
			||||||
#include <mce/mode-names.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <gutil_misc.h>
 | 
					#include <gutil_misc.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Generated headers */
 | 
					/* Generated headers */
 | 
				
			||||||
#include "com.nokia.mce.request.h"
 | 
					#include "com.canonical.Unity.Screen.h"
 | 
				
			||||||
#include "com.nokia.mce.signal.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mce_tklock_priv {
 | 
					struct mce_tklock_priv {
 | 
				
			||||||
    MceProxy* proxy;
 | 
					    MceProxy* proxy;
 | 
				
			||||||
@@ -64,6 +60,16 @@ enum mce_tklock_signal {
 | 
				
			|||||||
#define SIGNAL_MODE_CHANGED_NAME   "mce-tklock-mode-changed"
 | 
					#define SIGNAL_MODE_CHANGED_NAME   "mce-tklock-mode-changed"
 | 
				
			||||||
#define SIGNAL_LOCKED_CHANGED_NAME "mce-tklock-locked-changed"
 | 
					#define SIGNAL_LOCKED_CHANGED_NAME "mce-tklock-locked-changed"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MCE_TK_LOCKED "locked"
 | 
				
			||||||
 | 
					#define MCE_TK_UNLOCKED "unlocked"
 | 
				
			||||||
 | 
					#define MCE_TK_SILENT_LOCKED "silent-locked"
 | 
				
			||||||
 | 
					#define MCE_TK_LOCKED_DIM "locked-dim"
 | 
				
			||||||
 | 
					#define MCE_TK_SILENT_LOCKED_DIM "silent-locked-dim"
 | 
				
			||||||
 | 
					#define MCE_TK_SILENT_UNLOCKED "silent-unlocked"
 | 
				
			||||||
 | 
					#define MCE_TK_LOCKED_DELAY "locked-delay"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MCE_DISPLAY_SIG "displayStatusInd"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static guint mce_tklock_signals[SIGNAL_COUNT] = { 0 };
 | 
					static guint mce_tklock_signals[SIGNAL_COUNT] = { 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef GObjectClass MceTklockClass;
 | 
					typedef GObjectClass MceTklockClass;
 | 
				
			||||||
@@ -135,8 +141,8 @@ mce_tklock_mode_query_done(
 | 
				
			|||||||
    char* status = NULL;
 | 
					    char* status = NULL;
 | 
				
			||||||
    MceTklock* self = MCE_TKLOCK(arg);
 | 
					    MceTklock* self = MCE_TKLOCK(arg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (com_nokia_mce_request_call_get_tklock_mode_finish(
 | 
					    if (com_canonical_unity_screen_call_get_tklock_mode_finish(
 | 
				
			||||||
        COM_NOKIA_MCE_REQUEST(proxy), &status, result, &error)) {
 | 
					        COM_CANONICAL_UNITY_SCREEN(proxy), &status, result, &error)) {
 | 
				
			||||||
        GDEBUG("Mode is currently %s", status);
 | 
					        GDEBUG("Mode is currently %s", status);
 | 
				
			||||||
        mce_tklock_mode_update(self, status);
 | 
					        mce_tklock_mode_update(self, status);
 | 
				
			||||||
        g_free(status);
 | 
					        g_free(status);
 | 
				
			||||||
@@ -156,7 +162,7 @@ mce_tklock_mode_query_done(
 | 
				
			|||||||
static
 | 
					static
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
mce_tklock_mode_ind(
 | 
					mce_tklock_mode_ind(
 | 
				
			||||||
    ComNokiaMceSignal* proxy,
 | 
					    ComCanonicalUnityScreen* proxy,
 | 
				
			||||||
    const char* mode,
 | 
					    const char* mode,
 | 
				
			||||||
    gpointer arg)
 | 
					    gpointer arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -180,10 +186,10 @@ mce_tklock_mode_query(
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    if (proxy->signal && !priv->tklock_mode_ind_id) {
 | 
					    if (proxy->signal && !priv->tklock_mode_ind_id) {
 | 
				
			||||||
        priv->tklock_mode_ind_id = g_signal_connect(proxy->signal,
 | 
					        priv->tklock_mode_ind_id = g_signal_connect(proxy->signal,
 | 
				
			||||||
            MCE_TKLOCK_MODE_SIG, G_CALLBACK(mce_tklock_mode_ind), self);
 | 
					            MCE_DISPLAY_SIG, G_CALLBACK(mce_tklock_mode_ind), self);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (proxy->request && proxy->valid) {
 | 
					    if (proxy->request && proxy->valid) {
 | 
				
			||||||
        com_nokia_mce_request_call_get_tklock_mode(proxy->request, NULL,
 | 
					        com_canonical_unity_screen_call_get_tklock_mode(proxy->request, NULL,
 | 
				
			||||||
            mce_tklock_mode_query_done, mce_tklock_ref(self));
 | 
					            mce_tklock_mode_query_done, mce_tklock_ref(self));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user