<privilege>http://tizen.org/privilege/mediastorage</privilege>
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>
<privilege>http://tizen.org/privilege/systemsettings</privilege>
+ <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
<privilege>http://tizen.org/privilege/externalstorage.appdata</privilege>
<privilege>http://tizen.org/privilege/externalstorage</privilege>
<privilege>http://tizen.org/privilege/notification</privilege>
FILE *fp = NULL;
int ret = 0;
- if (mp_file_exists(MP_SHORTCUT_INI_FILE_NAME_2)) {
- ret = rename(MP_SHORTCUT_INI_FILE_NAME_2, MP_SHORTCUT_INI_FILE_NAME_3);
+ char *path = app_get_data_path();
+ char shortcut_path_0[1024] = {0};
+ char shortcut_path_1[1024] = {0};
+ char shortcut_path_2[1024] = {0};
+ char shortcut_path_3[1024] = {0};
+ if (path == NULL) {
+ return;
+ }
+
+ snprintf(shortcut_path_0, 1024, "%s%s", path, MP_SHORTCUT_INI_FILE_NAME_0);
+ snprintf(shortcut_path_1, 1024, "%s%s", path, MP_SHORTCUT_INI_FILE_NAME_1);
+ snprintf(shortcut_path_2, 1024, "%s%s", path, MP_SHORTCUT_INI_FILE_NAME_2);
+ snprintf(shortcut_path_3, 1024, "%s%s", path, MP_SHORTCUT_INI_FILE_NAME_3);
+
+ free(path);
+ if (mp_file_exists(shortcut_path_2)) {
+ ret = rename(shortcut_path_2, shortcut_path_3);
if (ret != 0) {
ERROR_TRACE("Failed to rename file:error=%d", ret);
return;
}
}
- if (mp_file_exists(MP_SHORTCUT_INI_FILE_NAME_1)) {
- rename(MP_SHORTCUT_INI_FILE_NAME_1, MP_SHORTCUT_INI_FILE_NAME_2);
+ if (mp_file_exists(shortcut_path_1)) {
+ rename(shortcut_path_1, shortcut_path_2);
if (ret != 0) {
ERROR_TRACE("Failed to rename file:error=%d", ret);
return;
}
}
- if (mp_file_exists(MP_SHORTCUT_INI_FILE_NAME_0)) {
- rename(MP_SHORTCUT_INI_FILE_NAME_0, MP_SHORTCUT_INI_FILE_NAME_1);
+ if (mp_file_exists(shortcut_path_0)) {
+ rename(shortcut_path_0, shortcut_path_1);
if (ret != 0) {
ERROR_TRACE("Failed to rename file:error=%d", ret);
return;
}
}
- fp = fopen(MP_SHORTCUT_INI_FILE_NAME_0, "w"); /* make new file. */
+ fp = fopen(shortcut_path_0, "w"); /* make new file. */
if (fp == NULL) {
- SECURE_ERROR("Failed to open ini files. : %s", MP_SHORTCUT_INI_FILE_NAME_0);
+ SECURE_ERROR("Failed to open ini files. : %s", shortcut_path_0);
return;
}
#define DATA_DIR DATA_PREFIX"/data"
-#ifndef MP_INI_DIR
-#define MP_INI_DIR DATA_DIR
-#endif
-
#define PKGNAME_FOR_SHORTCUT PKG_NAME
#define EDJ_PATH EDJDIR
#ifndef MP_SOUND_PLAYER
#define MP_LSCR_CONTROL "lock_music_ctrl"
#else
-#define MP_LSCR_CONTROL "lock_sound_ctrl"
+#define MP_LSCR_CONTROL "lock_sound_ctrl"
#endif
-#define MP_SHORTCUT_INI_FILE_NAME_0 MP_INI_DIR"/shortcut_0.ini"
-#define MP_SHORTCUT_INI_FILE_NAME_1 MP_INI_DIR"/shortcut_1.ini"
-#define MP_SHORTCUT_INI_FILE_NAME_2 MP_INI_DIR"/shortcut_2.ini"
-#define MP_SHORTCUT_INI_FILE_NAME_3 MP_INI_DIR"/shortcut_3.ini"
+#define MP_SHORTCUT_INI_FILE_NAME_0 "shortcut_0.ini"
+#define MP_SHORTCUT_INI_FILE_NAME_1 "shortcut_1.ini"
+#define MP_SHORTCUT_INI_FILE_NAME_2 "shortcut_2.ini"
+#define MP_SHORTCUT_INI_FILE_NAME_3 "shortcut_3.ini"
#define SINGLE_BYTE_MAX 0x7F
bool exit_status;
bool disable_detail_view;
+ char *lockscreen_wallpaper;
+
#if 0
Ecore_X_Window xwin;
#else
#include "mp-player-view.h"
#include <device/display.h>
#include <device/callback.h>
+#include <system_settings.h>
#ifdef MP_FEATURE_LOCKSCREEN
int LOCKSCREEN_MINI_CONTROLLER_WIDTH;
#define LOCKSCREEN_MINI_CONTROLLER_HEIGHT (93)
+/*lockscreen wallpaper length*/
+#define WALLPAPER_LENGTH 1024
+
//#define LOCKSCREEN_MSG_DOMAIN_CONTROL_ACCESS (int)ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL
win = minicontrol_create_window("sound-minicontrol.LOCKSCREEN", MINICONTROL_TARGET_VIEWER_STOCK_LOCK_SCREEN, _lockscreen_cb);
#endif
-
if (!win) {
return;
}
ad->win_lockmini = win;
+ int ret = -1;
+ ad->lockscreen_wallpaper = (char *)malloc(WALLPAPER_LENGTH * sizeof(char));
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &ad->lockscreen_wallpaper);
+ if(ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ ERROR_TRACE("Failed to get locksreen wallpaper");
+ }
+ if(ad->lockscreen_wallpaper)
+ DEBUG_TRACE("lockscreen_wallpaper path is: %s", ad->lockscreen_wallpaper);
+ else
+ ERROR_TRACE("Could not fetch current wallpaper path");
+
/* load edje */
_mp_lockscreenmini_update_layout(ad, false);
DEBUG_TRACE("title set");
MP_CHECK(ad);
- Evas_Object *label = elm_object_part_content_get(ad->lockmini_layout, "elm.text");
+ Evas_Object *label = NULL;
+
+ label = elm_object_part_content_get(ad->lockmini_layout, "elm.text");
mp_track_info_t *current_item = ad->current_track_info;
MP_CHECK(current_item);
}
}
- /*edje_object_part_text_set(_EDJ(ad->lockmini_layout), "artist.text", markup_artist);*/
+ edje_object_part_text_set(_EDJ(ad->lockmini_layout), "artist.text", markup_artist);
if (!label) {
label = mp_widget_slide_title_create(ad->lockmini_layout, "slide_roll", title);
elm_object_part_content_set(ad->lockmini_layout, "elm.text", label);
mp_retm_if(ad == NULL, "appdata is NULL");
MP_CHECK(ad->win_lockmini);
MP_CHECK(!ad->is_lcd_off);
+ MP_CHECK(ad->current_track_info);
+
+ int ret = -1;
+
+ if (ad->current_track_info->thumbnail_path) {
+ DEBUG_TRACE("Thumbnail Location: %s", ad->current_track_info->thumbnail_path);
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, ad->current_track_info->thumbnail_path);
+ }
+ else
+ {
+ char wallpaper_path[1024] = {0};
+ snprintf(wallpaper_path, 1024, "%s/res/shared_images/default_albumart.png", SHAREDDIR);
+ DEBUG_TRACE("Setting Default Thumbnail :%s", wallpaper_path);
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, wallpaper_path);
+ }
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ ERROR_TRACE("Failed to set locksreen wallpaper");
+ }
mp_lockscreenmini_update_control(ad);
if (ad->player_state == PLAY_STATE_PLAYING) {
mp_ecore_timer_del(ad->lockmini_button_timer);
return 0;
-
}
int
mp_ecore_timer_del(ad->lockmini_button_timer);
ad->lockmini_visible = false;
+ int ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, ad->lockscreen_wallpaper);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ ERROR_TRACE("Failed to set original locksreen wallpaper");
+ }
char *path = app_get_data_path();
char lscr_state[1024] = {0};
snprintf(lscr_state, 1024, "%s%s", path, MP_LSCR_CONTROL);
}
if (!strcmp(key, "thumbnail")) {
if (value) {
- image_path = (char*)malloc((strlen(value) + 1) * sizeof(char));
+ image_path = (char *)malloc((strlen(value) + 1) * sizeof(char));
if (image_path != NULL) {
strncpy(image_path, value, strlen(value));