3 * Copyright (c) 2017 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.
20 #include <ode/external-encryption.h>
21 #include "ode-password.h"
23 static void key_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
25 Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
27 if (!strcmp(ev->keyname, "XF86Back")) {
34 static void popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
36 Evas_Object *popup = (Evas_Object *)data;
37 evas_object_del(popup);
42 static void popup_confirm_cb(void *data, Evas_Object *obj, void *event_info)
44 popup_data_s *popup_data = (popup_data_s *)data;
46 evas_object_del(popup_data->popup);
47 popup_data->popup = NULL;
49 ode_external_encryption_recovery();
54 void create_reset_sdcard_popup(popup_data_s *data)
56 Evas_Object *cancel_button = NULL, *next_button = NULL;
57 int sdcard_status = 0;
59 vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcard_status);
60 if (sdcard_status != VCONFKEY_SYSMAN_MMC_MOUNTED) {
61 data->popup = ode_create_popup(data->parent, __("IDS_ST_HEADER_COULDNT_USE_SD_CARD"), __("IDS_ST_POP_TAP_RESET_TO_DELETE_THE_PASSWORD_YOU_CAN_USE_SD_CARDS_THAT_WERE_ENCRYPTED_BY_THIS_PHONE_MSG"));
63 data->popup = ode_create_popup(data->parent, __("IDS_ST_HEADER_COULDNT_USE_SD_CARD"), __("IDS_ST_POP_AN_INCORRECT_PASSWORD_HAS_BEEN_ENTERED_15_TIMES_YOU_CAN_NO_LONGER_ACCESS_DATA_ON_ANY_MSG"));
66 cancel_button = ode_create_popup_button(data->popup, __("IDS_ST_BUTTON_CANCEL"), popup_cancel_cb, data->popup);
67 next_button = ode_create_popup_button(data->popup, __("IDS_ST_BUTTON_OK"), popup_confirm_cb, data);
69 elm_object_part_content_set(data->popup, "button1", cancel_button);
70 elm_object_part_content_set(data->popup, "button2", next_button);
71 evas_object_event_callback_add(data->popup, EVAS_CALLBACK_KEY_DOWN, key_event_cb, NULL);
72 evas_object_show(data->popup);