#define METHOD_LOCK_TIMEOUT_INPUT "LockTimeoutInput"
static const struct popup_ops power_lock_expired_ops;
-static bool result_sended;
+static int button_id = -1;
static char *request_id;
enum button_selected {
char buf[8];
char *param[2];
- if (result_sended)
- return;
-
- result_sended = true;
-
param[0] = request_id;
snprintf(buf, sizeof(buf), "%d", result);
param[1] = buf;
METHOD_LOCK_TIMEOUT_INPUT,
"si", param);
if (ret < 0)
- _E("Failed to deliver the result (%d)", ret);
+ _E("Failed to deliver the result: %d", ret);
}
static int power_lock_expired_get_content(const struct popup_ops *ops, char *content, unsigned int len)
ret = get_object_by_ops(ops, &obj);
if (ret < 0) {
- _E("Failed to get object (%d)", ret);
+ _E("Failed to get object: %d", ret);
return -ENOENT;
}
pid_str = (char *)bundle_get_val(obj->b, APP_PID);
if (!pid_str) {
- _E("Failed to get app pid");
+ _E("Failed to get app pid.");
return -ENOENT;
}
request_id = (char *)bundle_get_val(obj->b, REQ_ID);
if (!request_id) {
- _E("Failed to get request id");
+ _E("Failed to get request id.");
return -ENOENT;
}
if (ret != APP_MANAGER_ERROR_NONE) {
name = (char *)bundle_get_val(obj->b, APP_COMM);
if (!name) {
- _E("Failed to get app command");
+ _E("Failed to get app command.");
return -ENOENT;
}
}
static void power_lock_expired_allow_app(const struct popup_ops *ops)
{
- _I("Allow is selected");
+ _I("Allow is selected.");
+ button_id = ALLOW_APP;
unload_simple_popup(ops);
send_result(ALLOW_APP);
static void power_lock_expired_close_app(const struct popup_ops *ops)
{
- _I("Close is selected");
+ _I("Close is selected.");
+ button_id = CLOSE_APP;
unload_simple_popup(ops);
send_result(CLOSE_APP);
static void power_lock_expired_terminate(const struct popup_ops *ops)
{
- send_result(CLOSE_APP);
- result_sended = false;
+ if (button_id == -1)
+ send_result(CLOSE_APP);
}
static const struct popup_ops power_lock_expired_ops = {