#include <Elementary.h>
-#define MOMENT_STATUS_UTIL_FLIGHT_MODE 5
-#define MOMENT_STATUS_UTIL_CALL_DISABLE (-2)
-#define MOMENT_STATUS_UTIL_NETWORK_DISABLE 0
-#define MOMENT_STATUS_UTIL_NETWORK_PS_DISABLE (-1)
+#define MOMENT_STATUS_FLIGHT_MODE 5
+#define MOMENT_STATUS_CALL_DISABLE (-2)
+#define MOMENT_STATUS_NETWORK_DISABLE 0
+#define MOMENT_STATUS_NETWORK_PS_DISABLE (-1)
#define MOMENT_STATUS_SIGNAL_WIFI_INDEX 10
bool moments_get_visible(void);
void moments_status_location_icon_show(void);
void moments_status_location_icon_hide(void);
+void moments_status_bluetooth_icon_show(void);
+void moments_status_bluetooth_icon_hide(void);
+
void moments_status_battery_update(int percent, int converted_percent, bool is_charging);
void moments_status_callsignal_update(int strength, bool is_roaming);
void moments_status_network_update(int network_type, int packet_type);
+void moments_status_bluetooth_update(int on_off, int connected);
void moments_status_update_view(void);
#endif
#define STATUS_NETWORK_LAYOUT "status_network_layout"
#define STATUS_SIMCARD_LAYOUT "status_simcard_layout"
#define STATUS_LOCATION_LAYOUT "status_location_layout"
+#define STATUS_BLUETOOTH_LAYOUT "status_bluetooth_layout"
#define SIZE_SETTER "size_setter"
#define MOMENTS_BG "moments_bg"
#define MOMENTS_CONTENT "moments_content"
--- /dev/null
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../../../inc/moments/moments_view_edje_conf.h"
+
+#define BLUETOOTH_DIR_PREFIX "Bluetooth"
+
+collections {
+ group { STATUS_BLUETOOTH_LAYOUT;
+ images {
+ image: BLUETOOTH_DIR_PREFIX"/bluetooth_on.png" COMP;
+ image: BLUETOOTH_DIR_PREFIX"/bluetooth_connected.png" COMP;
+ }
+ parts {
+ part {
+ name: "icon_image";
+ type: IMAGE;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ image.normal: BLUETOOTH_DIR_PREFIX"/bluetooth_on.png";
+ color: 250 250 250 255;
+ }
+ description {
+ state: "connected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: BLUETOOTH_DIR_PREFIX"/bluetooth_connected.png";
+ }
+ }
+ }
+ programs {
+ program {
+ name: "conneted";
+ signal: "bt_connected";
+ source: "bluetooth";
+ action: STATE_SET "connected" 0.0;
+ target: "icon_image";
+ }
+ program {
+ name: "dis_conneted";
+ signal: "bt_disconnected";
+ source: "bluetooth";
+ action: STATE_SET "default" 0.0;
+ target: "icon_image";
+ }
+ }
+ }
+}
+
+
Evas_Object *layout;
bool visible;
bool on_initialization;
+ int before_wifi_state;
} s_info = {
.win = NULL,
.bg_scroller = NULL,
.layout = NULL,
.visible = false,
.on_initialization = false,
+ .before_wifi_state = 0,
};
static telephony_handle_list_s handle_list;
static void __wifi_state_changed_cb(keynode_t *node, void *user_data);
static void __simcard_state_changed_cb(telephony_h handle, telephony_noti_e noti_id, void *data, void *user_data);
static void __location_service_state_changed_cb(runtime_info_key_e key, void *data);
+static void __bluetooth_state_changed_cb(keynode_t *node, void *user_data);
static void __get_callsignal_state(bool *is_roaming, int *strength);
static void __get_network_strength_and_packet_type(int *network_type, int *packet_type);
static void __get_wifi_strength_and_packet_type(int *strength, int *packet_type);
__call_network_service_state_changed_cb(NULL, 0, NULL, NULL);
__location_service_state_changed_cb(0, NULL);
}
+ __bluetooth_state_changed_cb(NULL, NULL);
s_info.on_initialization = false;
}
}
}
+ /* FLIGHTI MODE */
vconf_notify_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, __flight_mode_changed_cb, NULL);
+ /* WIFI */
vconf_notify_key_changed(VCONFKEY_WIFI_STATE, __wifi_state_changed_cb, NULL);
vconf_notify_key_changed(VCONFKEY_WIFI_TRANSFER_STATE, __wifi_state_changed_cb, NULL);
vconf_notify_key_changed(VCONFKEY_WIFI_STRENGTH, __wifi_state_changed_cb, NULL);
+ /* BLUETOOTH */
+ vconf_notify_key_changed(VCONFKEY_BT_STATUS, __bluetooth_state_changed_cb, NULL);
+ vconf_notify_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, __bluetooth_state_changed_cb, NULL);
}
static void __unregister_status_callback(void)
vconf_ignore_key_changed(VCONFKEY_DNET_STATE, __network_type_changed_cb);
}
vconf_ignore_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, __flight_mode_changed_cb);
+
vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, __wifi_state_changed_cb);
vconf_ignore_key_changed(VCONFKEY_WIFI_TRANSFER_STATE, __wifi_state_changed_cb);
vconf_ignore_key_changed(VCONFKEY_WIFI_STRENGTH, __wifi_state_changed_cb);
+
+ vconf_ignore_key_changed(VCONFKEY_BT_STATUS, __bluetooth_state_changed_cb);
+ vconf_ignore_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, __bluetooth_state_changed_cb);
}
static void __battery_state_changed_cb(device_callback_e type, void *value, void *user_data)
moments_status_battery_update(percent, converted_percent, is_charging);
}
-static void __moments_manager_update_status_view(int is_flight, int _service_state, int wifi_state)
+static void __update_status_view_by_call_network_changed(int is_flight, int _service_state, int wifi_state)
{
int callsignal_strength = 0;
int network_type = 0;
telephony_network_service_state_e service_state = (telephony_network_service_state_e)_service_state;
if (is_flight) {
- callsignal_strength = MOMENT_STATUS_UTIL_FLIGHT_MODE;
- network_type = MOMENT_STATUS_UTIL_NETWORK_DISABLE;
- packet_type = MOMENT_STATUS_UTIL_NETWORK_PS_DISABLE;
+ callsignal_strength = MOMENT_STATUS_FLIGHT_MODE;
+ network_type = MOMENT_STATUS_NETWORK_DISABLE;
+ packet_type = MOMENT_STATUS_NETWORK_PS_DISABLE;
moments_status_location_icon_hide();
} else {
if (service_state == TELEPHONY_NETWORK_SERVICE_STATE_IN_SERVICE) {
} else {
__get_network_strength_and_packet_type(&network_type, &packet_type);
}
- moments_status_location_icon_show();
+ __location_service_state_changed_cb(0, NULL);
} else {
if (wifi_state == VCONFKEY_WIFI_CONNECTED) {
__get_wifi_strength_and_packet_type(&network_type, &packet_type);
} else {
- callsignal_strength = MOMENT_STATUS_UTIL_CALL_DISABLE;
- network_type = MOMENT_STATUS_UTIL_NETWORK_DISABLE;
- packet_type = MOMENT_STATUS_UTIL_NETWORK_PS_DISABLE;
+ network_type = MOMENT_STATUS_NETWORK_DISABLE;
+ packet_type = MOMENT_STATUS_NETWORK_PS_DISABLE;
}
+ callsignal_strength = MOMENT_STATUS_CALL_DISABLE;
moments_status_location_icon_hide();
}
}
return;
}
- __moments_manager_update_status_view(is_flight, (int)service_state, wifi_state);
+ __update_status_view_by_call_network_changed(is_flight, (int)service_state, wifi_state);
}
static void __flight_mode_changed_cb(keynode_t *node, void *user_data)
_D("Wifi State is changed");
}
+static void __bluetooth_state_changed_cb(keynode_t *node, void *user_data)
+{
+ _D("Bluetooth State is changed");
+ int on_off = 0;
+ int connected = 0;
+
+ if (vconf_get_int(VCONFKEY_BT_STATUS, &on_off) < 0) {
+ _E("Failed to get vocnfkey for BLUETOOTH ON/OFF");
+ return;
+ }
+
+ if (on_off) {
+ if (vconf_get_int(VCONFKEY_WMS_WMANAGER_CONNECTED, &connected) < 0) {
+ _E("Failed to get vconkey for BLUETOOTH CONNECTED");
+ return;
+ }
+ }
+
+ moments_status_bluetooth_update(on_off, connected);
+ moments_status_update_view();
+}
+
static void __network_type_changed_cb(keynode_t *node, void *user_data)
{
__call_network_service_state_changed_cb(NULL, 0, NULL, NULL);
static void __location_service_state_changed_cb(runtime_info_key_e key, void *data)
{
_D("LOCATION SERVICE STATE CHANGED");
+ int is_flight = 0;
runtime_info_gps_status_e gps_status = 0;
if (runtime_info_get_value_int(RUNTIME_INFO_KEY_GPS_STATUS, (int *)&gps_status) < 0) {
return;
}
+ if (vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &is_flight) < 0) {
+ _E("Failed to get FLIGHT MODE VCONFKEY");
+ return;
+ }
+
if (gps_status == RUNTIME_INFO_GPS_STATUS_CONNECTED) {
_D("Location is available, Show LOCATION icon");
- moments_status_location_icon_show();
+ if (!is_flight) {
+ moments_status_location_icon_show();
+ }
} else {
_D("Location is unavailable, Hide LOCATION icon");
moments_status_location_icon_hide();
__call_network_service_state_changed_cb(NULL, 0, NULL, NULL);
}
+void __t__moments_restore_status_bluetooth_state(void)
+{
+ __bluetooth_state_changed_cb(NULL, NULL);
+}
+
void __t__moments_manager_update_status_view(int is_flight, int service_state, int wifi_state)
{
- __moments_manager_update_status_view(is_flight, service_state, wifi_state);
+ __update_status_view_by_call_network_changed(is_flight, service_state, wifi_state);
}
void __t__moments_get_callsignal_state(bool *is_roaming, int *strength)
#define STATUS_NETWORK_EDJE EDJE_DIR"/circle/moments_status_network.edj"
#define STATUS_SIMCARD_EDJE EDJE_DIR"/circle/moments_status_simcard.edj"
#define STATUS_LOCATION_EDJE EDJE_DIR"/circle/moments_status_location.edj"
+#define STATUS_BLUETOOTH_EDJE EDJE_DIR"/circle/moments_status_bluetooth.edj"
static struct __status_view_s {
Evas_Object *status_layout;
Evas_Object *status_network;
Evas_Object *status_simcard;
Evas_Object *status_location;
+ Evas_Object *status_bluetooth;
} s_info = {
.status_layout = NULL,
.status_grid = NULL,
.status_network = NULL,
.status_simcard = NULL,
.status_location = NULL,
+ .status_bluetooth = NULL,
};
static status_icon_type_e __status_icon_priority_bt[STATUS_ICON_MAX_COUNT_BT] = {
static Evas_Object *__create_network(Evas_Object *parent);
static Evas_Object *__create_simcard(Evas_Object *parent);
static Evas_Object *__create_location(Evas_Object *parent);
+static Evas_Object *__create_bluetooth(Evas_Object *parent);
Evas_Object *moments_status_view_create(Evas_Object *parent)
{
__status_icon_list[STATUS_ICON_LOCATION] = NULL;
}
+void moments_status_bluetooth_icon_show(void)
+{
+ if (s_info.status_bluetooth) moments_status_bluetooth_icon_hide();
+
+ s_info.status_bluetooth = __create_bluetooth(s_info.status_layout);
+
+ __status_icon_list[STATUS_ICON_BLUETOOTH] = s_info.status_bluetooth;
+ __status_icon_is_appended[STATUS_ICON_BLUETOOTH] = true;
+
+ __register_icon_type_to_list(STATUS_ICON_BLUETOOTH);
+}
+
+void moments_status_bluetooth_icon_hide(void)
+{
+ __unregister_icon_type_from_list(STATUS_ICON_BLUETOOTH);
+ __status_icon_is_appended[STATUS_ICON_BLUETOOTH] = false;
+
+ if (s_info.status_bluetooth) evas_object_del(s_info.status_bluetooth);
+ s_info.status_bluetooth = NULL;
+ __status_icon_list[STATUS_ICON_BLUETOOTH] = NULL;
+}
+
+void moments_status_bluetooth_update(int on_off, int connected)
+{
+ _D("Update bluetooth state, on_off[%d], connected[%d]", on_off, connected);
+
+ if (!on_off) {
+ moments_status_bluetooth_icon_hide();
+ } else {
+ if (!s_info.status_bluetooth) {
+ moments_status_bluetooth_icon_show();
+ }
+
+ if (!connected) {
+ elm_object_signal_emit(s_info.status_bluetooth, "bt_disconnected", "bluetooth");
+ } else {
+ elm_object_signal_emit(s_info.status_bluetooth, "bt_connected", "bluetooth");
+ }
+ }
+}
+
void moments_status_update_view(void)
{
_D("Update status icon list");
return location;
}
+static Evas_Object *__create_bluetooth(Evas_Object *parent)
+{
+ Evas_Object *bluetooth = elm_layout_add(parent);
+ if (!bluetooth || !elm_layout_file_set(bluetooth, util_get_res_file_path(STATUS_BLUETOOTH_EDJE), STATUS_BLUETOOTH_LAYOUT)) {
+ _E("Failed to create location layout");
+ return NULL;
+ }
+ evas_object_size_hint_min_set(bluetooth, MOMENTS_STATUS_ICON_W, MOMENTS_STATUS_ICON_H);
+ evas_object_size_hint_align_set(bluetooth, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(bluetooth, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_move(bluetooth, OUTSIDE_X, OUTSIDE_Y);
+ evas_object_show(bluetooth);
+
+ return bluetooth;
+}
+
static int __get_icon_position_index(status_icon_type_e type)
{
Eina_List *list = NULL;
return s_info.status_location;
}
+Evas_Object *__t__get_moments_status_bluetooth(void)
+{
+ return s_info.status_bluetooth;
+}
+
int __t__get_moments_status_icon_index(int type)
{
return __get_icon_position_index(type);
#define STATUS_CONTENT "status_content"
#define STATUS_LAYOUT_EDJE "/usr/apps/org.tizen.w-home/res/edje/circle/moments_status_layout.edj"
-static unit_case_func_t __case_check_status_flight_on(void *data);
-static unit_case_func_t __case_check_status_flightoff_serviceoff_wifioff(void *data);
-static unit_case_func_t __case_check_status_flightoff_serviceon_wifioff(void *data);
-
static void __status_restore_icons(void);
static struct {
static bool call_is_for_test = false;
static bool network_is_for_test = false;
-static bool location_is_for_test = false;
-static unit_case_func_t __continue_check_status_flight_on(void *data);
-static unit_case_func_t __case_check_status_flight_on(void *data)
+static unit_case_func_t __continue_check_status_flighton_serviceoff_wifioff(void *data);
+static unit_case_func_t __case_check_status_flighton_serviceoff_wifioff(void *data)
{
main_s *info = main_get_info();
TEST_ASSERT_TRUE_UPGRADE(info != NULL);
if (!location) {
moments_status_location_icon_show();
moments_status_update_view();
- location_is_for_test = true;
- TEST_CASE_CONTINUE(0.1, __case_check_status_flight_on, NULL);
+ TEST_CASE_CONTINUE(0.1, __case_check_status_flighton_serviceoff_wifioff, NULL);
}
__t__layout_mouse_down(info->layout, 180, 50);
TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(network));
TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(location));
- TEST_CASE_CONTINUE(0.6, __continue_check_status_flight_on, NULL);
+ TEST_CASE_CONTINUE(0.6, __continue_check_status_flighton_serviceoff_wifioff, NULL);
}
-static unit_case_func_t __continue_check_status_flight_on(void *data)
+static unit_case_func_t __continue_check_status_flighton_serviceoff_wifioff(void *data)
{
double val = 0.0;
Evas_Object *callsignal = __t__get_moments_status_callsignal();
if (s_info.current_step == 0) {
__t__moments_manager_update_status_view(1, 0, 0);
s_info.current_step += 1;
- TEST_CASE_CONTINUE(0.6, __continue_check_status_flight_on, NULL);
+ TEST_CASE_CONTINUE(0.6, __continue_check_status_flighton_serviceoff_wifioff, NULL);
}
TEST_ASSERT_EQUAL_STRING_UPGRADE("flight_mode", edje_object_part_state_get(elm_layout_edje_get(callsignal), "icon_image", &val));
static unit_case_func_t __continue_check_status_flightoff_serviceoff_wifioff(void *data);
static unit_case_func_t __case_check_status_flightoff_serviceoff_wifioff(void *data)
{
+ Evas_Object *location = __t__get_moments_status_location();
+ /* Create Location for service off scenario */
+ if (!location) {
+ moments_status_location_icon_show();
+ moments_status_update_view();
+ TEST_CASE_CONTINUE(0.2, __case_check_status_flightoff_serviceoff_wifioff, NULL);
+ }
+
+ TEST_ASSERT_TRUE_UPGRADE(location != NULL);
+
__t__moments_manager_update_status_view(0, 1, 0);
TEST_CASE_CONTINUE(0.6, __continue_check_status_flightoff_serviceoff_wifioff, NULL);
}
TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[network_type], edje_object_part_state_get(elm_layout_edje_get(network), "type_icon_image", &val));
TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[network_type == 0 ? network_type : packet_type+15], edje_object_part_state_get(elm_layout_edje_get(network), "inout_icon_image", &val));
- Evas_Object *location = __t__get_moments_status_location();
- TEST_ASSERT_TRUE_UPGRADE(location);
-
TEST_CASE_DONE(s_info.group);
}
TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[network_type+10], edje_object_part_state_get(elm_layout_edje_get(network), "type_icon_image", &val));
TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[packet_type+15], edje_object_part_state_get(elm_layout_edje_get(network), "inout_icon_image", &val));
+ TEST_CASE_DONE(s_info.group);
+}
+
+static unit_case_func_t __continue_check_status_flightoff_serviceoff_wifion(void *data);
+static unit_case_func_t __case_check_status_flightoff_serviceoff_wifion(void *data)
+{
Evas_Object *location = __t__get_moments_status_location();
- TEST_ASSERT_TRUE_UPGRADE(location);
+ if (!location) {
+ moments_status_location_icon_show();
+ moments_status_update_view();
+ TEST_CASE_CONTINUE(0.1, __case_check_status_flightoff_serviceoff_wifion, NULL);
+ }
+ __t__moments_manager_update_status_view(0, 1, 2);
+ TEST_CASE_CONTINUE(0.6, __continue_check_status_flightoff_serviceoff_wifion, NULL);
+}
+
+static unit_case_func_t __continue_check_status_flightoff_serviceoff_wifion(void *data)
+{
+ double val = 0.0;
+ int strength = 0;
+ int network_type = 0;
+ int packet_type = 0;
+ bool roaming = false;
+ Evas_Object *callsignal = __t__get_moments_status_callsignal();
+ Evas_Object *network = __t__get_moments_status_network();
+ Evas_Object *location = __t__get_moments_status_location();
+
+ __t__moments_get_callsignal_state(&roaming, &strength);
+ __t__moments_get_wifi_strength_and_packet_type(&network_type, &packet_type);
+
+ TEST_ASSERT_EQUAL_STRING_UPGRADE("default", edje_object_part_state_get(elm_layout_edje_get(callsignal), "icon_image", &val));
+ TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[network_type+10], edje_object_part_state_get(elm_layout_edje_get(network), "type_icon_image", &val));
+ TEST_ASSERT_EQUAL_STRING_UPGRADE(__t__network_type[packet_type+15], edje_object_part_state_get(elm_layout_edje_get(network), "inout_icon_image", &val));
+
+ TEST_ASSERT_TRUE_UPGRADE(!evas_object_visible_get(location));
TEST_CASE_DONE(s_info.group);
}
s_info.group->set_up = __set_up;
s_info.group->tear_down = __tear_down;
- TEST_CASE_ADD(s_info.group, __case_check_status_flight_on, NULL);
- TEST_CASE_ADD(s_info.group, __case_check_status_flightoff_serviceoff_wifioff, NULL);
+ TEST_CASE_ADD(s_info.group, __case_check_status_flighton_serviceoff_wifioff, NULL);
if (moments_check_is_3g_device()) {
+ TEST_CASE_ADD(s_info.group, __case_check_status_flightoff_serviceoff_wifioff, NULL);
TEST_CASE_ADD(s_info.group, __case_check_status_flightoff_serviceon_wifioff, NULL);
TEST_CASE_ADD(s_info.group, __case_check_status_flightoff_serviceon_wifion, NULL);
+ TEST_CASE_ADD(s_info.group, __case_check_status_flightoff_serviceoff_wifion, NULL);
}
+
TEST_GROUP_TEAR_DOWN(s_info.group, __group_tear_down);
TEST_GROUP_RUN(s_info.group);
if (network_is_for_test) {
moments_status_network_icon_hide();
}
- if (location_is_for_test) {
- moments_status_location_icon_hide();
- }
if (!call_is_for_test && !network_is_for_test) {
__t__moments_restore_status_call_network_service_state();
}
+ __t__moments_restore_status_bluetooth_state();
}
#endif
static unit_case_func_t __case_check_status_view_network(void *data);
static unit_case_func_t __case_check_status_view_simcard(void *data);
static unit_case_func_t __case_check_status_view_location(void *data);
+static unit_case_func_t __case_check_status_view_bluetooth(void *data);
static void __status_restore_icons(void);
"state_inout_connected"
};
+static char *__bluetooth_state[3] = { "default", "connected", "" };
+
static void __group_set_up(void)
{
if (moments_get_visible() == false) {
moments_status_update_view();
TEST_CASE_CONTINUE(0.6, __continue_check_status_location_icon_change, location);
+ TEST_CASE_DONE(s_info.group);
}
static unit_case_func_t __continue_check_status_location_icon_change(void *data)
TEST_CASE_DONE(s_info.group);
}
+static int bt_on_off = 1;
+static int bt_connected = 0;
+static unit_case_func_t __continue_check_status_bluetooth_icon_change(void *data);
+static unit_case_func_t __case_check_status_view_bluetooth(void *data)
+{
+ Evas_Object *bluetooth = __t__get_moments_status_bluetooth();
+ if (!bluetooth) {
+ moments_status_bluetooth_icon_show();
+ moments_status_update_view();
+ TEST_CASE_CONTINUE(0.3, __case_check_status_view_bluetooth, NULL);
+ }
+
+ TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(bluetooth));
+
+ int index = __t__get_moments_status_icon_index(STATUS_ICON_BLUETOOTH);
+ TEST_ASSERT_TRUE_UPGRADE(index >= 0);
+
+ int x, y, w, h;
+ evas_object_geometry_get(bluetooth, &x, &y, &w, &h);
+ TEST_ASSERT_EQUAL_INT_UPGRADE(__t_status_icon_position[index][0], x);
+ TEST_ASSERT_EQUAL_INT_UPGRADE(__t_status_icon_position[index][1], y);
+ TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_ICON_W, w);
+ TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_ICON_H, h);
+
+ moments_status_update_view();
+ moments_status_bluetooth_update(bt_on_off, bt_connected);
+
+ TEST_CASE_CONTINUE(0.3, __continue_check_status_bluetooth_icon_change, bluetooth);
+}
+
+static unit_case_func_t __continue_check_status_bluetooth_icon_change(void *data)
+{
+ double val = 0.0;
+ Evas_Object *bluetooth = (Evas_Object *)data;
+
+ if (bt_connected < 2) {
+ TEST_ASSERT_EQUAL_STRING_UPGRADE(__bluetooth_state[bt_connected], edje_object_part_state_get(elm_layout_edje_get(bluetooth), "icon_image", &val));
+
+ if (bt_connected == 1) { // This time we should show off state
+ bt_on_off = 0;
+ }
+ bt_connected++;
+
+ moments_status_bluetooth_update(bt_on_off, bt_connected);
+
+ TEST_CASE_CONTINUE(0.3, __continue_check_status_bluetooth_icon_change, bluetooth);
+ }
+
+ TEST_ASSERT_TRUE_UPGRADE(!evas_object_visible_get(bluetooth));
+
+ TEST_CASE_DONE(s_info.group);
+}
+
void group_feature_moments_status_view_ui(unit_group_t * group)
{
s_info.group = group;
TEST_CASE_ADD(s_info.group, __case_check_status_view_network, NULL);
TEST_CASE_ADD(s_info.group, __case_check_status_view_simcard, NULL);
TEST_CASE_ADD(s_info.group, __case_check_status_view_location, NULL);
+ TEST_CASE_ADD(s_info.group, __case_check_status_view_bluetooth, NULL);
TEST_GROUP_TEAR_DOWN(s_info.group, __group_tear_down);
TEST_GROUP_RUN(s_info.group);
if (!call_is_for_test && !network_is_for_test) {
__t__moments_restore_status_call_network_service_state();
}
+ __t__moments_restore_status_bluetooth_state();
}
#endif
extern Evas_Object *__t__get_moments_status_network(void);
extern Evas_Object *__t__get_moments_status_simcard(void);
extern Evas_Object *__t__get_moments_status_location(void);
+extern Evas_Object *__t__get_moments_status_location(void);
+extern Evas_Object *__t__get_moments_status_bluetooth(void);
extern void __t__moments_restore_status_battery(void);
extern void __t__moments_restore_status_call_network_service_state(void);
+extern void __t__moments_restore_status_bluetooth_state(void);
+extern void __t__moments_flight_mode_just_turned_on_off(int turn_on);
extern void __t__moments_manager_update_status_view(int is_flight, int service_state, int wifi_state);
extern int __t__get_moments_status_icon_index(int type);