[OTP] Handle Object Execute request
[platform/core/connectivity/bluetooth-frwk.git] / plugin / headed.c
index ea00b61..8ed7698 100644 (file)
@@ -24,6 +24,7 @@
 #include <bundle_internal.h>
 #include <tethering.h>
 #include <mime_type.h>
+#include <app_control.h>
 
 #include "plugin.h"
 #include "bluetooth-api.h"
@@ -290,6 +291,27 @@ void bt_destroy_popup_all(void)
        syspopup_destroy_all();
 }
 
+int bt_app_control_send_launch_request(char *absolute_path)
+{
+       BT_DBG("+");
+
+       app_control_h app_control;
+       int ret;
+
+       app_control_create(&app_control);
+       app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
+       app_control_set_uri(app_control, absolute_path);
+       app_control_set_mime(app_control, "*/*");
+
+       if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE)
+               ret = BLUETOOTH_ERROR_NONE;
+       else
+               ret = BLUETOOTH_ERROR_INTERNAL;
+
+       app_control_destroy(app_control);
+
+       return ret;
+}
 
 extern struct bluetooth_headed_plugin_t headed_plugin
 __attribute__ ((visibility("default")));