Fix bug of GetRuntimeVariable()
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 11 May 2015 11:40:06 +0000 (20:40 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Mon, 11 May 2015 11:40:06 +0000 (20:40 +0900)
Change-Id: Ibe1928c79c1571866847c7bbf912a2703d0ca668

src/extension/extension_server.cc
src/runtime/web_application.cc

index c2305c3..77c28bd 100644 (file)
@@ -66,6 +66,13 @@ bool ExtensionServer::Start() {
 }
 
 bool ExtensionServer::Start(const StringVector& paths) {
+  // Connect to DBusServer for Application of Runtime
+  if (!dbus_application_client_.ConnectByName(
+          app_uuid_ + "." + std::string(kDBusNameForApplication))) {
+    LOGGER(ERROR) << "Failed to connect to the dbus server for Application.";
+    return false;
+  }
+
   // Register system extensions to support Tizen Device APIs
   RegisterSystemExtensions();
 
@@ -76,13 +83,6 @@ bool ExtensionServer::Start(const StringVector& paths) {
     }
   }
 
-  // Connect to DBusServer for Application of Runtime
-  if (!dbus_application_client_.ConnectByName(
-          app_uuid_ + "." + std::string(kDBusNameForApplication))) {
-    LOGGER(ERROR) << "Failed to connect to the dbus server for Application.";
-    return false;
-  }
-
   // Start DBusServer
   using std::placeholders::_1;
   using std::placeholders::_2;
@@ -102,6 +102,7 @@ bool ExtensionServer::Start(const StringVector& paths) {
 
 void ExtensionServer::RegisterExtension(const std::string& path) {
   Extension* ext = new Extension(path, this);
+  LOGGER(DEBUG) << "Register " << path;
   if (!ext->Initialize() || !RegisterSymbols(ext)) {
     delete ext;
     return;
index baf6b3e..bfbcc3d 100755 (executable)
@@ -277,9 +277,9 @@ void WebApplication::Launch(std::unique_ptr<wrt::AppControl> appcontrol) {
   // application instead of widget_id.
   // Currently, uuid is passed as encoded_bundle argument temporarily.
   // ewk_send_widget_info(ewk_context_, 1,
-  //                     elm_config_scale_get(),
-  //                     elm_theme_get(NULL),
-  //                    uuid_.c_str());
+  //                      elm_config_scale_get(),
+  //                      elm_theme_get(NULL),
+  //                      app_uuid_.c_str());
 
   std::unique_ptr<ResourceManager::Resource> res =
     resource_manager_->GetStartResource(appcontrol.get());
@@ -638,9 +638,7 @@ void WebApplication::HandleDBusMethod(GDBusConnection* /*connection*/,
                                       GVariant* parameters,
                                       GDBusMethodInvocation* invocation) {
   if (method_name == kMethodNotifyEPCreated) {
-    // TODO(wy80.choi): send signal to injected bundle to make connection
-    // between injected bundle and extension process
-    LOGGER(DEBUG) << "Call!!!! NotifyEPCreated!";
+    LOGGER(DEBUG) << "Received 'NotifyEPCreated' from ExtensionServer.";
   } else if (method_name == kMethodGetRuntimeVariable) {
     gchar* key;
     std::string value;
@@ -648,7 +646,8 @@ void WebApplication::HandleDBusMethod(GDBusConnection* /*connection*/,
     if (g_strcmp0(key, "runtime_name") == 0) {
       value = std::string("wrt");
     } else if (g_strcmp0(key, "app_id") == 0) {
-      value = appid_;
+      // TODO(wy80.choi): TEC requries double quotes, but webapi-plugins is not.
+      value = "\"" + appid_ + "\"";
     } else if (g_strcmp0(key, "encoded_bundle") == 0) {
       value = received_appcontrol_->encoded_bundle();
     }