When ok, cancel or back button is pressed,
power_lock_expired_terminate runs first.
It causes duplicated reply.
Current problem is as below.
1. User press cancel button
ex) send_result(CLOSE_APP) is executed by power_lock_expired_terminate
send_result(ALLOW_APP) is executed by power_lock_expired_allow_app
2. User choose ok button
ex) send_result(CLOSE_APP) is executed by power_lock_expired_terminate
send_result(CLOSE_APP) is executed by power_lock_expired_close_app
So, add button_id to fix duplicated reply.
1. User press cancel button
ex) send_result(CLOSE_APP) is not executed because button_id is ALLOW_APP
send_result(ALLOW_APP) is executed by power_lock_expired_allow_app
2. User choose ok button
ex) send_result(CLOSE_APP) is not executed because button_id is CLOSE_APP
send_result(CLOSE_APP) is executed by power_lock_expired_close_app
Finally, remove result_sended.
Because result_sended does not work properly.
Change-Id: I43cc267ccc1825cb6f8726645492fc8c6a3c1044
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
#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;
{
_I("Allow is selected.");
+ button_id = ALLOW_APP;
unload_simple_popup(ops);
send_result(ALLOW_APP);
{
_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 = {