2 * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "main_view.h"
21 static Ecore_Event_Handler *handler;
22 static Evas_Object *main_view;
24 static void _sim_state_view_update()
26 const char *sim1, *sim2;
29 sim1 = lockscreen_sim_get_plmn(LOCKSCREEN_PRIMARY_SIM);
30 sim2 = lockscreen_sim_get_plmn(LOCKSCREEN_SECONDARY_SIM);
33 snprintf(buf, sizeof(buf), "%s / %s", sim1, sim2);
35 snprintf(buf, sizeof(buf), "%s", sim1);
37 snprintf(buf, sizeof(buf), "%s", sim2);
40 lockscreen_main_view_sim_status_text_set(main_view, buf);
43 static Eina_Bool _sim_status_changed(void *data, int type, void *event_info)
45 _sim_state_view_update();
49 int lockscreen_sim_ctrl_init(Evas_Object *view)
51 if (lockscreen_sim_init()) {
52 ERR("lockscreen_sim_init failed");
56 handler = ecore_event_handler_add(LOCKSCREEN_EVENT_SIM_STATUS_CHANGED, _sim_status_changed, NULL);
58 _sim_state_view_update();
62 void lockscreen_sim_ctrl_shutdown()
64 ecore_event_handler_del(handler);
65 lockscreen_sim_shutdown();