LOGD("CREATE AMBIENT VIEWER");
}
-AmbientViewer::~AmbientViewer() = default;
+AmbientViewer::~AmbientViewer() {
+ if (receive_signal_conn_)
+ aul_app_com_leave(receive_signal_conn_);
+}
string AmbientViewer::GetUUID(string rid) const {
char uuid[37];
if (handle == nullptr)
return WATCH_HOLDER_ERROR_INVALID_PARAMETER;
+ if (handle->GetCurrent() == nullptr)
+ return WATCH_HOLDER_ERROR_INVALID_OPERATION;
+
*watch = reinterpret_cast<watch_h>(handle->GetCurrent().get());
return WATCH_HOLDER_ERROR_NONE;
if (handle == nullptr)
return WATCH_HOLDER_ERROR_INVALID_PARAMETER;
+ if (handle->GetCurrent() == nullptr)
+ return WATCH_HOLDER_ERROR_INVALID_OPERATION;
+
*watch = reinterpret_cast<sharable_watch_h>(handle->GetCurrent().get());
return WATCH_HOLDER_ERROR_NONE;
bundle* envelope, void* user_data) {
LOGI("Receive aod ambient event");
AmbientListener* listener = (AmbientListener*)user_data;
- tizen_base::Bundle b = tizen_base::Bundle(envelope, false, false);
+
+ if (!envelope) {
+ LOGE("Bad bundle data from application");
+ return -1;
+ }
+
+ tizen_base::Bundle b = tizen_base::Bundle(envelope, true, true);
std::string event_type= b.GetString("__APP_AMBIENT_EVENT__");
+ LOGI("event type (%s)", event_type.c_str());
int type = stoi(event_type);
std::string sender = b.GetString("__APP_AMBIENT_SENDER__");
b.Delete("__APP_AMBIENT_EVENT__");
AmbientListener::~AmbientListener() {
if (ambient_changed_signal_conn_)
aul_app_com_leave(ambient_changed_signal_conn_);
+
+ if (ambient_event_signal_conn_)
+ aul_app_com_leave(ambient_event_signal_conn_);
}
}