- added 'ENCRYPT_EXTENSION' to create encrypt-extension interface.
- launch mode is set to 'group' in the org.tizen.ode.xml.
- added a logic which is to get the 'dev_path' in encrypt-extension.cpp.
Change-Id: Ia35dd54f405c38bded2cca0e78e0d902e18260bd
Signed-off-by: s414kim <s414.kim@samsung.com>
./src/interface/external/decrypt-sdcard.cpp
./src/interface/external/insert-sdcard.cpp
./src/interface/external/password-sdcard.cpp
+ ./src/interface/external/encrypt-extension.cpp
./src/interface/external/retry-sdcard.cpp)
SET(EXTERNAL_LOCKTYPE_SRC
<privilege>http://tizen.org/privilege/notification</privilege>
<privilege>http://tizen.org/privilege/display</privilege>
</privileges>
- <ui-application appid="org.tizen.ode" exec="/usr/apps/org.tizen.ode/bin/org.tizen.ode" multiple="false" nodisplay="true" taskmanage="true" type="capp">
+ <ui-application appid="org.tizen.ode" exec="/usr/apps/org.tizen.ode/bin/org.tizen.ode" multiple="false" nodisplay="true" taskmanage="true" type="capp" launch_mode="group">
<label>ODE</label>
<icon>org.tizen.ode</icon>
</ui-application>
#include "password.h"
-PasswordChange::PasswordChange(Widget *parent)
- : confirmPassword(parent),
- createPassword(parent),
+PasswordChange::PasswordChange(Widget *parent, int type)
+ : PasswordInterface(type),
+ confirmPassword(parent, type),
+ createPassword(parent, type),
prevData("")
{
confirmPassword.onResult.connect(this, &PasswordChange::onConfirmed);
void PasswordChange::onCreated(int ret, const std::string &data)
{
- encryption.changePassword(prevData, data);
+ if (encryption != nullptr)
+ encryption->changePassword(prevData, data);
onResult.emit(ret, data);
}
#include "password.h"
-PasswordConfirm::PasswordConfirm(Widget *parent)
- : confirmPopup(parent, dgetText("IDS_ST_HEADER_USE_ENCRYPTED_SD_CARD"), dgetText("IDS_LCKSCN_NPBODY_ENTER_PASSWORD"), ""),
+PasswordConfirm::PasswordConfirm(Widget *parent, int type)
+ : PasswordInterface(type),
+ confirmPopup(parent, dgetText("IDS_ST_HEADER_USE_ENCRYPTED_SD_CARD"), dgetText("IDS_LCKSCN_NPBODY_ENTER_PASSWORD"), ""),
resetStoragePopup(parent, dgetText("IDS_ST_HEADER_COULDNT_USE_SD_CARD"), ""),
vconf(VCONFKEY_SYSMAN_MMC_STATUS),
attempt(0),
resetStoragePopup.show();
return;
}
- result = encryption.verifyPassword(confirmPopup.getEntryData());
+ if (encryption != nullptr)
+ result = encryption->verifyPassword(confirmPopup.getEntryData());
+ else
+ result = 1;
+
if (!result) {
updateContentText();
} else {
},
dgetText("IDS_ST_BUTTON_OK"),
[this](void *) {
- encryption.recovery();
+ encryption->recovery();
result = -1;
dispose();
});
#include "password.h"
-PasswordCreate::PasswordCreate(Widget *parent)
- : rememberPopup(parent, dgetText("IDS_ST_HEADER_REMEMBER_PASSWORD"), dgetText("IDS_ST_POP_MAKE_SURE_YOU_REMEMBER_YOUR_PASSWORD_IF_YOU_FORGET_IT_YOU_WILL_NO_LONGER_BE_ABLE_TO_USE_ANY_MSG")),
+PasswordCreate::PasswordCreate(Widget *parent, int type)
+ : PasswordInterface(type),
+ rememberPopup(parent, dgetText("IDS_ST_HEADER_REMEMBER_PASSWORD"), dgetText("IDS_ST_POP_MAKE_SURE_YOU_REMEMBER_YOUR_PASSWORD_IF_YOU_FORGET_IT_YOU_WILL_NO_LONGER_BE_ABLE_TO_USE_ANY_MSG")),
enterPopup(parent, dgetText("IDS_ST_BODY_PASSWORD"), dgetText("IDS_ST_HEADER_ENTER_NEW_PASSWORD_ABB"), formatString("IDS_LCKSCN_BODY_THE_PASSWORD_MUST_CONSIST_OF_AT_LEAST_PD_ALPHANUMERIC_CHARACTERS_INCLUDING_AT_LEAST_1_LETTER", 4)),
confirmPopup(parent, dgetText("IDS_ST_BODY_PASSWORD"), dgetText("IDS_ST_POP_CONFIRM_PASSWORD"), dgetText("IDS_ST_BODY_MAKE_SURE_YOU_REMEMBER_YOUR_PASSWORD")),
mode(InitPassword),
if (!isMatched()) {
return;
}
- if (mode == InitPassword)
- encryption.initPassword(confirmPopup.getEntryData());
+ if (mode == InitPassword && encryption != nullptr)
+ encryption->initPassword(confirmPopup.getEntryData());
data = confirmPopup.getEntryData();
result = 1;
dispose();
#include "password.h"
-PasswordDelete::PasswordDelete(Widget *parent)
- : deletePopup(parent, dgetText("IDS_ST_HEADER_DELETE_SD_CARD_PASSWORD"), dgetText("IDS_ST_POP_YOUR_DEVICE_WILL_FORGET_ALL_SD_CARDS_THAT_HAVE_PREVIOUSLY_BEEN_ENCRYPTED_BY_THIS_DEVICE_MSG")),
- confirmPassword(parent)
+PasswordDelete::PasswordDelete(Widget *parent, int type)
+ : PasswordInterface(type),
+ deletePopup(parent, dgetText("IDS_ST_HEADER_DELETE_SD_CARD_PASSWORD"), dgetText("IDS_ST_POP_YOUR_DEVICE_WILL_FORGET_ALL_SD_CARDS_THAT_HAVE_PREVIOUSLY_BEEN_ENCRYPTED_BY_THIS_DEVICE_MSG")),
+ confirmPassword(parent, type)
{
setDeletePopup();
confirmPassword.onResult.connect(this, &PasswordDelete::onDeleted);
if (ret == -1) {
onResult.emit(1, data);
} else if (ret == 1) {
- encryption.cleanPassword(data);
+ encryption->cleanPassword(data);
onResult.emit(0, data);
}
}
{
}
-PasswordInterface::PasswordInterface()
- : result(0)
+PasswordInterface::PasswordInterface(int mode)
+ : encryption(nullptr), result(0)
{
+ if (mode != EXTENSION)
+ encryption.reset(new ExternalEncryption{});
}
PasswordInterface::~PasswordInterface()
class PasswordInterface {
public:
- PasswordInterface();
+ enum Mode {
+ EXTENSION = 0,
+ EXTERNAL,
+ };
+
+ PasswordInterface(int mode);
virtual ~PasswordInterface();
virtual void show() = 0;
public:
Signal<int, const std::string&> onResult;
protected:
- ExternalEncryption encryption; /*TBD*/
+ std::unique_ptr<ExternalEncryption> encryption; /*TBD*/
int result;
};
ChangePassword,
};
- PasswordCreate(Widget *parent);
+ PasswordCreate(Widget *parent, int type);
~PasswordCreate();
void show();
class PasswordConfirm : public PasswordInterface {
public:
- PasswordConfirm(Widget *parent);
+ PasswordConfirm(Widget *parent, int type);
~PasswordConfirm();
void show();
class PasswordChange : public PasswordInterface {
public:
- PasswordChange(Widget *parent);
+ PasswordChange(Widget *parent, int type);
~PasswordChange();
void show();
class PasswordDelete : public PasswordInterface {
public:
- PasswordDelete(Widget *parent);
+ PasswordDelete(Widget *parent, int type);
~PasswordDelete();
void show();
changePasswordButton.setText(dgetText("IDS_ST_BUTTON_CHANGE_PASSWORD_ABB2"));
changePasswordButton.onClick = [this](void *) {
- passwordChange.reset(new PasswordChange(frame));
+ passwordChange.reset(new PasswordChange(frame, PasswordInterface::Mode::EXTERNAL));
passwordChange->show();
};
content->setContent("password_button", &changePasswordButton);
void DecryptSDCardInterface::checkPassword()
{
- passwordConfirm.reset(new PasswordConfirm(naviframe));
+ passwordConfirm.reset(new PasswordConfirm(naviframe, PasswordInterface::Mode::EXTERNAL));
passwordConfirm->onResult.connect(this, &DecryptSDCardInterface::onConfirmed);
passwordConfirm->show();
}
--- /dev/null
+/*
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "encrypt-extension.h"
+
+EncryptExtensionInfo::EncryptExtensionInfo(Widget *parent)
+ : Page(parent, "external_info", Page::Type::SetOneButton)
+{
+ setPartContent();
+}
+
+EncryptExtensionInfo::~EncryptExtensionInfo()
+{
+}
+
+void EncryptExtensionInfo::setPartContent()
+{
+ std::string info("");
+ info.append(dgetText("IDS_ST_BODY_ENCRYPTING_YOUR_SD_CARD_WILL_PROTECT_ITS_DATA_IF_ITS_LOST_OR_STOLEN_ENCRYPTED_SD_CARDS_CAN_ONLY_MSG"));
+ info.append("<br><br>");
+ info.append(dgetText("IDS_ST_BODY_ONCE_THE_SD_CARD_IS_ENCRYPTED_A_PASSWORD_IS_REQUIRED_TO_USE_IT_THE_SAME_PASSWORD_MUST_MSG"));
+
+ content->setText("msg_content", info);
+}
+
+EncryptExtensionCheck::EncryptExtensionCheck(Widget *parent)
+ : Page(parent, "external_check_status", Page::Type::SetTwoButton),
+ genlist(nullptr),
+ createButton(content.get()),
+ password(nullptr),
+ mmcStatus(true), pwdStatus(false),
+ groupIndex(dgetText("IDS_ST_BODY_TO_ENCRYPT_YOUR_SD_CARD_C")),
+ userData("")
+{
+ setPartContent();
+}
+
+EncryptExtensionCheck::~EncryptExtensionCheck()
+{
+}
+
+std::string EncryptExtensionCheck::getUserData()
+{
+ return userData;
+}
+
+void EncryptExtensionCheck::updateNextButton()
+{
+ if (mmcStatus && pwdStatus)
+ nextButton->setDisabled(false);
+ else
+ nextButton->setDisabled(true);
+}
+
+char *EncryptExtensionCheck::getLabel(const std::string &part, Evas_Object *obj, std::string *data)
+{
+ if (part == "elm.text") {
+ return ::strdup(dgetText(*data));
+ }
+ return nullptr;
+}
+
+void EncryptExtensionCheck::addItems(Genlist<std::string> *genlist)
+{
+ genlist->append("group_index", &groupIndex);
+}
+
+void EncryptExtensionCheck::setPartContent()
+{
+ content->emitSignal("checked,effect", "", "check_list", 1, 1);
+ updateNextButton();
+ passwordResultCallback(0, "");
+
+ std::string info("");
+ info.append(dgetText("IDS_ST_BODY_THE_ENCRYPTION_PROCESS_MAY_TAKE_A_LONG_TIME_DEPENDING_ON_THE_AMOUNT_OF_DATA_MSG"));
+ info.append("</br>");
+ info.append(dgetText("IDS_ST_BODY_MAKE_SURE_THAT_THE_BATTERY_IS_CHARGED_AND_KEEP_THE_PHONE_PLUGGED_IN_UNTIL_ENCRYPTION_IS_COMPLETE"));
+
+ content->setText("msg_content", info);
+
+ genlist.reset(new Genlist<std::string>(content.get(), 0));
+ genlist->setContentProvider(this);
+ content->setContent("group_index", genlist.get());
+
+ info.clear();
+ info.append(dgetText("IDS_ST_BODY_INSERT_THE_SD_CARD_ABB"));
+ content->setPartTableChildText("check_list", 1, 1, "check_text", info);
+
+ info.clear();
+ info.append(dgetText("IDS_ST_BODY_CREATE_AN_SD_CARD_PASSWORD"));
+ content->setPartTableChildText("check_list", 1, 2, "check_text", info);
+
+ createButton.setText(dgetText("IDS_ST_BUTTON_CREATE_PASSWORD"));
+ createButton.setStyle("auto_expand");
+ createButton.onClick = [this](void *) {
+ password.reset(new PasswordCreate(frame, PasswordInterface::Mode::EXTENSION));
+ password->onResult.connect(this, &EncryptExtensionCheck::passwordResultCallback);
+ password->show();
+ };
+ content->setContent("create_button", &createButton);
+}
+
+void EncryptExtensionCheck::passwordResultCallback(int status, const std::string &data)
+{
+ if (!status) {
+ pwdStatus = false;
+ createButton.setDisabled(false);
+ content->emitSignal("unchecked,effect", "", "check_list", 1, 2);
+ } else {
+ pwdStatus = true;
+ createButton.setDisabled(true);
+ content->emitSignal("checked,effect", "", "check_list", 1, 2);
+ userData = data;
+ }
+ updateNextButton();
+}
+
+EncryptExtensionInterface::EncryptExtensionInterface(AppControl *appControl)
+ : exitButton(nullptr), infoPage(nullptr), checkPage(nullptr), replyControl("org.tizen.ode", appControl), devPath(""), mappingNode("mapping_node")
+{
+ devPath = appControl->getData("dev_path");
+ mappingNode = appControl->getData("mapping_node");
+ setNaviframe();
+}
+
+EncryptExtensionInterface::~EncryptExtensionInterface()
+{
+}
+
+void EncryptExtensionInterface::mountStorage()
+{
+ int ret = 0;
+
+ ret = encryption.format(devPath, checkPage->getUserData());
+ if (ret != ODE_ERROR_NONE) {
+ replyControl.sendReply("result", "fail");
+ ::ui_app_exit();
+ }
+
+ ret = encryption.mount(devPath, checkPage->getUserData(), mappingNode);
+ if (ret != ODE_ERROR_NONE)
+ replyControl.sendReply("result", "fail");
+ else
+ replyControl.sendReply("result", "success");
+
+ ::ui_app_exit();
+}
+
+void EncryptExtensionInterface::createCheckPage()
+{
+ checkPage.reset(nullptr);
+ checkPage.reset(new EncryptExtensionCheck {naviframe});
+ checkPage->nextButton->onClickSignal.connect(this, &EncryptExtensionInterface::mountStorage);
+ checkPage->prevButton->onClick = [this](void *) {
+ naviframe->popItem();
+ };
+
+ naviframe->pushPage(dgetText("IDS_ST_HEADER_ENCRYPT_SD_CARD"), checkPage.get(), nullptr);
+}
+
+void EncryptExtensionInterface::create()
+{
+ NaviframeItem *item = nullptr;
+
+ exitButton.reset(new Button{naviframe});
+ exitButton->setStyle("naviframe/back_btn/default");
+ exitButton->onClick = [this](void *) {
+ naviframe->popItem();
+ };
+
+ infoPage.reset(new EncryptExtensionInfo {naviframe});
+ infoPage->nextButton->onClickSignal.connect(this, &EncryptExtensionInterface::createCheckPage);
+ item = naviframe->pushPage(dgetText("IDS_ST_HEADER_ENCRYPT_SD_CARD"), infoPage.get(), exitButton.get());
+ item->pagePopEvent.connect(this, &EncryptExtensionInterface::dispose);
+}
+
+void EncryptExtensionInterface::dispose()
+{
+ replyControl.sendReply("result", "cancel");
+ ::ui_app_exit();
+}
--- /dev/null
+/*
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ODE_ENCRYPT_EXTENSION_H_
+#define __ODE_ENCRYPT_EXTENSION_H__
+
+#include "../interface.h"
+#include "../progress.h"
+#include "../tools/vconf.h"
+#include "../tools/encryption.h"
+#include "../../widgets/appcontrol.h"
+#include "../../widgets/genlist.h"
+#include "../../widgets/button.h"
+#include "../external-locktype/password.h"
+
+class EncryptExtensionInfo : public Page {
+public:
+ EncryptExtensionInfo(Widget *parent);
+ ~EncryptExtensionInfo();
+
+ void setPartContent();
+};
+
+class EncryptExtensionCheck : public Page, public GenlistContentProvider<std::string> {
+public:
+ EncryptExtensionCheck(Widget *parent);
+ ~EncryptExtensionCheck();
+
+ std::string getUserData();
+ void setPartContent();
+ void passwordResultCallback(int status, const std::string &data);
+ void updateNextButton();
+
+ char *getLabel(const std::string &part, Evas_Object *obj, std::string *data);
+ void addItems(Genlist<std::string> *genlist);
+public:
+ std::unique_ptr<Genlist<std::string>> genlist;
+ Button createButton;
+ std::unique_ptr<PasswordInterface> password;
+
+ bool mmcStatus;
+ bool pwdStatus;
+ std::string groupIndex;
+ std::string userData;
+};
+
+class EncryptExtensionInterface : public ODEInterface {
+public:
+ EncryptExtensionInterface(AppControl *appControl);
+ ~EncryptExtensionInterface();
+
+ void create();
+ void dispose();
+ void mountStorage();
+ void createCheckPage();
+private:
+ std::unique_ptr<Button> exitButton;
+ std::unique_ptr<EncryptExtensionInfo> infoPage;
+ std::unique_ptr<EncryptExtensionCheck> checkPage;
+ ExtensionEncryption encryption;
+ AppControl replyControl;
+ std::string devPath;
+ std::string mappingNode;
+};
+#endif
createButton.setText(dgetText("IDS_ST_BUTTON_CREATE_PASSWORD"));
createButton.setStyle("auto_expand");
createButton.onClick = [this](void *) {
- password.reset(new PasswordCreate(frame));
+ password.reset(new PasswordCreate(frame, PasswordInterface::Mode::EXTERNAL));
password->onResult.connect(this, &EncryptSDCardCheck::passwordResultCallback);
password->show();
};
changeButton.setText(dgetText("IDS_ST_BUTTON_CHANGE_PW_ABB"));
changeButton.onClick = [this](void *) {
- password.reset(new PasswordChange(frame));
+ password.reset(new PasswordChange(frame, PasswordInterface::Mode::EXTERNAL));
password->onResult.connect(this, &EncryptSDCardCheck::passwordResultCallback);
password->show();
};
deleteButton.setText(dgetText("IDS_ST_BUTTON_DELETE_PW_ABB"));
deleteButton.onClick = [this](void *) {
- password.reset(new PasswordDelete(frame));
+ password.reset(new PasswordDelete(frame, PasswordInterface::Mode::EXTERNAL));
password->onResult.connect(this, &EncryptSDCardCheck::passwordResultCallback);
password->show();
};
void EncryptSDCardInterface::checkPassword()
{
- passwordConfirm.reset(new PasswordConfirm(naviframe));
+ passwordConfirm.reset(new PasswordConfirm(naviframe, PasswordInterface::Mode::EXTERNAL));
passwordConfirm->onResult.connect(this, &EncryptSDCardInterface::onConfirmed);
passwordConfirm->show();
}
PasswordSDCard::PasswordSDCard()
: baseLayout(new Layout(window)),
- passwordConfirm(baseLayout),
+ passwordConfirm(baseLayout, PasswordInterface::Mode::EXTENSION),
notification(NOTIFICATION_TYPE_NOTI),
progress(nullptr)
{
* limitations under the License.
*
*/
-
#include "encryption.h"
InternalEncryption::InternalEncryption()
::ode_external_encryption_encrypt(pwd.c_str(), option);
}
-void ExternalEncryption::mount(const std::string &pwd)
+int ExternalEncryption::mount(const std::string &pwd)
{
+ int ret = 0;
::ode_external_encryption_set_mount_password(pwd.c_str());
- ::ode_external_encryption_mount();
+ ret = ::ode_external_encryption_mount();
+ return ret;
+}
+
+void ExternalEncryption::umount()
+{
+ ::ode_external_encryption_umount();
}
void ExternalEncryption::decrypt(const std::string &pwd)
{
::ode_external_encryption_recovery();
}
+
+ExtensionEncryption::ExtensionEncryption()
+{
+}
+
+ExtensionEncryption::~ExtensionEncryption()
+{
+}
+
+int ExtensionEncryption::format(const std::string &device, const std::string &pwd)
+{
+ int ret = 0;
+ ret = ::ode_luks_format(device.c_str(), pwd.c_str());
+ return ret;
+}
+
+int ExtensionEncryption::mount(const std::string &device, const std::string &pwd, const std::string &node)
+{
+ int ret = 0;
+ ret = ::ode_luks_open(device.c_str(), pwd.c_str(), node.c_str());
+ return ret;
+}
+
+void ExtensionEncryption::umount(const std::string &node)
+{
+ ::ode_luks_close(node.c_str());
+}
#include <iostream>
#include <ode/external-encryption.h>
#include <ode/internal-encryption.h>
+#include <ode/luks.h>
class InternalEncryption {
public:
bool verifyPassword(const std::string &pwd);
void changePassword(const std::string &prev, const std::string &next);
void cleanPassword(const std::string &prev);
- void mount(const std::string &pwd);
+ int mount(const std::string &pwd);
+ void umount();
void encrypt(const std::string &pwd, int opt);
void decrypt(const std::string &pwd);
void recovery();
};
+class ExtensionEncryption {
+public:
+ ExtensionEncryption();
+ ~ExtensionEncryption();
+
+ int format(const std::string &device, const std::string &pwd);
+ int mount(const std::string &device, const std::string &pwd, const std::string &node);
+ void umount(const std::string &node);
+};
#endif
return Type::INSERT_SD_CARD;
} else if (!type.compare("SD_CARD_PASSWORD")) {
return Type::SD_CARD_PASSWORD;
+ } else if (!type.compare("ENCRYPT_EXTENSION")) {
+ return Type::ENCRYPT_EXTENSION;
}
+
return Type::DO_NOT_SUPPORTED;
}
case Type::SD_CARD_PASSWORD:
interface = new PasswordSDCard{};
break;
+ case Type::ENCRYPT_EXTENSION:
+ interface = new EncryptExtensionInterface{appControl.get()};
+ break;
default:
throw runtime::Exception("Do not supported viewtype");
break;
#include "interface/external/decrypt-sdcard.h"
#include "interface/external/insert-sdcard.h"
#include "interface/external/password-sdcard.h"
+#include "interface/external/encrypt-extension.h"
class ODELaunchPad : public Application {
public:
DECRYPT_SD_CARD,
INSERT_SD_CARD,
SD_CARD_PASSWORD,
+ ENCRYPT_EXTENSION,
DO_NOT_SUPPORTED,
};
* limitations under the License.
*
*/
-#include <dlog.h>
#include "appcontrol.h"
AppControl::AppControl(app_control_h handle)
- : appControl(nullptr)
+ : appControl(nullptr), caller(nullptr)
{
if (handle != nullptr) {
::app_control_clone(&appControl, handle);
}
AppControl::AppControl(const std::string &id)
- : appControl(nullptr)
+ : appControl(nullptr), caller(nullptr)
{
::app_control_create(&appControl);
setAppID(id);
}
+AppControl::AppControl(const std::string &id, AppControl *service)
+ : appControl(nullptr), caller(nullptr)
+{
+ ::app_control_create(&appControl);
+ setAppID(id);
+ if (service != nullptr)
+ ::app_control_clone(&caller, service->appControl);
+}
+
AppControl::~AppControl()
{
if (appControl != nullptr)
appControl->replyEventHandler.emit(&ugControl, &replyControl, result);
}
+
+void AppControl::sendReply(const std::string &key, const std::string &value)
+{
+ if (caller) {
+ setData(key, value);
+ ::app_control_reply_to_launch_request(appControl, caller, APP_CONTROL_RESULT_SUCCEEDED);
+ }
+}
public:
AppControl(app_control_h handle);
AppControl(const std::string &id);
+ AppControl(const std::string &id, AppControl *service);
~AppControl();
operator app_control_h();
void launch();
static void replyEventHandlerDispatcher(app_control_h ug, app_control_h reply, app_control_result_e result, void *data);
+ void sendReply(const std::string &key, const std::string &value);
public:
Signal<AppControl *, AppControl *, int> replyEventHandler;
private:
app_control_h appControl;
+ app_control_h caller;
};
#endif