summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-08-09 18:27:08 +0900
committerHwanKyu Jhun <h.jhun@samsung.com>2016-12-12 00:10:49 -0800
commit9f290301d5eec50554b16ada4652f67d6f860429 (patch)
tree6e17622bc8479da4611083571991397b903e0a6f
parentbd152e3db5814f76ceb0d873be2fc44d8137f79e (diff)
downloadappcore-agent-9f290301d5eec50554b16ada4652f67d6f860429.tar.gz
appcore-agent-9f290301d5eec50554b16ada4652f67d6f860429.tar.bz2
appcore-agent-9f290301d5eec50554b16ada4652f67d6f860429.zip
While an application receives the AUL_SUSPEND event, the allowed_bg value is changed to "false". AMD always sends the AUL_SUSPEND event when the application is not allowed to run in the background. And, the allowed_bg value can be changed when the application receives the AUL_WAKE event. - Requires [aul] https://review.tizen.org/gerrit/#/c/83134/ [amd] https://review.tizen.org/gerrit/#/c/83044/ Change-Id: Ibaca3e8d0ba62f827b2abf2f58de44446c510ff1 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--src/appcore-agent.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/appcore-agent.c b/src/appcore-agent.c
index a33301f..df898ea 100644
--- a/src/appcore-agent.c
+++ b/src/appcore-agent.c
@@ -752,10 +752,9 @@ static int __aul_handler(aul_type type, bundle *b, void *data)
ret = __agent_terminate(data);
break;
case AUL_SUSPEND:
- if (!ac->allowed_bg) {
- _DBG("[__SUSPEND__] suspend");
- __add_suspend_timer(data);
- }
+ ac->allowed_bg = false;
+ _DBG("[__SUSPEND__] suspend");
+ __add_suspend_timer(data);
break;
case AUL_WAKE:
if (!ac->allowed_bg) {
@@ -763,6 +762,14 @@ static int __aul_handler(aul_type type, bundle *b, void *data)
__remove_suspend_timer(data);
__exit_from_suspend(data);
}
+
+ if (b) {
+ bundle_get_str(b, AUL_K_ALLOWED_BG, &bg);
+ if (bg && strcmp(bg, "ALLOWED_BG") == 0) {
+ _DBG("[__SUSPEND__] allowed background");
+ ac->allowed_bg = true;
+ }
+ }
break;
default:
/* do nothing */