3 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #define APP_SETTING_LOCKTYPE "org.tizen.setting-locktype"
22 #define APP_SETTING_PASSWORD "org.tizen.setting-password"
24 static void update_next_button_status(appdata_s* ad)
26 dlog_print(DLOG_DEBUG, LOG_TAG, "update_next_button_status start");
27 if (ad->device_info.next_button == NULL) {
28 dlog_print(DLOG_ERROR, LOG_TAG, "[Encrypt Device] next button is null");
32 if (ad->view_type == ENCRYPT_DEVICE) {
33 if (ad->device_info.battery_status && ad->device_info.charger_status && ad->device_info.locktype_status) {
34 elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
36 elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
38 } else if (ad->view_type == DECRYPT_DEVICE) {
39 if (ad->device_info.battery_status && ad->device_info.charger_status) {
40 elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
42 elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
44 } else if (ad->view_type == ENCRYPT_SD_CARD) {
45 if (ad->device_info.sdcard_status) {
46 elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
48 elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
53 static void _next_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
55 dlog_print(DLOG_DEBUG, LOG_TAG, "_next_btn_clicked_cb start");
57 appdata_s* ad = (appdata_s*) data;
59 switch (ad->view_type) {
61 dpm_encryption_device_confirm_create_view(ad);
64 dpm_decryption_device_confirm_create_view(ad);
67 dpm_encryption_sd_card_confirm_create_view(ad);
70 dpm_decryption_sd_card_confirm_create_view(ad);
75 static void set_next_btn_layout(Evas_Object* layout, appdata_s* ad, const char* btn_text)
77 Evas_Object* btn_layout;
78 Evas_Object* next_btn;
80 btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "next_button_layout");
82 next_btn = dpm_encryption_create_button(btn_layout, btn_text, "bottom");
83 ad->device_info.next_button = next_btn;
84 elm_object_part_content_set(btn_layout, "next_button", next_btn);
86 update_next_button_status(ad);
87 evas_object_smart_callback_add(next_btn, "clicked", _next_btn_clicked_cb, ad);
89 elm_object_part_content_set(layout, "bottom_layout", btn_layout);
93 static void _launch_password_ug_cb(app_control_h ug, app_control_h reply, app_control_result_e result, void* data)
96 char* string_result = NULL;
98 app_control_get_extra_data(reply, "result", &string_result);
99 if (string_result == NULL)
103 if (strcmp(string_result, "Cancel") == 0)
105 else if (strcmp(string_result, "SETTING_PW_TYPE_ENTER_LOCK_TYPE") == 0 || strcmp(string_result, "SETTING_PW_TYPE_VERIFY_FP_ALT_PASSWORD") == 0)
111 app_control_h app_ctl;
112 if (app_control_create(&app_ctl)) {
113 dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create failed");
116 app_control_get_extra_data(reply, "current", ¤t);
118 app_control_add_extra_data(app_ctl, "current", current);
121 app_control_set_app_id(app_ctl, APP_SETTING_LOCKTYPE);
122 app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
123 app_control_send_launch_request(app_ctl, NULL, NULL);
124 app_control_destroy(app_ctl);
129 static void _locktype_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
131 /* launch lock type menu */
132 dlog_print(DLOG_DEBUG, LOG_TAG, "locktype button clicked");
133 appdata_s*ad = (appdata_s*) data;
135 app_control_h app_ctl = NULL;
139 ret = app_control_create(&app_ctl);
140 if (ret != APP_CONTROL_ERROR_NONE) {
141 dlog_print(DLOG_DEBUG, LOG_TAG, "app_control_create failed");
145 vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
147 if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD || lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
148 app_control_add_extra_data(app_ctl, "viewtype", "SETTING_PW_TYPE_ENTER_LOCK_TYPE");
149 app_control_set_app_id(app_ctl, APP_SETTING_PASSWORD);
150 app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
151 app_control_send_launch_request(app_ctl, _launch_password_ug_cb, NULL);
152 app_control_destroy(app_ctl);
155 app_control_set_app_id(app_ctl, APP_SETTING_LOCKTYPE);
156 app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
157 app_control_send_launch_request(app_ctl, NULL, NULL);
158 app_control_destroy(app_ctl);
161 update_next_button_status(ad);
164 static void _sdcardpw_create_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
166 dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw create btn cb start");
169 static void _sdcardpw_change_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
171 dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw change btn cb start");
174 static void _sdcardpw_delete_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
176 dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw delete btn cb start");
179 static void set_locktype_btn_layout(Evas_Object* layout, appdata_s* ad, const char* btn_text)
181 Evas_Object* btn_layout;
182 Evas_Object* locktype_btn;
184 btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "locktype_button_layout");
186 locktype_btn = dpm_encryption_create_button(btn_layout, btn_text, "default");
187 elm_object_part_content_set(btn_layout, "locktype_button", locktype_btn);
188 evas_object_smart_callback_add(locktype_btn, "clicked", _locktype_btn_clicked_cb, ad);
190 elm_object_part_content_set(layout, "locktype_button_content", btn_layout);
194 static void set_sdcard_pw_btn_layout(Evas_Object* layout, appdata_s* ad)
196 Evas_Object* btn_layout;
197 Evas_Object* createpw_btn, *changepw_btn, *deletepw_btn;
199 btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "sdcard_pw_button_layout");
201 createpw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_CREATE_PASSWORD, "default");
202 changepw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_CHANGE_PW_ABB, "default");
203 deletepw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_DELETE_PW_ABB, "default");
205 elm_object_part_content_set(btn_layout, "create_pw_button", btn_layout);
206 elm_object_part_content_set(btn_layout, "change_pw_button", btn_layout);
207 elm_object_part_content_set(btn_layout, "delete_pw_button", btn_layout);
209 evas_object_smart_callback_add(createpw_btn, "clicked", _sdcardpw_create_btn_clicked_cb, NULL);
210 evas_object_smart_callback_add(changepw_btn, "clicked", _sdcardpw_change_btn_clicked_cb, NULL);
211 evas_object_smart_callback_add(deletepw_btn, "clicked", _sdcardpw_delete_btn_clicked_cb, NULL);
213 elm_object_part_content_set(layout, "sd_card_btn", btn_layout);
217 static void set_icon(appdata_s* ad, int type, char* part)
219 Evas_Object* icon_check, *icon_bar = NULL;
221 if (ad->dpm_encryption_layout == NULL || ad->icon_check_path == NULL || ad->icon_bar_path == NULL) {
222 dlog_print(DLOG_ERROR, LOG_TAG, "invalid parameter");
225 if (type == ICON_CHECK) {
226 icon_check = elm_image_add(ad->dpm_encryption_layout);
227 if (icon_check == NULL) {
228 dlog_print(DLOG_ERROR, LOG_TAG, "elm_image_add failed");
231 elm_image_file_set(icon_check, ad->icon_check_path, NULL);
232 evas_object_color_set(icon_check, 153, 153, 153, 255);
233 evas_object_size_hint_align_set(icon_check, EVAS_HINT_FILL, EVAS_HINT_FILL);
234 evas_object_size_hint_weight_set(icon_check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
236 ret = elm_layout_content_set(ad->dpm_encryption_layout, part, icon_check);
238 dlog_print(DLOG_ERROR, LOG_TAG, "elm_layout_content_set failed");
241 evas_object_show(icon_check);
242 } else if (type == ICON_BAR) {
243 icon_bar = elm_image_add(ad->dpm_encryption_layout);
244 if (icon_bar == NULL) {
245 dlog_print(DLOG_ERROR, LOG_TAG, "elm_image_add failed");
248 elm_image_file_set(icon_bar, ad->icon_bar_path, NULL);
249 evas_object_color_set(icon_bar, 0, 0, 0, 255);
250 evas_object_size_hint_align_set(icon_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
251 evas_object_size_hint_weight_set(icon_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
253 ret = elm_layout_content_set(ad->dpm_encryption_layout, part, icon_bar);
255 dlog_print(DLOG_ERROR, LOG_TAG, "elm_layout_content_set failed");
258 evas_object_show(icon_bar);
262 static int battery_status_update(appdata_s* ad)
265 int battery_pct, ret;
266 dlog_print(DLOG_DEBUG, LOG_TAG, "battery_status_update start ");
268 if (ad->dpm_encryption_layout == NULL) {
269 dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
273 /* get battery percent info */
274 ret = device_battery_get_percent(&battery_pct);
275 if (ret != DEVICE_ERROR_NONE) {
276 dlog_print(DLOG_ERROR, LOG_TAG, "device_battery_get_percent failed %d", ret);
280 if (battery_pct > NEEDED_BATTERY_PERCENT) {
281 set_icon(ad, ICON_CHECK, "battery_icon");
282 ad->device_info.battery_status = 1;
284 set_icon(ad, ICON_BAR, "battery_icon");
285 ad->device_info.battery_status = 0;
288 /* get charger connected info */
289 ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_CHARGER_CONNECTED, &connected);
290 if (ret != RUNTIME_INFO_ERROR_NONE) {
291 dlog_print(DLOG_ERROR, LOG_TAG, "get runtime info fail");
295 set_icon(ad, ICON_CHECK, "charge_icon");
296 ad->device_info.charger_status = 1;
298 set_icon(ad, ICON_BAR, "charge_icon");
299 ad->device_info.charger_status = 0;
302 update_next_button_status(ad);
306 static int sdcard_status_update(appdata_s* ad)
310 if (ad->dpm_encryption_layout == NULL) {
311 dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
315 vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcard_status);
316 if (sdcard_status != VCONFKEY_SYSMAN_MMC_MOUNTED) {
317 set_icon(ad, ICON_BAR, "sd_card_icon");
318 ad->device_info.sdcard_status = 0;
321 set_icon(ad, ICON_CHECK, "sd_card_icon");
322 ad->device_info.sdcard_status = 1;
325 update_next_button_status(ad);
329 static int locktype_status_update(appdata_s* ad)
333 if (ad->dpm_encryption_layout == NULL) {
334 dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
338 vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
339 if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD || lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
341 set_icon(ad, ICON_CHECK, "locktype_icon");
342 ad->device_info.locktype_status = 1;
345 set_icon(ad, ICON_BAR, "locktype_icon");
346 ad->device_info.locktype_status = 0;
348 update_next_button_status(ad);
352 static void battery_charger_changed_cb(runtime_info_key_e key, void* data)
354 appdata_s* ad = (appdata_s*) data;
355 if (key == RUNTIME_INFO_KEY_CHARGER_CONNECTED)
356 battery_status_update(ad);
359 void battery_changed_cb(device_callback_e type, void* value, void* user_data)
361 appdata_s* ad = (appdata_s*) user_data;
362 if (type == DEVICE_CALLBACK_BATTERY_CAPACITY)
363 battery_status_update(ad);
366 void sdcard_status_changed_cb(keynode_t* node, void* data)
368 appdata_s* ad = (appdata_s*) data;
369 sdcard_status_update(ad);
372 void locktype_status_changed_cb(keynode_t* node, void* data)
374 appdata_s* ad = (appdata_s*) data;
375 locktype_status_update(ad);
378 static int battery_cb_register(appdata_s* ad)
382 /* register runtime callback : connected charger */
383 ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_CHARGER_CONNECTED, battery_charger_changed_cb, ad);
384 if (ret != RUNTIME_INFO_ERROR_NONE) {
385 dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
389 /* register runtime callback : battery percent */
390 ret = device_add_callback(DEVICE_CALLBACK_BATTERY_CAPACITY, battery_changed_cb, ad);
391 if (ret != DEVICE_ERROR_NONE) {
392 dlog_print(DLOG_ERROR, LOG_TAG, "device_add_callback failed: %d", ret);
399 static int locktype_cb_register(appdata_s* ad)
403 /* register vconf notify for locktype */
404 ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, locktype_status_changed_cb, ad);
406 dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
413 void _back_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
418 static Eina_Bool _pop_cb(void* data, Elm_Object_Item* it)
424 void sw_back_btn_set(Evas_Object* obj, const char* title_label, Evas_Object* content)
426 Evas_Object* back_btn = NULL;
428 back_btn = elm_button_add(obj);
429 elm_object_style_set(back_btn, "naviframe/back_btn/default");
430 evas_object_smart_callback_add(back_btn, "clicked", _back_btn_clicked_cb, obj);
432 Elm_Object_Item *nf_it = elm_naviframe_item_push(obj, title_label, back_btn, NULL, content, NULL);
433 elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, NULL);
436 void dpm_encryption_create_view(appdata_s* ad)
438 Evas_Object* navi_bar = ad->navi_bar;
439 Evas_Object* base_layout = NULL;
440 Evas_Object* encrypt_msg1, *encrypt_msg2, *encrypt_msg3 = NULL;
441 Evas_Object* battery_txt, *charge_txt, *locktype_txt = NULL;
442 Evas_Object* encryption_layout = NULL;
443 Evas_Textblock_Style* text_st;
447 dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_create_view");
449 if (navi_bar == NULL) {
450 dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
454 base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
455 encryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Encrypt_device_layout");
456 ad->dpm_encryption_layout = encryption_layout;
458 text_st = evas_textblock_style_new();
459 evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
461 encrypt_msg1 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_ENCRYPTING_MSG_1, text_st);
462 elm_object_part_content_set(encryption_layout, "msg_content_1", encrypt_msg1);
463 encrypt_msg2 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_ENCRYPTING_MSG_2, text_st);
464 elm_object_part_content_set(encryption_layout, "msg_content_2", encrypt_msg2);
465 encrypt_msg3 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_TO_ENCRYPTION_YOUR_DEVICE_C_ABB, text_st);
466 elm_object_part_content_set(encryption_layout, "msg_content_3", encrypt_msg3);
468 set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
470 /* get battery info */
471 ret = battery_status_update(ad);
473 dlog_print(DLOG_ERROR, LOG_TAG, "battery_status_update failed");
477 ret = battery_cb_register(ad);
479 dlog_print(DLOG_ERROR, LOG_TAG, "battery_cb_register failed");
484 ret = locktype_status_update(ad);
486 dlog_print(DLOG_ERROR, LOG_TAG, "locktype_status_update failed");
490 ret = locktype_cb_register(ad);
492 dlog_print(DLOG_ERROR, LOG_TAG, "locktype_cb_register failed");
496 /* set layout text */
497 battery_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP, text_st);
498 elm_object_part_content_set(encryption_layout, "battery_text", battery_txt);
499 charge_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER, text_st);
500 evas_object_size_hint_weight_set(charge_txt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
501 elm_object_part_content_set(encryption_layout, "charge_text", charge_txt);
502 locktype_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SET_THE_SCREEN_LOCK_TYPE_AS_PATTERN_PIN_OR_PASSWORD, text_st);
503 elm_object_part_content_set(encryption_layout, "locktype_text", locktype_txt);
505 evas_textblock_style_free(text_st);
507 set_locktype_btn_layout(encryption_layout, ad, IDS_ST_BUTTON_SCREEN_LOCK_TYPE_ABB);
509 elm_object_part_content_set(base_layout, "content_layout", encryption_layout);
511 sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_DEVICE, base_layout);
514 void dpm_decryption_create_view(appdata_s* ad)
516 Evas_Object* navi_bar = ad->navi_bar;
517 Evas_Object* base_layout = NULL;
518 Evas_Object* decrypt_msg1, *decrypt_msg2, *decrypt_msg3 = NULL;
519 Evas_Object* battery_txt, *charge_txt = NULL;
520 Evas_Object* decryption_layout = NULL;
521 Evas_Textblock_Style* text_st;
525 dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_decryption_create_view");
527 if (navi_bar == NULL) {
528 dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
532 base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
533 decryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Decrypt_device_layout");
534 ad->dpm_encryption_layout = decryption_layout;
536 text_st = evas_textblock_style_new();
537 evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
539 decrypt_msg1 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_DECRYPTING_MSG_1, text_st);
540 elm_object_part_content_set(decryption_layout, "msg_content_1", decrypt_msg1);
541 decrypt_msg2 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_DECRYPTING_MSG_2, text_st);
542 elm_object_part_content_set(decryption_layout, "msg_content_2", decrypt_msg2);
543 decrypt_msg3 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_HEADER_TO_DECRYPT_YOUR_DEVICE_C_ABB, text_st);
544 elm_object_part_content_set(decryption_layout, "msg_content_3", decrypt_msg3);
546 set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
548 /* get battery info */
549 ret = battery_status_update(ad);
551 dlog_print(DLOG_ERROR, LOG_TAG, "battery_status_update failed");
555 ret = battery_cb_register(ad);
557 dlog_print(DLOG_ERROR, LOG_TAG, "battery_cb_register failed");
561 /* set layout text */
562 battery_txt = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP, text_st);
563 elm_object_part_content_set(decryption_layout, "battery_text", battery_txt);
564 charge_txt = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER, text_st);
565 elm_object_part_content_set(decryption_layout, "charge_text", charge_txt);
567 evas_textblock_style_free(text_st);
569 elm_object_part_content_set(base_layout, "content_layout", decryption_layout);
571 sw_back_btn_set(navi_bar, IDS_ST_HEADER_DECRYPT_DEVICE, base_layout);
574 void dpm_encryption_sd_card_create_view(appdata_s* ad)
576 Evas_Object* navi_bar = ad->navi_bar;
577 Evas_Object* base_layout = NULL;
578 Evas_Object* encrypt_msg1, *encrypt_msg2, *encrypt_msg3, *encrypt_msg4 = NULL;
579 Evas_Object* sdcard_txt = NULL;
580 /* Evas_Object* password_txt = NULL; */
581 Evas_Object* encryption_layout = NULL;
582 Evas_Textblock_Style* text_st;
586 dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_create_view");
588 if (navi_bar == NULL) {
589 dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
593 base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
594 encryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Encrypt_sd_card_layout");
595 ad->dpm_encryption_layout = encryption_layout;
597 text_st = evas_textblock_style_new();
598 evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
600 encrypt_msg1 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_1, text_st);
601 elm_object_part_content_set(encryption_layout, "msg_content_1", encrypt_msg1);
602 encrypt_msg2 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_2, text_st);
603 elm_object_part_content_set(encryption_layout, "msg_content_2", encrypt_msg2);
604 encrypt_msg3 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_3, text_st);
605 elm_object_part_content_set(encryption_layout, "msg_content_3", encrypt_msg3);
606 encrypt_msg4 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_TO_ENCRYPT_YOUR_SD_CARD_C, text_st);
607 elm_object_part_content_set(encryption_layout, "msg_content_4", encrypt_msg4);
609 set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
611 /* get sdcard info */
612 ret = sdcard_status_update(ad);
614 dlog_print(DLOG_ERROR, LOG_TAG, "sdcard_status_update failed");
618 /* register vconf notify callback : sdcard status */
619 ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, sdcard_status_changed_cb, ad);
621 dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
625 /* set layout text */
626 sdcard_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_INSERT_THE_SD_CARD_ABB, text_st);
627 elm_object_part_content_set(encryption_layout, "sd_card_text", sdcard_txt);
628 /*password_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CREATE_AN_SD_CARD_PASSWORD, text_st);
629 elm_object_part_content_set(encryption_layout, "charge_text", password_txt); */
631 evas_textblock_style_free(text_st);
633 set_sdcard_pw_btn_layout(encryption_layout, ad);
635 /* to do : set password button */
637 elm_object_part_content_set(base_layout, "content_layout", encryption_layout);
639 sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_SD_CARD, base_layout);
642 void dpm_decryption_sd_card_create_view(appdata_s* ad)
644 Evas_Object* navi_bar = ad->navi_bar;
645 Evas_Object* base_layout = NULL;
646 Evas_Object* decrypt_msg = NULL;
647 Evas_Object* decryption_layout = NULL;
648 Evas_Textblock_Style* text_st;
650 dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_decryption_sd_card_create_view");
652 if (navi_bar == NULL) {
653 dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
657 base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
658 decryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Decrypt_sd_card_layout");
659 ad->dpm_encryption_layout = decryption_layout;
661 text_st = evas_textblock_style_new();
662 evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
664 decrypt_msg = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_SD_CARD_DECRYPTION_MSG, text_st);
665 elm_object_part_content_set(decryption_layout, "msg_content", decrypt_msg);
667 evas_textblock_style_free(text_st);
669 /* to do : set change password button */
671 elm_object_part_content_set(base_layout, "content_layout", decryption_layout);
673 set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
674 sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_SD_CARD, base_layout);