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>
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) {
__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 */