#include <pkgmgr-info.h>
#include <functional>
#include <memory>
+#include <mutex>
#include <set>
#include <string>
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN_MOBILE) || defined(TIZEN_COMMON)
#include <context-service/context_history.h>
#elif defined(TIZEN_WEARABLE)
#include <context-service/wearable/context_history.h>
JsonCallback event_callback_;
JsonCallback status_callback_;
std::map<std::string, event_handler_h> event_handler_map_;
- std::set<LaunchAppControlCallbackData*> launch_app_control_set;
+ std::set<LaunchAppControlCallbackData*> launch_app_control_set_;
+ // We use static set of callback_data's pointers to be able to check whether
+ // callback is fired after ApplicationInstance destruction
+ static std::set<LaunchAppControlCallbackData*> launch_app_control_set_global_;
+ static std::mutex launch_app_control_set_mutex_;
static void OnEvent(const char* event_name, bundle* event_data, void* user_data);
static void OnStatusEvent(const char* type, const char* app_id,
app_manager_event_type_e event_type,
app_manager_event_state_e event_state, app_manager_event_h handle,
void* user_data);
-#if defined(TIZEN_MOBILE) || defined(TIZEN_WEARABLE)
+#if defined(TIZEN_MOBILE) || defined(TIZEN_WEARABLE) || defined(TIZEN_COMMON)
static common::PlatformResult GetContextHistory(
const picojson::value& args, picojson::object* out,
common::PlatformResult (*)(const picojson::value&, const context_history_filter_h,