class LaunchAppRunnable : public Runnable {
protected:
std::string mPkg;
+ std::string mKey;
+ std::string mValue;
public:
- LaunchAppRunnable(std::string pkg);
+ LaunchAppRunnable(std::string pkg, std::string key, std::string value);
std::string getPkgName();
void run() const override;
};
::grpc::Status LaunchAppCommand::execute()
{
LOGI("LaunchApp --------------- ");
- std::unique_ptr<LaunchAppRunnable> cmd = std::make_unique<LaunchAppRunnable>(mRequest->packagename());
+ std::unique_ptr<LaunchAppRunnable> cmd = std::make_unique<LaunchAppRunnable>(mRequest->packagename(), mRequest->key(), mRequest->value());
std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
obj->executeAndWaitForEvents(cmd.get(), A11yEvent::EVENT_WINDOW_ACTIVATE, WAIT_APP_LAUNCH);
#include <app_control.h>
#endif
-LaunchAppRunnable::LaunchAppRunnable(std::string pkg)
- : mPkg{pkg}
+LaunchAppRunnable::LaunchAppRunnable(std::string pkg, std::string key, std::string value)
+ : mPkg{pkg}, mKey{key}, mValue{value}
{
}
return;
}
+ if (!mKey.empty() && !mValue.empty()) {
+ ret = app_control_add_extra_data(appControl, mKey.c_str(), mValue.c_str());
+ if (ret) {
+ LOGE("Launch Failed(app_control_add_extra_data) Err Code : %ull", ret);
+ app_control_destroy(appControl);
+ return;
+ }
+ }
+
ret = app_control_set_app_id(appControl, packageName.c_str());
if (ret) {
LOGE("Launch Failed(app_control_set_app_id) Err Code : %ull", ret);
std::string LaunchAppRunnable::getPkgName()
{
return mPkg;
-}
\ No newline at end of file
+}