[Common] replaced call GetCurrentExtension()->GetRuntimeVariable()
authorPiotr Kosko <p.kosko@samsung.com>
Fri, 3 Jul 2015 07:58:56 +0000 (09:58 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Fri, 3 Jul 2015 08:00:43 +0000 (10:00 +0200)
[Feature] replaced for performance purposes.

[Verification] code compiles without errors.

Change-Id: I7dfaca5d11276d1afededbb6ceb6536222a3b117
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
src/common/tools.cc
src/common/virtual_fs.cc

index 679f2c0a69f43a25e61ad0fc6bcc2b207dcd2f95..cc06772b99316ffba3e7f8c3b616fb59b68412c2 100644 (file)
@@ -18,6 +18,7 @@
 
 #ifdef PRIVILEGE_USE_DB
 #include <sqlite3.h>
+#include "common/current_application.h"
 #elif PRIVILEGE_USE_ACE
 #include <privilege_checker.h>
 #elif PRIVILEGE_USE_CYNARA
@@ -83,7 +84,7 @@ class AccessControlImpl {
     const char* kQuery = "select name from WidgetFeature where app_id = "
                          "(select app_id from WidgetInfo where tizen_appid = ?)"
                          " and rejected = 0";
-    const std::string app_id = common::GetCurrentExtension()->GetRuntimeVariable("app_id", 64);
+    const std::string app_id = common::CurrentApplication::GetInstance().GetApplicationId();
     sqlite3_stmt* stmt = nullptr;
 
     ret = sqlite3_prepare_v2(db, kQuery, -1, &stmt, nullptr);
index a2dc177aa9257569bd83e0157bb11548e94635a8..78d5f9d3b37ca8ca492c529996917183bc223e79 100755 (executable)
@@ -14,6 +14,7 @@
 #include "common/logger.h"
 #include "common/optional.h"
 #include "common/scope_exit.h"
+#include "common/current_application.h"
 
 namespace {
 
@@ -88,7 +89,7 @@ bool OnStorageDeviceSupported(int storage_id, storage_type_e type,
 
 common::optional<std::string> GetRootDir() {
   LoggerD("Enter");
-  std::string app_id = common::GetCurrentExtension()->GetRuntimeVariable("app_id", 64);
+  std::string app_id = common::CurrentApplication::GetInstance().GetApplicationId();
 
   app_info_h app_info;
   int err = app_info_create(app_id.c_str(), &app_info);