* limitations under the License.
*/
+#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#endif
+static void __on_resume(struct ui_priv *ui, bundle *b)
+{
+ LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]", ui->name);
+#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
+ if (ui->exit_from_suspend) {
+ _DBG("[__SUSPEND__] resume case");
+ ui->exit_from_suspend(ui);
+ }
+ if (ui->app_core->allowed_bg)
+ __appcore_timer_del(ui);
+#endif
+
+ if (ui->state == AS_PAUSED || ui->state == AS_CREATED) {
+ _DBG("[APP %d] RESUME", _pid);
+ if (ui->ops->resume) {
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER,
+ "APPCORE:RESUME");
+ ui->ops->resume(ui->ops->data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+ }
+ ui->state = AS_RUNNING;
+
+ if (ui->below_app) {
+ aul_app_group_activate_below(ui->below_app);
+ free(ui->below_app);
+ ui->below_app = NULL;
+ }
+ }
+ LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:done]", ui->name);
+ aul_status_update(STATUS_VISIBLE);
+}
+
+static int __is_legacy_lifecycle(void)
+{
+ static int legacy = -1;
+ const char *api_version;
+
+ if (legacy != -1)
+ return legacy;
+
+ api_version = getenv("TIZEN_API_VERSION");
+ if (api_version) {
+ if (strverscmp("2.4", api_version) <= 0)
+ legacy = 0;
+ else
+ legacy = 1;
+ } else {
+ legacy = 0;
+ }
+
+ return legacy;
+}
+
static void __do_app(enum app_event event, void *data, bundle * b)
{
int r = -1;
}
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]",
ui->name);
+ if (!bg_state && __is_legacy_lifecycle()) {
+ _DBG("Legacy lifecycle");
+ __on_resume(ui, b);
+ }
break;
case AE_PAUSE:
if (ui->state == AS_RUNNING) {
aul_status_update(STATUS_BG);
break;
case AE_RESUME:
- LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]",
- ui->name);
-#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
- if (ui->exit_from_suspend) {
- _DBG("[__SUSPEND__] resume case");
- ui->exit_from_suspend(ui);
- }
- if (ui->app_core->allowed_bg)
- __appcore_timer_del(ui);
-#endif
-
- if (ui->state == AS_PAUSED || ui->state == AS_CREATED) {
- _DBG("[APP %d] RESUME", _pid);
-
- if (ui->ops->resume) {
- traceBegin(TTRACE_TAG_APPLICATION_MANAGER,
- "APPCORE:RESUME");
- ui->ops->resume(ui->ops->data);
- traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
- }
- ui->state = AS_RUNNING;
-
- if (ui->below_app) {
- aul_app_group_activate_below(ui->below_app);
- free(ui->below_app);
- ui->below_app = NULL;
- }
- }
- /*TODO : rotation start*/
- /* r = appcore_resume_rotation_cb(); */
- LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:done]",
- ui->name);
- aul_status_update(STATUS_VISIBLE);
+ __on_resume(ui, b);
break;
case AE_TERMINATE_BGAPP:
if (ui->state == AS_PAUSED) {