Apply background management feature 42/62942/1 accepted/tizen/common/20160323.184338 accepted/tizen/common/20160324.084222 accepted/tizen/ivi/20160324.131624 accepted/tizen/mobile/20160324.132908 accepted/tizen/tv/20160324.132730 accepted/tizen/wearable/20160324.132654 submit/tizen/20160323.020400 submit/tizen/20160323.235918
authorDaehyeon Jung <darrenh.jung@samsung.com>
Mon, 21 Mar 2016 07:18:12 +0000 (16:18 +0900)
committerDaehyeon Jung <darrenh.jung@samsung.com>
Mon, 21 Mar 2016 07:19:09 +0000 (16:19 +0900)
Change-Id: I790800ea2299e4b780c39d773a4e3c9336bb4ecf
Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
include/aul.h
include/aul_cmd.h
src/launch.c

index de0a135..b95b229 100644 (file)
@@ -65,6 +65,8 @@ typedef enum _aul_type{
        AUL_TERMINATE,
        AUL_TERMINATE_BGAPP,
        AUL_PAUSE,
+       AUL_WAKE,
+       AUL_SUSPEND,
 }aul_type;
 
 /** AUL public key - To check caller's secuirty */
@@ -187,7 +189,8 @@ typedef enum _aul_type{
 #define AUL_K_SEQ_NUM          "__AUL_SEQ_NUM__"
 /** AUL internal private key */
 #define AUL_K_API_VERSION      "__AUL_API_VERSION__"
-
+/** AUL internal private key */
+#define AUL_K_ALLOWED_BG       "__AUL_ALLOWED_BG__"
 
 /**
  * @brief      This is callback function for aul_launch_init
index 48b8b4d..9d24cb0 100644 (file)
@@ -76,6 +76,10 @@ enum app_cmd {
 
        APP_REGISTER_PID,
 
+       /* background category */
+       APP_WAKE,
+       APP_SUSPEND,
+
        /* for special purpose */
        AMD_RELOAD_APPINFO,
        /* reserved for AMD Agent */
index d174c2c..033bb01 100644 (file)
@@ -113,6 +113,20 @@ static int app_pause(void)
        return 0;
 }
 
+static int app_prepare_to_suspend()
+{
+       _D("[__SUSPEND__]");
+       __call_aul_handler(AUL_SUSPEND, NULL);
+       return 0;
+}
+
+static int app_prepare_to_wake()
+{
+       _D("[__WAKE__]");
+       __call_aul_handler(AUL_WAKE, NULL);
+       return 0;
+}
+
 static int __get_aul_error(int res)
 {
        int ret;
@@ -455,6 +469,12 @@ int aul_sock_handler(int fd)
        case APP_COM_MESSAGE:
                app_com_recv(kbundle);
                break;
+       case APP_WAKE:
+               app_prepare_to_wake();
+               break;
+       case APP_SUSPEND:
+               app_prepare_to_suspend();
+               break;
        default:
                _E("no support packet");
        }