Remove unused codes 57/213057/1
authorhyunho <hhstark.kang@samsung.com>
Fri, 30 Aug 2019 01:34:01 +0000 (10:34 +0900)
committerhyunho <hhstark.kang@samsung.com>
Fri, 30 Aug 2019 01:34:01 +0000 (10:34 +0900)
Change-Id: I83008964209d8517bbfb4089eb2ba395224ee5c9
Signed-off-by: hyunho <hhstark.kang@samsung.com>
component_based/base/component.cc
component_based/base/component.h
component_based/base/component_implementation.h
component_based/base/resource_manager.cc [deleted file]
component_based/base/resource_manager.h [deleted file]
unit_tests/src/base/test_component_based_component.cc

index 3c5e7a568b78343feaead43ec920f725500b5236..cec29a8b400b025348dfa5c2c29e15105ec51dfd 100644 (file)
@@ -309,10 +309,6 @@ std::string Component::GetInstanceID() {
   return impl_->GetInstanceID();
 }
 
-ResourceManager& Component::GetResourceManager() {
-  return impl_->GetResourceManager();
-}
-
 void Component::Finish() {
   auto& mgr = internal::ComponentManager::GetInst();
   mgr.Exit(impl_->GetInstanceID());
index 8b9a58a9b49f5e8c861be2a9f92043d6fce94015..8353ff5ece3596ca15a7af8672c22098f2b7545d 100644 (file)
@@ -26,7 +26,6 @@
 #include "component_based/base/device_orientation.h"
 #include "component_based/base/low_battery.h"
 #include "component_based/base/low_memory.h"
-#include "component_based/base/resource_manager.h"
 #include "component_based/base/suspended_state.h"
 
 #ifndef EXPORT_API
@@ -80,7 +79,6 @@ class EXPORT_API Component {
 
   std::string GetComponentID();
   std::string GetInstanceID();
-  ResourceManager& GetResourceManager();
   void Finish();
   Type GetType();
   void RegisterAction(std::string app_control_name);
index 568aec4e5a420ee7c9bb10622f3484cde003e4bb..57d431b149dca175a56a340a438edae75e11c50f 100644 (file)
@@ -27,7 +27,6 @@
 #include "component_based/base/action_internal.h"
 #include "component_based/base/component.h"
 #include "component_based/base/component_manager_internal.h"
-#include "component_based/base/resource_manager.h"
 #include "component_based/base/system_event_internal.h"
 #include "component_based/base/content_manager_internal.h"
 
@@ -71,10 +70,6 @@ class Component::Impl : internal::ComponentManager::IEventListener,
     return inst_id_;
   }
 
-  ResourceManager& GetResourceManager() {
-    return res_mgr_;
-  }
-
   void SendAsync(AppControl control, AppControl::IEventListener* ev);
   AppControl Send(AppControl control);
 
@@ -96,7 +91,6 @@ class Component::Impl : internal::ComponentManager::IEventListener,
   std::string inst_id_;
   std::unique_ptr<internal::SystemEvent> sys_ev_;
   std::unique_ptr<internal::ContentManager> content_mgr_;
-  ResourceManager res_mgr_;
   State state_ = State::None;
   std::map<std::string, std::unique_ptr<internal::Action>> act_map_;
 };
diff --git a/component_based/base/resource_manager.cc b/component_based/base/resource_manager.cc
deleted file mode 100644 (file)
index f762815..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <app_resource_manager.h>
-
-#include <memory>
-#include <string>
-
-#include "component_based/base/dlog_internal.h"
-#include "component_based/base/resource_manager.h"
-
-namespace component_based {
-
-std::string ResourceManager::Get(ResourceManager::Type type, std::string id) {
-  char* path = nullptr;
-  int r = app_resource_manager_get(static_cast<app_resource_e>(type),
-      id.c_str(), &path);
-  if (r != APP_RESOURCE_ERROR_NONE) {
-    LOGE("Failed to get resource(%s). error(%d)", id.c_str(), r);
-    return std::string("");
-  }
-
-  auto p = std::unique_ptr<char, decltype(std::free)*>(path, std::free);
-  return std::string(p.get());
-}
-
-}  // namespace component_based
diff --git a/component_based/base/resource_manager.h b/component_based/base/resource_manager.h
deleted file mode 100644 (file)
index 13ffddf..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_
-#define COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_
-
-#include <string>
-
-#ifndef EXPORT_API
-#define EXPORT_API __attribute__((visibility("default")))
-#endif
-
-namespace component_based {
-
-class EXPORT_API ResourceManager {
- public:
-  enum class Type {
-    Image,
-    Layout,
-    Sound,
-    Bin,
-  };
-
-  std::string Get(Type type, std::string id);
-};
-
-}  // namespace component_based
-
-#endif  // COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_
index 7454e34ad5ca9f0999555f00366f0ac055558e5d..96106c0d6dfdfb088a5ea9a77d83cfc150b0ac30 100644 (file)
@@ -11,7 +11,6 @@
 #include "component_based/base/service_component.h"
 #include "component_based/base/component.h"
 #include "component_based/base/component_implementation.h"
-#include "component_based/base/resource_manager.h"
 
 #include "unit_tests/mock/mock_app_common.h"
 #include "unit_tests/mock/mock_app_control.h"
@@ -134,11 +133,6 @@ TEST_F(ComponentTest, TestComponentClass) {
 
   component_based::Component::Type type = fc->GetType();
   EXPECT_EQ(type, component_based::Component::Type::Frame);
-
-  component_based::ResourceManager rm = fc->GetResourceManager();
-  std::string path = rm.Get(component_based::ResourceManager::Type::Sound, "test");
-  EXPECT_STREQ(path.c_str(), "tmp");
-
   fc->Finish();
 
   fc->RegisterAction(std::string("action"));