summaryrefslogtreecommitdiffstats
path: root/bluetooth-manager.c
diff options
context:
space:
mode:
authorsrimaldia <hariasti.srimaldia-1@jp.alps.com>2016-12-22 18:42:54 +0900
committersrimaldia <hariasti.srimaldia-1@jp.alps.com>2016-12-22 20:43:33 +0900
commit562c232a4c172aa1f6fcf11765531c464f5c832a (patch)
tree62aab4a24a97be5a489df48987050816c12dc2ae /bluetooth-manager.c
parent68de4f90d5795475016189cff12d7e0011b07d37 (diff)
Add status icon for bluetooth
<?xml version="1.0"?> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <policy context="default"> <allow send_destination="org.agl.homescreen"/> </policy> </busconfig> Change-Id: I598fd21f66620a518d5cc4068c352c31961834bd Signed-off-by: srimaldia <hariasti.srimaldia-1@jp.alps.com>
Diffstat (limited to 'bluetooth-manager.c')
-rw-r--r--bluetooth-manager.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/bluetooth-manager.c b/bluetooth-manager.c
index 4c49196..893760d 100644
--- a/bluetooth-manager.c
+++ b/bluetooth-manager.c
@@ -743,5 +743,36 @@ int isHFPConnected(struct btd_device *addr) {
}
+GError* setHMIStatus(enum btStates state) {
+
+ gchar *iconString = NULL;
+ GDBusConnection *connection;
+ GVariant *params = NULL;
+ GVariant *message = NULL;
+ GError *error = NULL;
+
+ if (state==INACTIVE) iconString = "qrc:/images/Status/HMI_Status_Bluetooth_Inactive-01.png";
+ else if (state==ACTIVE) iconString = "qrc:/images/Status/HMI_Status_Bluetooth_On-01.png";
+ else iconString = "qrc:/images/Status/HMI_Status_Bluetooth_Inactive-01.png";
+
+ connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
+
+ params = g_variant_new("(is)", HOMESCREEN_BT_ICON_POSITION, iconString);
+
+ message = g_dbus_connection_call_sync(connection, HOMESCREEN_SERVICE,
+ HOMESCREEN_ICON_PATH, HOMESCREEN_ICON_INTERFACE, "setStatusIcon", params,
+ NULL, G_DBUS_CALL_FLAGS_NONE,
+ DBUS_REPLY_TIMEOUT, NULL, &error);
+
+ if (error) {
+ printf("error: %s\n", error->message);
+
+ return error;
+ } else {
+ return NULL;
+ }
+
+}
+
/************************************** The End Of File **************************************/