int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version);
/**
+ * @fn int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode)
+ * @brief This API gets the light_user_switch_mode of package
+ *
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package info handle
+ * @param[out] mode pointer to hold resource version of package
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @code
+static int get_light_user_switch_mode(const char *pkgid)
+{
+ int ret = 0;
+ char *mode = 0;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+
+ ret = pkgmgrinfo_pkginfo_get_light_user_switch_mode(handle, &mode);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("light_user_switch_mode : %s\n", mode);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode);
+
+/**
* @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
* @brief This API gets the support_mode of package
*
int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
/**
+ * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
+ * @brief This API gets the application 'light_user_switch_mode' value from the app ID
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to application info handle
+ * @param[out] mode pointer to hold package light_user_switch_mode value
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ */
+int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
+
+/**
* @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
* @brief This API destroys the application information handle freeing up all the resources
*
char *package_installed_time; /*installed time after finishing of installation*/
char *support_mode; /*attr*/
char *locale; /*no xml part*/
+ char *light_user_switch_mode; /**< light_user_switch_mode flag, attr, default: "dafault"*/
GList *label; /*element*/
GList *icon; /*element*/
GList *image; /*element*/
char *res_type; /**< res type, attr*/
char *res_version; /**< res version, attr*/
char *is_disabled; /**< Flag that indicates if the package is disabled or not, no xml part*/
+ char *light_user_switch_mode; /**< light_user_switch_mode flag, attr, default: "dafault"*/
GList *icon; /**< package icon, element*/
GList *label; /**< package label, element*/
GList *author; /**< package author, element*/
" csc_path TEXT,\n" \
" package_support_mode TEXT,\n" \
" package_support_disable TEXT NOT NULL DEFAULT 'false',\n" \
- " package_disable TEXT NOT NULL DEFAULT 'false')"
+ " package_disable TEXT NOT NULL DEFAULT 'false',\n" \
+ " light_user_switch_mode TEXT NOT NULL DEFAULT 'default')"
#define QUERY_CREATE_TABLE_PACKAGE_LOCALIZED_INFO \
"CREATE TABLE IF NOT EXISTS package_localized_info (\n" \
" app_splash_screen_display TEXT NOT NULL DEFAULT 'true',\n" \
" app_external_path TEXT,\n" \
" app_setup_appid TEXT,\n" \
+ " light_user_switch_mode TEXT NOT NULL DEFAULT 'default',\n" \
" FOREIGN KEY(package)\n" \
" REFERENCES package_info(package) ON DELETE CASCADE)"
<xs:element ref="packages:trust-anchor"/>
<xs:element ref="packages:component-based-application"/>
<xs:element ref="packages:dependencies"/>
+ <xs:element ref="packages:light-user"/>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>
</xs:choice>
<xs:attribute name="storeclient-id" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
+ <xs:element name="light-user">
+ <xs:complexType>
+ <xs:attribute name="switch-mode" use="required" type="xs:string"/>
+ <xs:anyAttribute namespace="##any" processContents="lax"/>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
<xs:element ref="packages:trust-anchor"/>
<xs:element ref="packages:component-based-application"/>
<xs:element ref="packages:dependencies"/>
+ <xs:element ref="packages:light-user"/>
</xs:choice>
<xs:attribute name="storeclient-id" type="xs:string"/>
<xs:attribute name="install-location" type="packages:InstallLocationType"/>
</xs:choice>
</xs:complexType>
</xs:element>
+ <xs:element name="light-user">
+ <xs:complexType>
+ <xs:attribute name="switch-mode" use="required" type="xs:string"/>
+ <xs:anyAttribute namespace="##any" processContents="lax"/>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
ReadString(parcel, &application->package_installed_time);
ReadString(parcel, &application->support_mode);
ReadString(parcel, &application->locale);
+ ReadString(parcel, &application->light_user_switch_mode);
ReadLabel(parcel, &application->label);
ReadIcon(parcel, &application->icon);
ReadImage(parcel, &application->image);
WriteString(parcel, application->package_installed_time);
WriteString(parcel, application->support_mode);
WriteString(parcel, application->locale);
+ WriteString(parcel, application->light_user_switch_mode);
WriteLabel(parcel, application->label);
WriteIcon(parcel, application->icon);
WriteString(parcel, package->res_type);
WriteString(parcel, package->res_version);
WriteString(parcel, package->is_disabled);
+ WriteString(parcel, package->light_user_switch_mode);
WriteIcon(parcel, package->icon);
WriteLabel(parcel, package->label);
WriteAuthor(parcel, package->author);
ReadString(parcel, &package->res_type);
ReadString(parcel, &package->res_version);
ReadString(parcel, &package->is_disabled);
+ ReadString(parcel, &package->light_user_switch_mode);
ReadIcon(parcel, &package->icon);
ReadLabel(parcel, &package->label);
ReadAuthor(parcel, &package->author);
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_get_light_user_switch_mode(
+ pkgmgrinfo_appinfo_h handle, char **mode)
+{
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+ if (info == NULL || mode == NULL) {
+ _LOGE("Invalid parameter");
+ return PMINFO_R_EINVAL;
+ }
+
+ if (info->app_info == NULL || info->app_info->light_user_switch_mode == NULL)
+ return PMINFO_R_ERROR;
+
+ *mode = info->app_info->light_user_switch_mode;
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
{
retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
free((void *)application->setup_appid);
if (application->locale)
free((void *)application->locale);
+ if (application->light_user_switch_mode)
+ free((void *)application->light_user_switch_mode);
/*Free Label*/
g_list_free_full(application->label, __ps_free_label);
free((void *)package->res_version);
if (package->is_disabled)
free((void *)package->is_disabled);
+ if (package->light_user_switch_mode)
+ free((void *)package->light_user_switch_mode);
/*Free Icon*/
g_list_free_full(package->icon, __ps_free_icon);
return PMINFO_R_OK;
}
+API int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode)
+{
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(mode == NULL, PMINFO_R_EINVAL,
+ "Argument supplied to hold return value is NULL\n");
+
+ if (info->pkg_info == NULL)
+ return PMINFO_R_ERROR;
+
+ if (info->pkg_info->light_user_switch_mode == NULL)
+ return PMINFO_R_ERROR;
+
+ *mode = (char *)info->pkg_info->light_user_switch_mode;
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
{
retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
"ai.app_zip_mount_file, ai.component_type, ai.package, "
"ai.app_package_system, ai.app_removable, "
"ai.app_package_installed_time, ai.app_support_mode, "
- "ai.app_support_ambient, ai.app_setup_appid";
+ "ai.app_support_ambient, ai.app_setup_appid, ai.light_user_switch_mode";
static const char query_uid_info[] =
", ui.is_disabled, ui.is_splash_screen_enabled";
static const char query_label[] =
_save_column_str(stmt, idx++, &info->support_mode);
_save_column_str(stmt, idx++, &info->support_ambient);
_save_column_str(stmt, idx++, &info->setup_appid);
+ _save_column_str(stmt, idx++, &info->light_user_switch_mode);
info->background_category = __get_background_category(
bg_category_str);
free(bg_category_str);
"pi.storeclient_id, pi.mainapp_id, pi.package_url, pi.root_path, "
"pi.csc_path, pi.package_nodisplay, pi.package_api_version, "
"pi.package_support_disable, pi.package_tep_name, "
- "pi.package_zip_mount_file, pi.package_support_mode, pi.package_disable";
+ "pi.package_zip_mount_file, pi.package_support_mode, pi.package_disable, "
+ "pi.light_user_switch_mode";
static const char query_author[] =
", pi.author_name, pi.author_email, pi.author_href";
static const char query_label[] =
_save_column_str(stmt, idx++, &info->zip_mount_file);
_save_column_str(stmt, idx++, &info->support_mode);
_save_column_str(stmt, idx++, &info->is_disabled);
+ _save_column_str(stmt, idx++, &info->light_user_switch_mode);
}
info->for_all_users =
" app_effective_appid, app_splash_screen_display,"
" app_package_system, app_removable,"
" app_package_installed_time, app_support_ambient,"
- " app_external_path, app_setup_appid) "
+ " app_external_path, app_setup_appid, light_user_switch_mode) "
"VALUES (?, ?, "
" ?, LOWER(?), ?, LOWER(?), LOWER(?),"
" LOWER(?), LOWER(?), ?,"
" ?, LOWER(?),"
" LOWER(?), LOWER(?),"
" ?, LOWER(?),"
- " ?, ?)";
+ " ?, ?, ?)";
int ret;
sqlite3_stmt *stmt;
int idx;
__get_bool(app->support_ambient, false));
__BIND_TEXT(db, stmt, idx++, mfx->external_path);
__BIND_TEXT(db, stmt, idx++, app->setup_appid);
+ __BIND_TEXT(db, stmt, idx++, mfx->light_user_switch_mode);
ret = sqlite3_step(stmt);
if (ret != SQLITE_DONE) {
" package_system, author_name, author_email, author_href,"
" installed_time, installed_storage, storeclient_id,"
" mainapp_id, package_url, root_path, external_path,"
- " csc_path, package_support_mode, package_support_disable) "
+ " csc_path, package_support_mode, package_support_disable,"
+ " light_user_switch_mode)"
"VALUES (?, ?,"
" ?, ?, ?,"
" ?, ?, ?,"
" LOWER(?), ?, ?, ?,"
" ?, ?, ?,"
" ?, ?, ?, ?,"
- " ?, ?, LOWER(?))";
+ " ?, ?, LOWER(?), ?)";
int ret;
sqlite3_stmt *stmt;
int idx = 1;
__BIND_TEXT(db, stmt, idx++,
mfx->support_mode ? mfx->support_mode : "0");
__BIND_TEXT(db, stmt, idx++, __get_bool(mfx->support_disable, false));
+ __BIND_TEXT(db, stmt, idx++, mfx->light_user_switch_mode);
ret = sqlite3_step(stmt);
if (ret != SQLITE_DONE) {
package->use_system_certs = strdup("test_use_system_certs");
package->res_type = strdup("test_res_type");
package->res_version = strdup("test_res_version");
+ package->light_user_switch_mode = strdup("default");
icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
icon->text = strdup("test_text");
STR_EQ(packageA->tep_name, packageB->tep_name);
STR_EQ(packageA->zip_mount_file, packageB->zip_mount_file);
STR_EQ(packageA->external_path, packageB->external_path);
+ STR_EQ(packageA->light_user_switch_mode, packageB->light_user_switch_mode);
INT_EQ(g_list_length(packageA->icon), g_list_length(packageB->icon));
for (GList* a = packageA->icon, *b = packageB->icon;