[TBT][iotcon][Change the resource file path for iotcon] 22/186322/6
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 7 Jun 2018 07:19:44 +0000 (16:19 +0900)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 9 Aug 2018 09:24:38 +0000 (09:24 +0000)
Change-Id: Iea466bb00d73144926c088ea011272b3a47ec58f
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk
scripts_tpk/tpkbuild.sh
tbtcoreapp/src/view/tbt-iotcon-view.c

index a70856186c5cba6d3485fd3b62614d820061feb7..6d26bbc2982b71b645bac6811f96b31825fc26d2 100755 (executable)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index f39eeeb7b46cc4396f64ca346425947531d15787..7074e34b0d09322902e6bc6e924a13c94cca3b75 100755 (executable)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ
index de5d98c23022a97692f90aed23964a77856e0561..6d33af942ebffa5e968fb3dd7672ec6e9358afb6 100755 (executable)
@@ -190,14 +190,26 @@ modulearray=(org.tizen.coretbt_dataprovider org.tizen.coretbt_serviceapp org.tiz
        sdb push $PWD/release/binary-$ARCH/SampleMP3.mp3 /home/$EXECUTION_USER/media/Sounds
        sdb push $PWD/release/binary-$ARCH/sampleH263.3gp /home/$EXECUTION_USER/media/Videos
        sdb push $PWD/release/binary-$ARCH/tbt_push_auth.xml /home/$EXECUTION_USER/media/Others
-       sdb push $PWD/release/binary-$ARCH/iotcon-test-svr-db-client.dat /home/$EXECUTION_USER/media/Others
-       sdb push $PWD/release/binary-$ARCH/iotcon-test-svr-db-server.dat /home/$EXECUTION_USER/media/Others
        sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Images/dog_1024_960.gif
        sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Sounds/SampleMP3.mp3
        sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Videos/sampleH263.3gp
        sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Others/tbt_push_auth.xml
-       sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Others/iotcon-test-svr-db-client.dat
-       sdb shell chown $EXECUTION_USER:priv_mediastorage /home/$EXECUTION_USER/media/Others/iotcon-test-svr-db-server.dat
+
+       echo $yellow"Pushing iotcon db files"
+       sdb push $PWD/release/binary-$ARCH/iotcon-test-svr-db-client.dat /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/
+       sdb push $PWD/release/binary-$ARCH/iotcon-test-svr-db-server.dat /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/
+
+       sdb shell chown $EXECUTION_USER:5000 /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-client.dat
+       sdb shell chown $EXECUTION_USER:5000 /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-server.dat
+       sdb shell chmod 777 /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-client.dat
+       sdb shell chmod 777 /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-server.dat
+       sdb shell chsmack -a "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data
+       sdb shell chsmack -e "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data
+       sdb shell chsmack -a "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-client.dat
+       sdb shell chsmack -a "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-server.dat
+       sdb shell chsmack -e "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-client.dat
+       sdb shell chsmack -e "User::App::Shared" /home/$EXECUTION_USER/apps_rw/org.tizen.$MOD_NAME/data/iotcon-test-svr-db-server.dat
+
        echo ""$reset
        fi
        sdb root off
@@ -238,4 +250,4 @@ elif [ "install" == "$1" ]; then
 else
        echo "Entered invalid arguments"
        helpusage
-fi
\ No newline at end of file
+fi
index 37e646df430e83a02728ca6238effef4f7c52020..3660fd6c8c1e06353b7eeec7ad74fbc29747abf7 100755 (executable)
@@ -30,7 +30,7 @@
 #include <Elementary.h>
 #include <iotcon.h>
 #include <glib.h>
-
+#include <app_control.h>
 #include "utils/logger.h"
 #include "utils/config.h"
 #include "utils/ui-utils.h"
@@ -230,7 +230,18 @@ iotcon_view *iotcon_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
 #endif
        evas_object_show(this->info_list);
 
-       char db_file_path[256]={'\0',};
+       char db_file_path_server[256]={'\0',};
+       char db_file_path_client[256]={'\0',};
+       char* pPath = NULL;
+       pPath = app_get_data_path();
+       DBG("pPath %s",pPath);
+       if(!pPath)
+               return NULL;
+       snprintf(db_file_path_server, sizeof(db_file_path_server), "%s%s",pPath,"iotcon-test-svr-db-server.dat");
+       DBG("db_file_path_server file set = %s", db_file_path_server);
+       snprintf(db_file_path_client, sizeof(db_file_path_client), "%s%s",pPath,"iotcon-test-svr-db-client.dat");
+       DBG("db_file_path_client file set = %s", db_file_path_client);
+       free(pPath);
 
        if(this->view->tbt_info->apptype == TBT_APP_IOTCON_BASIC_SERVER)
        {
@@ -241,10 +252,7 @@ iotcon_view *iotcon_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
 
                int ret;
 
-           snprintf(db_file_path, sizeof(db_file_path), "%s/%s",TBT_LOGGING_DIR,"iotcon-test-svr-db-server.dat");
-           DBG("db_file_path file set = %s", db_file_path);
-
-               ret = iotcon_initialize(db_file_path);
+               ret = iotcon_initialize(db_file_path_server);
                RETVM_IF(ret != IOTCON_ERROR_NONE, NULL, "iotcon_initialize error %s", get_iotcon_error(ret));
 
                ret = iotcon_set_device_name("iotcon-test-basic-server");
@@ -269,11 +277,8 @@ iotcon_view *iotcon_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
                Evas_Object *control = add_control_layout(this, this->view->layout);
                elm_object_part_content_set(this->view->layout, "iotcon_btn", control);
 
-           snprintf(db_file_path, sizeof(db_file_path), "%s/%s",TBT_LOGGING_DIR,"iotcon-test-svr-db-client.dat");
-           DBG("db_file_path file set = %s", db_file_path);
-
                int ret;
-               ret = iotcon_initialize(db_file_path);
+               ret = iotcon_initialize(db_file_path_client);
                RETVM_IF(ret != IOTCON_ERROR_NONE, NULL, "iotcon_initialize error %s", get_iotcon_error(ret));
 
                ret = iotcon_query_create(&this->query);
@@ -286,8 +291,7 @@ iotcon_view *iotcon_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I
                RETVM_IF(ret != IOTCON_ERROR_NONE, NULL, "iotcon_find_resource error %s", get_iotcon_error(ret));
 
        }
-
-    return this;
+       return this;
 }