const char connection_key[] = "connection_key";
const char error[] = "error";
const char error_msg[] = "message";
+const char default_app_id[] = "default";
+
const char msg_params[] = "msg_params";
const char info[] = "info";
(*message_)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
- (*message_)[strings::params][strings::connection_key] =
- (*message_)[strings::msg_params][strings::app_id];
- SendNotificationToMobile(message_);
+ std::string app_id = (*message_)[strings::msg_params][strings::app_id].asString();
+
+ if (0 == app_id.compare(strings::default_app_id)) {
+ ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
+ const std::set<ApplicationSharedPtr>& app_list = app_mgr->applications();
+ std::set<ApplicationSharedPtr>::const_iterator it = app_list.begin();
+ for (; app_list.end() != it; ++it) {
+ (*message_)[strings::params][strings::connection_key] =
+ static_cast<int32_t>((*it)->app_id());
+ SendNotificationToMobile(message_);
+ }
+ } else {
+ (*message_)[strings::params][strings::connection_key] =
+ (*message_)[strings::msg_params][strings::app_id];
+ SendNotificationToMobile(message_);
+ }
}
} // namespace commands
std::string filename = (*message_)[strings::msg_params][strings::file_name].asString();
+ std::vector<uint8_t> binary_data;
+ file_system::ReadBinaryFile(filename, binary_data);
+
if (mobile_apis::RequestType::PROPRIETARY == request_type) {
- std::vector<uint8_t> binary_data;
- file_system::ReadBinaryFile(filename, binary_data);
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+ (*message_)[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::JSON;
+ } else if (mobile_apis::RequestType::HTTP == request_type) {
+ (*message_)[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::BINARY;
(*message_)[strings::params][strings::binary_data] = binary_data;
}