using namespace app_control;
+struct app_control_s {
+ void* dummy;
+};
+
+static_assert(std::is_pod<app_control_s>::value,
+ "app_control_s must be a POD type");
+
namespace {
class ActionExt : public AppControlAction,
return APP_CONTROL_ERROR_OUT_OF_MEMORY;
}
- *app_control = static_cast<app_control_h>(handle);
+ *app_control = reinterpret_cast<app_control_h>(handle);
return APP_CONTROL_ERROR_NONE;
}
handle->SetOperation(APP_CONTROL_OPERATION_DEFAULT);
}
- *app_control = static_cast<app_control_h>(handle);
+ *app_control = reinterpret_cast<app_control_h>(handle);
return APP_CONTROL_ERROR_NONE;
}
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
delete handle;
return APP_CONTROL_ERROR_NONE;
}
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
*data = handle->ToBundle();
return APP_CONTROL_ERROR_NONE;
}
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (operation != nullptr) {
try {
handle->SetOperation(operation);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetOperation();
*operation = strdup(value.c_str());
if (*operation == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (uri != nullptr) {
try {
handle->SetUri(uri);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetUri();
*uri = strdup(value.c_str());
if (*uri == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (mime != nullptr) {
try {
handle->SetMime(mime);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetMime();
*mime = strdup(value.c_str());
if (*mime == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (category != nullptr) {
try {
handle->SetCategory(category);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetCategory();
*category = strdup(value.c_str());
if (*category == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (app_id != nullptr) {
try {
handle->SetAppId(app_id);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetAppId();
*app_id = strdup(value.c_str());
if (*app_id == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* control = static_cast<AppControl*>(app_control);
+ auto* control = reinterpret_cast<AppControl*>(app_control);
auto* handle = new (std::nothrow) AppControl(*control);
if (handle == nullptr) {
_E("Out of memory");
return APP_CONTROL_ERROR_OUT_OF_MEMORY;
}
- *clone = static_cast<app_control_h>(handle);
+ *clone = reinterpret_cast<app_control_h>(handle);
return APP_CONTROL_ERROR_NONE;
}
LaunchMode launch_mode = (mode == APP_CONTROL_LAUNCH_MODE_SINGLE) ?
LaunchMode::Single : LaunchMode::Group;
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
handle->SetLaunchMode(launch_mode);
return APP_CONTROL_ERROR_NONE;
}
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
LaunchMode launch_mode = handle->GetLaunchMode();
if (launch_mode == LaunchMode::Group)
*mode = APP_CONTROL_LAUNCH_MODE_GROUP;
if (ret != APP_CONTROL_ERROR_NONE)
return ret;
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
ret = aul_set_default_app_by_operation(handle->ToBundle());
if (ret != AUL_R_OK) {
_E("Failed to set default application. app_id(%s), error(%d)", app_id, ret);
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
try {
handle->AddExtraData(key, value);
} catch (Exception& e) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::vector<std::string> values(value, value + length);
handle->AddExtraDataArray(key, values);
} catch (Exception& e) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
handle->RemoveExtraData(key);
} catch (Exception& e) {
_E("Failed to remove extra data. error(%d)", e.GetErrorCode());
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string extra_data = handle->GetExtraData(key);
*value = strdup(extra_data.c_str());
if (*value == nullptr) {
char** array_data = nullptr;
int array_data_length = 0;
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::vector<std::string> values = handle->GetExtraDataArray(key);
array_data = reinterpret_cast<char**>(calloc(values.size(), sizeof(char*)));
if (array_data == nullptr) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
*array = handle->IsExtraDataArray(key);
} catch (Exception& e) {
_E("Failed to check whether the data is array or not. key(%s), error(%d)",
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
for (auto& key : handle->GetExtraDataKeys()) {
if (!callback(app_control, key.c_str(), user_data))
break;
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
for (auto& app_id : handle->GetMatchedAppIds()) {
if (!callback(app_control, app_id.c_str(), user_data))
break;
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string caller = handle->GetCaller();
*app_id = strdup(caller.c_str());
if (*app_id == nullptr) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
*requested = handle->IsReplyRequested();
} catch (Exception& e) {
_E("Invalid app-control handle");
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
tizen_base::Bundle b(data, true, true);
handle->SetBundle(b);
return APP_CONTROL_ERROR_NONE;
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
auto* b = handle->ToBundle();
*data = bundle_dup(b);
if (*data == nullptr) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
handle->EnableAppStartedResultEvent();
} catch (Exception& e) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (instance_id != nullptr) {
try {
handle->SetInstanceId(instance_id);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetInstanceId();
*instance_id = strdup(value.c_str());
if (*instance_id == nullptr) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (instance_id != nullptr) {
try {
handle->SetCallerInstanceId(instance_id);
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (component_id != nullptr) {
try {
handle->SetComponentId(component_id);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
std::string value = handle->GetComponentId();
*component_id = strdup(value.c_str());
if (*component_id == nullptr) {
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
handle->SetAppDefinedLoader(loader_name);
handle->SetLoaderId(loader_id);
} catch (Exception& e) {
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
if (handle->GetType() != AppControl::Type::Request ||
handle->GetLaunchedPid() < 0) {
_E("Invalid parameter");
return APP_CONTROL_ERROR_INVALID_PARAMETER;
}
- auto* handle = static_cast<AppControl*>(request);
+ auto* handle = reinterpret_cast<AppControl*>(request);
bundle* reply_data;
int ret = aul_svc_create_result_bundle(handle->ToBundle(), &reply_data);
if (ret != AUL_SVC_RET_OK) {
}
AppControl app_control(tizen_base::Bundle(reply_data, false, true));
- auto* reply_handle = static_cast<AppControl*>(reply);
+ auto* reply_handle = reinterpret_cast<AppControl*>(reply);
for (auto& key : reply_handle->GetExtraDataKeys()) {
if (reply_handle->IsExtraDataArray(key)) {
app_control.AddExtraDataArray(key, reply_handle->GetExtraDataArray(key));
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
auto request_context = std::make_shared<RequestContext>(
std::shared_ptr<AppControl>(new AppControl(*handle)),
nullptr, callback, user_data);
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
auto request_context = std::make_shared<RequestContext>(
std::shared_ptr<AppControl>(new AppControl(*handle)),
result_cb, reply_cb, user_data);
try {
AppControl* reply_handle = nullptr;
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
auto* broker = AppControlBroker::GetInst();
broker->SendLaunchRequest(handle, &reply_handle, result);
- *reply = static_cast<app_control_h>(reply_handle);
+ *reply = reinterpret_cast<app_control_h>(reply_handle);
} catch (Exception& e) {
return e.GetErrorCode();
}
}
try {
- auto* handle = static_cast<AppControl*>(app_control);
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
auto request_context = std::make_shared<RequestContext>(
std::shared_ptr<AppControl>(new AppControl(*handle)),
result_cb, nullptr, user_data);