upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 07:59:38 +0000 (16:59 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 07:59:38 +0000 (16:59 +0900)
TC/unit/utc_ApplicationFW_appsvc_is_defapp_func.c
TC/unit/utc_ApplicationFW_appsvc_set_defapp_func.c
TC/unit/utc_ApplicationFW_appsvc_unset_defapp_func.c
debian/changelog
include/appsvc.h
include/appsvc_db.h
packaging/app-svc.spec
src/appsvc.c
src/appsvc_db.c
test/appsvc_test.c

index b67734c..edf2674 100644 (file)
@@ -63,7 +63,7 @@ static void utc_appsvc_is_defapp_func_01(void)
 {
        int ret = 0;
        ret =
-           appsvc_set_defapp("slp.appsvc.operation.abcd123", NULL, NULL,
+           appsvc_set_defapp("http://tizen.org/appsvc/operation/abcd123", NULL, NULL,
                              "org.tizen.abcd123");
        if (ret != APPSVC_RET_OK) {
                tet_infoline("Test initialization failed!!!");
index d7117c2..46921e1 100644 (file)
@@ -63,7 +63,7 @@ static void utc_appsvc_set_defapp_func_01(void)
 {
        int ret = APPSVC_RET_OK;
        ret =
-           appsvc_set_defapp("slp.appsvc.operation.abcd12", NULL, NULL,
+           appsvc_set_defapp("http://tizen.org/appsvc/operation/abcd12", NULL, NULL,
                              "org.tizen.abcd12");
        if (ret == APPSVC_RET_OK) {
                tet_infoline("appsvc_set_defapp test PASS!");
@@ -82,7 +82,7 @@ static void utc_appsvc_set_defapp_func_01(void)
 static void utc_appsvc_set_defapp_func_02(void)
 {
        int ret = APPSVC_RET_OK;
-       ret = appsvc_set_defapp("slp.appsvc.operation.abcd", NULL, NULL, NULL);
+       ret = appsvc_set_defapp("http://tizen.org/appsvc/operation/abcd", NULL, NULL, NULL);
        if (ret == APPSVC_RET_EINVAL) {
                tet_infoline("appsvc_set_defapp test PASS!");
                tet_printf("ret = %d", ret);
index a95f5f7..6e20043 100755 (executable)
@@ -64,7 +64,7 @@ static void utc_appsvc_unset_defapp_func_01(void)
 {
        int ret = APPSVC_RET_OK;
        ret =
-           appsvc_set_defapp("slp.appsvc.operation.xyz", NULL, NULL,
+           appsvc_set_defapp("http://tizen.org/appsvc/operation/xyz", NULL, NULL,
                              "org.tizen.xyz");
        if (ret != APPSVC_RET_OK) {
                tet_result(TET_UNINITIATED);
index 7dede2f..a498f0f 100755 (executable)
@@ -1,15 +1,7 @@
-app-svc (0.1.18-3) unstable; urgency=low
-
-  * Updated Code
-  * Git: pkgs/a/app-svc
-  * Tag: app-svc_0.1.18-3
-
- -- Sewook Park <sewook7.park@samsung.com>  Sat, 25 Feb 2012 17:35:51 +0900
-
-app-svc (0.1.18-2) unstable; urgency=low
+app-svc (0.1.21) unstable; urgency=low
 
   * Initial release
   * Git: pkgs/a/app-svc
-  * Tag: app-svc_0.1.18-2
+  * Tag: app-svc_0.1.21
 
- -- Jaeho lee <jaeho81.lee@samsung.com>  Wed, 07 Dec 2011 14:02:52 +0900
+ -- Jaeho Lee <jaeho81.lee@samsung.com>  Tue, 20 Mar 2012 14:11:59 +0900
index a3bc249..8cc03fb 100755 (executable)
@@ -54,45 +54,45 @@ extern "C" {
 
 
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_DEFAULT               "slp.appsvc.operation.DEFAULT"
+#define APPSVC_OPERATION_DEFAULT               "http://tizen.org/appsvc/operation/default"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_EDIT                  "slp.appsvc.operation.EDIT"
+#define APPSVC_OPERATION_EDIT                  "http://tizen.org/appsvc/operation/edit"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_VIEW                  "slp.appsvc.operation.VIEW"
+#define APPSVC_OPERATION_VIEW                  "http://tizen.org/appsvc/operation/view"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_PICK                  "slp.appsvc.operation.PICK"
+#define APPSVC_OPERATION_PICK                  "http://tizen.org/appsvc/operation/pick"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_CREATE_CONTENT                "slp.appsvc.operation.CREATE_CONTENT"
+#define APPSVC_OPERATION_CREATE_CONTENT                "http://tizen.org/appsvc/operation/create_content"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_CALL                  "slp.appsvc.operation.CALL"
+#define APPSVC_OPERATION_CALL                  "http://tizen.org/appsvc/operation/call"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_SEND                  "slp.appsvc.operation.SEND"
+#define APPSVC_OPERATION_SEND                  "http://tizen.org/appsvc/operation/send"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_SEND_TEXT             "slp.appsvc.operation.SEND_TEXT"
+#define APPSVC_OPERATION_SEND_TEXT             "http://tizen.org/appsvc/operation/send_text"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_DIAL                  "slp.appsvc.operation.DIAL"
+#define APPSVC_OPERATION_DIAL                  "http://tizen.org/appsvc/operation/dial"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_SEARCH                        "slp.appsvc.operation.SEARCH"
+#define APPSVC_OPERATION_SEARCH                        "http://tizen.org/appsvc/operation/search"
 /** APP_SVC OPERATION TYPE*/
-#define APPSVC_OPERATION_DOWNLOAD              "slp.appsvc.operation.DOWNLOAD"
+#define APPSVC_OPERATION_DOWNLOAD              "http://tizen.org/appsvc/operation/download"
 
 
 /** APP_SVC DATA SUBJECT*/
-#define APPSVC_DATA_SUBJECT            "slp.appsvc.data.SUBJECT"
+#define APPSVC_DATA_SUBJECT            "http://tizen.org/appsvc/data/subject"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_TO                 "slp.appsvc.data.TO"
+#define APPSVC_DATA_TO                 "http://tizen.org/appsvc/data/to"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_CC                 "slp.appsvc.data.CC"
+#define APPSVC_DATA_CC                 "http://tizen.org/appsvc/data/cc"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_BCC                        "slp.appsvc.data.BCC"
+#define APPSVC_DATA_BCC                        "http://tizen.org/appsvc/data/bcc"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_TEXT               "slp.appsvc.data.TEXT"
+#define APPSVC_DATA_TEXT               "http://tizen.org/appsvc/data/text"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_TITLE              "slp.appsvc.data.TITLE"
+#define APPSVC_DATA_TITLE              "http://tizen.org/appsvc/data/title"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_SELECTED           "slp.appsvc.data.SELECTED"
+#define APPSVC_DATA_SELECTED           "http://tizen.org/appsvc/data/selected"
 /** APP_SVC DATA TYPE*/
-#define APPSVC_DATA_KEYWORD            "slp.appsvc.data.KEYWORD"
+#define APPSVC_DATA_KEYWORD            "http://tizen.org/appsvc/data/keyword"
 
 
 /**
index d1dd899..711611c 100755 (executable)
@@ -36,6 +36,8 @@ extern "C"
 int _svc_db_add_app(const char *op, const char *mime_type, const char *uri, const char *pkg_name);
 int _svc_db_delete_with_pkgname(const char *pkg_name);
 char* _svc_db_get_app(const char *op, const char *mime_type, const char *uri);
+int _svc_db_is_defapp(const char *pkg_name);
+
 
 #ifdef __cplusplus
 }
index d3eb089..96d3a62 100644 (file)
@@ -1,9 +1,9 @@
 Name:      app-svc
 Summary:    App svc
-Version:       0.1.18
-Release:    1.1
+Version: 0.1.21
+Release:    2
 Group:      System/Libraries
-License:    SAMSUNG
+License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
 
 Requires(post): /sbin/ldconfig
@@ -22,20 +22,16 @@ BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(xdgmime)
 BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(glib-2.0)
+
+
 %description
 App svc
 
-%package -n libapp-svc
-Summary:    App svc Library
-Group:      Development/Libraries
-%description -n libapp-svc
-App svc (developement files)
-
-%package -n libapp-svc-devel
-Summary:    App svc Library Development files
+%package devel
+Summary:    App svc
 Group:      Development/Libraries
-Requires:   libapp-svc = %{version}-%{release}
-%description -n libapp-svc-devel
+Requires:   %{name} = %{version}-%{release}
+%description devel
 App svc (developement files)
 
 %prep
@@ -49,34 +45,35 @@ CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=/usr
 make %{?jobs:-j%jobs}
 
 %install
+rm -rf %{buildroot}
 %make_install
 
 
-%post -n libapp-svc
+%post
+
 /sbin/ldconfig
 mkdir -p /opt/dbspace
 sqlite3 /opt/dbspace/.appsvc.db < /opt/share/appsvc_db.sql
 rm -rf /opt/share/appsvc_db.sql
 
-chown root:5000 /opt/dbspace/.appsvc.db
-chown root:5000 /opt/dbspace/.appsvc.db-journal
+chown 0:5000 /opt/dbspace/.appsvc.db
+chown 0:5000 /opt/dbspace/.appsvc.db-journal
 chmod 664 /opt/dbspace/.appsvc.db
 chmod 664 /opt/dbspace/.appsvc.db-journal
 
-%postun -n libapp-svc -p /sbin/ldconfig
-rm -f /opt/dbspace/.appsvc.db
-rm -f /opt/dbspace/.appsvc.db-journal
-
+%postun -p /sbin/ldconfig
 
 %files
+%defattr(-,root,root,-)
+/opt/share/appsvc_db.sql
 /usr/bin/appsvc_test
-
-%files -n libapp-svc
-%config(missingok) /opt/share/appsvc_db.sql
 /usr/lib/libappsvc.so.0
 /usr/lib/libappsvc.so.0.1.0
 
-%files -n libapp-svc-devel
+%files devel
+%defattr(-,root,root,-)
 /usr/lib/pkgconfig/appsvc.pc
 /usr/lib/libappsvc.so
 /usr/include/appsvc/appsvc.h
+
+
index 0adcdca..432f250 100755 (executable)
@@ -62,10 +62,13 @@ typedef struct _appsvc_resolve_info_t{
        int mime_set;
 }appsvc_resolve_info_t;
 
+extern int aul_launch_app_with_result(const char *pkgname, bundle *kb,
+                              void (*cbfunc) (bundle *, int, void *),
+                              void *data);
+
 static appsvc_cb_info_t *__create_rescb(int request_code, appsvc_res_fn cbfunc,
                                        void *data);
 static void __remove_rescb(appsvc_cb_info_t *info);
-static void __bundle_iterate(const char *key, const char *val, void *data);
 static int __set_bundle(bundle *b, const char *key, const char *value);
 static void __aul_cb(bundle *b, int is_cancel, void *data);
 static int __svc_iter_func(const char* pkg_name, void *data);
@@ -99,15 +102,11 @@ static void __remove_rescb(appsvc_cb_info_t *info)
        if(info) free(info);
 }
 
-static void __bundle_iterate(const char *key, const char *val, void *data)
-{
-       static int i=0; 
-       _D("%d %s %s", i++, key, val);
-}
-
 static int __set_bundle(bundle *b, const char *key, const char *value)
 {
-       char *val = bundle_get_val(b, key);
+       const char *val = NULL;
+
+       val = bundle_get_val(b, key);
        if(val){
                if( bundle_del(b, key) != 0 ){
                        return APPSVC_RET_ERROR;
@@ -155,7 +154,7 @@ static int __set_bundle_array(bundle *b, const char *key, const char **value, in
 
 static void __aul_cb(bundle *b, int is_cancel, void *data)
 {
-       char *val;
+       const char *val = NULL;
        appsvc_cb_info_t*  cb_info;
        int res;
 
@@ -220,10 +219,10 @@ static int __get_resolve_info(bundle *b, appsvc_resolve_info_t *info)
        char *tmp2 = NULL;
        char *strtok_buf = NULL;
        
-       info->op = appsvc_get_operation(b);
-       info->uri = appsvc_get_uri(b);
-       info->origin_mime = info->mime = appsvc_get_mime(b);
-       info->pkgname = appsvc_get_pkgname(b);
+       info->op = (char *)appsvc_get_operation(b);
+       info->uri = (char *)appsvc_get_uri(b);
+       info->origin_mime = info->mime = (char *)appsvc_get_mime(b);
+       info->pkgname = (char *)appsvc_get_pkgname(b);
 
        if(info->uri) {
                if(strncmp(info->uri,"/",1) == 0){
@@ -338,7 +337,7 @@ static int __get_list_with_condition(char *op, char *scheme, char *mime, GSList
        if (ail_ret != AIL_ERROR_OK) 
                return APPSVC_RET_ERROR;
 
-       snprintf(svc_filter, MAX_FILTER_STR_SIZE-1, "%s:%s:%s", op, scheme, mime);
+       snprintf(svc_filter, MAX_FILTER_STR_SIZE-1, "%s|%s|%s", op, scheme, mime);
        _D("svc_filter : %s",svc_filter);
 
        ail_ret = ail_filter_add_str(filter, AIL_PROP_X_SLP_SVC_STR, svc_filter);
@@ -426,8 +425,6 @@ SLPAPI int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc,
        int pkg_count = 0;
        int ret = -1;
 
-       int mime_set = 0;
-
        GSList *pkg_list = NULL;
        GSList *iter = NULL;
        char *list_item;
index d56ca16..3edcbdb 100755 (executable)
@@ -78,7 +78,6 @@ static int __fini(void)
 
 int _svc_db_add_app(const char *op, const char *mime_type, const char *uri, const char *pkg_name)
 {
-       int ret = -1;
        char m[BUF_MAX_LEN];
        char u[BUF_MAX_LEN];
        char query[BUF_MAX_LEN];
@@ -142,7 +141,6 @@ int _svc_db_delete_with_pkgname(const char *pkg_name)
 int _svc_db_is_defapp(const char *pkg_name)
 {
        char query[BUF_MAX_LEN];
-       char* error_message = NULL;
        sqlite3_stmt *stmt;
        int cnt = 0;
        int ret = -1;
@@ -178,11 +176,9 @@ int _svc_db_is_defapp(const char *pkg_name)
 
 char* _svc_db_get_app(const char *op, const char *mime_type, const char *uri)
 {
-       char* res = NULL;
        char m[BUF_MAX_LEN];
        char u[BUF_MAX_LEN];
        char query[BUF_MAX_LEN];
-       char* error_message = NULL;
        sqlite3_stmt* stmt;
        int ret;
        char* pkgname;
@@ -225,7 +221,7 @@ char* _svc_db_get_app(const char *op, const char *mime_type, const char *uri)
        }
 
        pkgname = malloc(BUF_MAX_LEN);
-       strncpy(pkgname,        sqlite3_column_text(stmt, 0),BUF_MAX_LEN-1);
+       strncpy(pkgname, (const char *)sqlite3_column_text(stmt, 0),BUF_MAX_LEN-1);
        //pkgname = (char*) sqlite3_column_text(stmt, 0);
 
        _D("pkgname : %s\n",pkgname);
index bad6c65..7f8733f 100755 (executable)
@@ -42,7 +42,7 @@ typedef struct _test_func_t{
        char* usage;
 }test_func_t;
 
-__set_bundle_from_args(bundle * kb)
+void __set_bundle_from_args(bundle * kb)
 {
        int opt;
        char *op = NULL;
@@ -50,7 +50,6 @@ __set_bundle_from_args(bundle * kb)
        char *uri = NULL;
        char *package = NULL;
        char* key = NULL;
-       char* val = NULL;
        char* val_array[128];
        
        while( (opt = getopt(gargc,gargv,"d:o:m:u:p:")) != -1){
@@ -75,14 +74,17 @@ __set_bundle_from_args(bundle * kb)
                                if(optarg){
                                        int i = 0;
                                        key = strtok(optarg,",");
-                                       while(val_array[i] = strtok(NULL,","))
+                                       while(1)
                                        {
+                                               val_array[i] = strtok(NULL,",");
+                                               if(val_array[i] == NULL)
+                                                       break;
                                                i++;
                                        }
                                        if(i==1) 
                                                appsvc_add_data(kb, key, val_array[0]);
                                        else if(i>1) 
-                                               appsvc_add_data_array(kb, key, val_array, i);   
+                                               appsvc_add_data_array(kb, key, (const char **)val_array, i);
                                }
                                break;
                }
@@ -108,7 +110,6 @@ __set_bundle_from_args(bundle * kb)
 
 int run_svc()
 {
-       static int num=0;
        int ret;
        bundle *kb=NULL;
        kb = bundle_create();
@@ -150,11 +151,13 @@ static void prt_recvd_bundle(const char *key, const int type, const bundle_keyva
        size_t *array_item_size;
 
        char *val;
-       size_t *size;
+       size_t size;
        int i;
        
-       if(bundle_keyval_type_is_array(kv) > 0) {
-               bundle_keyval_get_array_val(kv, &array_val, &array_len, &array_item_size);
+       if(bundle_keyval_type_is_array((bundle_keyval_t *)kv) > 0) {
+               bundle_keyval_get_array_val((bundle_keyval_t *)kv,
+                       (void ***)&array_val, (unsigned int *)&array_len,
+                       &array_item_size);
                
                for (i=0;i<array_len;i++)
                {
@@ -162,7 +165,7 @@ static void prt_recvd_bundle(const char *key, const int type, const bundle_keyva
                }
                
        } else {
-               bundle_keyval_get_basic_val(kv, &val, &size);
+               bundle_keyval_get_basic_val((bundle_keyval_t *)kv, (void **)&val, &size);
                printf("recvd - key: %s, value: %s\n",key,val);
        }       
 }
@@ -193,12 +196,6 @@ int run_svc_res()
 {
        static int num=0;
        int ret;
-       int opt;
-       char *op = NULL;
-       char *mime = NULL;
-       char *uri = NULL;
-       char* key = NULL;
-       char* val = NULL;
 
        bundle *kb=NULL;
        kb = bundle_create();