summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-08-09 18:17:03 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-08-09 18:45:19 +0900
commitea3ad776b68d9503972f25ba388552d848bf5957 (patch)
tree6dc635f048705f48b5f72756f6d13d4136b1b9f9
parent5fcb8260f79b3a76ca3928ee8e8a11c187bded9d (diff)
downloadapp-core-accepted/tizen/common/20161212.185619.tar.gz
app-core-accepted/tizen/common/20161212.185619.tar.bz2
app-core-accepted/tizen/common/20161212.185619.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: I941e0bfd92c8f4750f18f83f8cf5e50f13219bd7 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--src/appcore.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/appcore.c b/src/appcore.c
index 144f15d..ca16b35 100644
--- a/src/appcore.c
+++ b/src/appcore.c
@@ -499,6 +499,7 @@ static int __aul_handler(aul_type type, bundle *b, void *data)
#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
const char *bg = NULL;
struct appcore *ac = data;
+ int suspend = APPCORE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND;
#endif
switch (type) {
@@ -571,15 +572,23 @@ static int __aul_handler(aul_type type, bundle *b, void *data)
case AUL_WAKE:
_DBG("[APP %d] AUL event: AUL_WAKE", _pid);
if (!ac->allowed_bg && ac->suspended_state) {
- int suspend = APPCORE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND;
__remove_suspend_timer(data);
__sys_do(ac, &suspend, SE_SUSPENDED_STATE);
ac->suspended_state = false;
}
+
+ if (b) {
+ bg = bundle_get_val(b, AUL_K_ALLOWED_BG);
+ if (bg && strcmp(bg, "ALLOWED_BG") == 0) {
+ _DBG("[__SUSPEND__] allowed background");
+ ac->allowed_bg = true;
+ }
+ }
break;
case AUL_SUSPEND:
_DBG("[APP %d] AUL event: AUL_SUSPEND", _pid);
- if (!ac->allowed_bg && !ac->suspended_state) {
+ ac->allowed_bg = false;
+ if (!ac->suspended_state) {
__remove_suspend_timer(data);
__flush_memory((gpointer)ac);
}