summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemun Lee <sm79.lee@samsung.com>2016-08-01 14:25:23 +0900
committerSemun Lee <sm79.lee@samsung.com>2016-08-28 17:47:12 -0700
commite3d960b5bcb23493b984408bca33ed9985eac245 (patch)
tree94f995ebabd5cfa03c9083072cc2f91b3c7a3174
parent5f63311b657e2ab5822f1f49533ba0f6e3997181 (diff)
downloadapplication-e3d960b5bcb23493b984408bca33ed9985eac245.tar.gz
application-e3d960b5bcb23493b984408bca33ed9985eac245.tar.bz2
application-e3d960b5bcb23493b984408bca33ed9985eac245.zip
Add new privilege for shared/data directory
Since 3.0, shared/data directory is supported only for the apps that declare the privilege that is introduced in 3.0. Change-Id: I9c0823f2fc65026fcc2218f9be9bdaf59221b8db Signed-off-by: Semun Lee <sm79.lee@samsung.com>
-rw-r--r--app_common/app_path.c2
-rw-r--r--include/app_common.h23
-rw-r--r--include/app_types.h1
3 files changed, 9 insertions, 17 deletions
diff --git a/app_common/app_path.c b/app_common/app_path.c
index 5282936..24ccde3 100644
--- a/app_common/app_path.c
+++ b/app_common/app_path.c
@@ -56,7 +56,7 @@ char *app_get_shared_data_path(void)
if (ret == AUL_R_OK && path)
set_last_result(APP_ERROR_NONE);
else if (ret == AUL_R_EREJECTED)
- set_last_result(APP_ERROR_NOT_SUPPORTED);
+ set_last_result(APP_ERROR_PERMISSION_DENIED);
else
set_last_result(APP_ERROR_OUT_OF_MEMORY);
diff --git a/include/app_common.h b/include/app_common.h
index 9485029..d8a355f 100644
--- a/include/app_common.h
+++ b/include/app_common.h
@@ -340,32 +340,25 @@ char *app_get_resource_path(void);
/**
- * @deprecated Deprecated since 3.0.
* @brief Gets the absolute path to the application's shared data directory which is used to share
* data with other applications.
* @details An application can read and write its own files in the application's shared data
* directory and others can only read the files.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appdir.shareddata
* @remarks The returned path should be released. @n
- * shared/data directory is not supported since Tizen 3.0.
- * You MUST NOT use this API when you develop new application.
- * Actually, we strongly recommend to stop using shared/data path for all your previous applications.
- * Files in shared/data directory can be read by all other applications.
- * You cannot control what applications can read the files in shared/data directory.
+ * Since Tizen 3.0, an application that want to use shared/data directory must declare http://tizen.org/privilege/appdir.shareddata privilege. If the application doesn't declare the privilege, the framework will not create shared/data directory for the application.
+ * Carefully consider the privacy implications when deciding whether to use the shared/data directory, since the application cannot control access to this directory by other applications.
* If you want to share files with other applications, consider passing path via @ref CAPI_APP_CONTROL_MODULE API.
* The @ref CAPI_APP_CONTROL_MODULE API supports giving permission to other applications by passing path via app_control. @n
- * shared/data directory is only available for applications with api-version lower than 3.0 from Tizen 3.0 platform.
- * The applications with api-version from 3.0 cannot access other applications' shared/data directory.
- * For example, a Tizen @if Mobile 2.4 @elseif WEARABLE 2.3.1 @endif application can access another Tizen @if Mobile 2.4 @elseif WEARABLE 2.3.1 @endif application's shared/data directory as it did in Tizen @if Mobile 2.4 @elseif WEARABLE 2.3.1 @endif platform.
- * However, a Tizen 3.0 application cannot access another application's shared/data directory even the another application is Tizen @if Mobile 2.4 @elseif WEARABLE 2.3.1 @endif application.
- * Note that Tizen 3.0 platform only supports shared/data directory among applications with api-version lower than 3.0 for minimum backward compatibility. @n
* The specific error code can be obtained using the get_last_result(). Error codes are described in Exception section.
*
* @return The absolute path to the application's shared data directory, @n
- * otherwise a null pointer if the memory is insufficient. It will return NULL for 3.0 application, and set to APP_ERROR_NOT_SUPPORTED.
- * @exception APP_ERROR_NONE Success
- * @exception APP_ERROR_OUT_OF_MEMORY Out of memory
- * @exception APP_ERROR_NOT_SUPPORTED Not supported
+ * Otherwise a null pointer if the memory is insufficient. Since Tizen 3.0, returns NULL and set #APP_ERROR_PERMISSION denied if the application does not declare the shareddata privilege.
+ * @exception #APP_ERROR_NONE Success
+ * @exception #APP_ERROR_OUT_OF_MEMORY Out of memory
+ * @exception #APP_ERROR_PERMISSION_DENIED Permission denied
*/
char *app_get_shared_data_path(void);
diff --git a/include/app_types.h b/include/app_types.h
index 391aa8a..d4797db 100644
--- a/include/app_types.h
+++ b/include/app_types.h
@@ -42,7 +42,6 @@ typedef enum {
APP_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
APP_ERROR_ALREADY_RUNNING = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Application is already running */
APP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied @if MOBILE (Since 2.3.1) @endif */
- APP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported (Since 3.0) */
} app_error_e;
/**