From: Shashank Shekhar Shukla Date: Mon, 13 Jun 2016 08:40:47 +0000 (+0900) Subject: [TBT][All][DPTTIZEN-1952][Scenario for bluetooth - create bond, bluetooth - destroy... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6771e9a1b7e2f6b016ffd5040d9b1ea18a5ca351;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][All][DPTTIZEN-1952][Scenario for bluetooth - create bond, bluetooth - destroy bond, bluetooth - discover devices, bluetooth - get device, bluetooth - set name, bluetooth - add advertising service uuid, system-settings and contacts has been added] Change-Id: I8f52a529ee065ca852d232abf0b80c79cbad97c8 Signed-off-by: Shashank Shekhar Shukla --- diff --git a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk index dab1b09..4f3866f 100644 Binary files a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index e29f6eb..6f08033 100644 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ diff --git a/tbtcoreapp/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index 8818422..8776edc 100644 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -74,6 +74,13 @@ typedef enum { TBT_APP_BLE_GATT_CLIENT, + TBT_APP_BT_CALLBACK_CREATE_BOND_TEST, + TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST, + TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST, + TBT_APP_BT_CALLBACK_GET_DEVICE_TEST, + TBT_APP_BT_CALLBACK_SET_NAME_TEST, + TBT_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST, + TBT_APP_WIFIDIRECT, TBT_APP_WIFIDIRECT_CONNECTION_CANCEL, @@ -161,7 +168,20 @@ typedef enum { TBT_APP_IME_CONTEXT_GET, - TBT_APP_WIDGET + TBT_APP_WIDGET, + + TBT_APP_SYSTEM_SETTINGS_FONT, + TBT_APP_SYSTEM_SETTINGS_TIMEFORMAT, + TBT_APP_SYSTEM_SETTINGS_TIMECHANGE, + TBT_APP_SYSTEM_SETTINGS_LOCKSOUND, + TBT_APP_SYSTEM_SETTINGS_SILENT, + TBT_APP_SYSTEM_SETTINGS_TOUCHSOUND, + TBT_APP_SYSTEM_SETTINGS_SCREENROTATION, + TBT_APP_SYSTEM_SETTINGS_MOTION, + TBT_APP_SYSTEM_SETTINGS_FILGHTMODE, + TBT_APP_SYSTEM_SETTINGS_LOCKSTATE + + //TBT_APP_CONTACTS } tbt_app_type_e; diff --git a/tbtcoreapp/inc/utils/app_module_config.h b/tbtcoreapp/inc/utils/app_module_config.h index 69d5d89..ea19af0 100644 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -41,6 +41,14 @@ //#define TBT_MODULE_BLE //#define TBT_MODULE_BLE_GATT_CLIENT +#define TBT_MODULE_BT_CALLBACK_TEST +#define TBT_MODULE_APP_BT_CALLBACK_CREATE_BOND_TEST +#define TBT_MODULE_APP_BT_CALLBACK_DESTROY_BOND_TEST +#define TBT_MODULE_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST +#define TBT_MODULE_APP_BT_CALLBACK_GET_DEVICE_TEST +#define TBT_MODULE_APP_BT_CALLBACK_SET_NAME_TEST +#define TBT_MODULE_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST + //#define TBT_MODULE_BT_OOB //#define TBT_MODULE_APP_BT_OOB_DEVICE @@ -151,5 +159,20 @@ #define TBT_MODULE_FEATURE #define TBT_MODULE_APP_FEATURE_SUMMARY +#define TBT_MODULE_SYSTEMSETTINGS +#define TBT_MODULE_APP_SYSTEM_SETTINGS_FONT +#define TBT_MODULE_APP_SYSTEM_SETTINGS_TIMEFORMAT +#define TBT_MODULE_APP_SYSTEM_SETTINGS_TIMECHANGE +#define TBT_MODULE_APP_SYSTEM_SETTINGS_LOCKSOUND +#define TBT_MODULE_APP_SYSTEM_SETTINGS_SILENT +#define TBT_MODULE_APP_SYSTEM_SETTINGS_TOUCHSOUND +#define TBT_MODULE_APP_SYSTEM_SETTINGS_SCREENROTATION +#define TBT_MODULE_APP_SYSTEM_SETTINGS_MOTION +#define TBT_MODULE_APP_SYSTEM_SETTINGS_FILGHTMODE +#define TBT_MODULE_APP_SYSTEM_SETTINGS_LOCKSTATE + +//#define TBT_MODULE_CONTACTS +//#define TBT_MODULE_APP_CONTACTS + #endif diff --git a/tbtcoreapp/inc/view/tbt-bluetooth-callback-view.h b/tbtcoreapp/inc/view/tbt-bluetooth-callback-view.h new file mode 100644 index 0000000..52c3d01 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-bluetooth-callback-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * + *******************************************************************************/ +/** + * @file tbt-bluetooth-callback-view.h + * @brief retrieves bluetooth info + * @since_tizen 2.3 + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * @credit + * + */ + +#ifndef __TBT_BLUETOOTH_CALLBACK_VIEW_H__ +#define __TBT_BLUETOOTH_CALLBACK_VIEW_H__ + +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_BT_CALLBACK_TEST + +#include +#include "model/tbt-list.h" +#include + + +/** + * @typedef bluetooth_viewer_view + * @since_tizen 2.3 + * @brief A bluetooth viewer view handle. + */ +typedef struct _bluetooth_view bluetooth_view; + +/** + * @brief Create bluetooth view + * @since_tizen 2.3 + * @param[in] navi Parent naviframe + * @param[in] custom structute to hold tbt application information + * @param[in] item of the main tbt menu + * @return Pointer of bluetooth on success, otherwise NULL + */ +bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item); + +#endif +#endif // __TBT_BLUETOOTH_CALLBACK_VIEW_H__ diff --git a/tbtcoreapp/inc/view/tbt-contacts-view.h b/tbtcoreapp/inc/view/tbt-contacts-view.h new file mode 100644 index 0000000..c19cf44 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-contacts-view.h @@ -0,0 +1,60 @@ +#if 0 +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * + *******************************************************************************/ +/** + * @file tbt-contacts-view.h + * @brief retrieves contacts + * @since_tizen 2.3 + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * @credit + * + */ + +#ifndef __TBT_CONTACTS_VIEW_H__ +#define __TBT_CONTACTS_VIEW_H__ + +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_CONTACTS + +#include +#include "model/tbt-list.h" +#include + + +/** + * @typedef contacts_viewer_view + * @since_tizen 2.3 + * @brief A contacts viewer view handle. + */ +typedef struct _contacts_view contacts_view; + +/** + * @brief Create contacts view + * @since_tizen 2.3 + * @param[in] navi Parent naviframe + * @param[in] custom structute to hold tbt application information + * @param[in] item of the main tbt menu + * @return Pointer of contacts on success, otherwise NULL + */ +contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item); + +#endif +#endif // __TBT_CONTACTS_VIEW_H__ +#endif diff --git a/tbtcoreapp/inc/view/tbt-systemsettings-view.h b/tbtcoreapp/inc/view/tbt-systemsettings-view.h new file mode 100644 index 0000000..09360cc --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-systemsettings-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * + *******************************************************************************/ +/** + * @file tbt-systemsettings-view.h + * @brief retrieves systemsettings info + * @since_tizen 2.3 + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date October, 2014 + * @bug none + * @credit + * @credit + * + */ + +#ifndef __TBT_SYSTEMSETTINGS_VIEW_H__ +#define __TBT_SYSTEMSETTINGS_VIEW_H__ + +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_SYSTEMSETTINGS + +#include +#include "model/tbt-list.h" +#include + + +/** + * @typedef systemsettings_viewer_view + * @since_tizen 2.3 + * @brief A systemsettings viewer view handle. + */ +typedef struct _systemsettings_view systemsettings_view; + +/** + * @brief Create systemsettings view + * @since_tizen 2.3 + * @param[in] navi Parent naviframe + * @param[in] custom structute to hold tbt application information + * @param[in] item of the main tbt menu + * @return Pointer of systemsettings on success, otherwise NULL + */ +systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item); + +#endif +#endif // __TBT_SYSTEMSETTINGS_VIEW_H__ diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/bluetooth_callback_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/bluetooth_callback_viewer.edc new file mode 100644 index 0000000..3727654 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/bluetooth_callback_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "bluetooth_callback_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/contacts_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/contacts_viewer.edc new file mode 100644 index 0000000..f069e4d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/contacts_viewer.edc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#define TEXT_HEIGHT 0.02 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "contacts_viewer"; + parts{ + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.02 0.0; } + rel2 {relative: 0.98 TEXT_HEIGHT; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/systemsettings_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/systemsettings_viewer.edc new file mode 100755 index 0000000..ad5eb75 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/systemsettings_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "systemsettings_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/bluetooth_callback_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/bluetooth_callback_viewer.edc new file mode 100644 index 0000000..3727654 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/bluetooth_callback_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "bluetooth_callback_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/contacts_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/contacts_viewer.edc new file mode 100644 index 0000000..f069e4d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/contacts_viewer.edc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#define TEXT_HEIGHT 0.02 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "contacts_viewer"; + parts{ + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.02 0.0; } + rel2 {relative: 0.98 TEXT_HEIGHT; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/systemsettings_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/systemsettings_viewer.edc new file mode 100755 index 0000000..ad5eb75 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/systemsettings_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "systemsettings_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/bluetooth_callback_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/bluetooth_callback_viewer.edc new file mode 100644 index 0000000..3727654 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/bluetooth_callback_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "bluetooth_callback_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/contacts_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/contacts_viewer.edc new file mode 100644 index 0000000..ba8e53e --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/contacts_viewer.edc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#define TEXT_HEIGHT 0.02 + +#include "wearable_circle_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "contacts_viewer"; + parts{ + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.02 0.0; } + rel2 {relative: 0.98 TEXT_HEIGHT; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/systemsettings_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/systemsettings_viewer.edc new file mode 100755 index 0000000..ad5eb75 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/systemsettings_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "systemsettings_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/bluetooth_callback_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/bluetooth_callback_viewer.edc new file mode 100644 index 0000000..3727654 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/bluetooth_callback_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "bluetooth_callback_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/contacts_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/contacts_viewer.edc new file mode 100644 index 0000000..168d258 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/contacts_viewer.edc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#define TEXT_HEIGHT 0.02 + +#include "wearable_360_x_480_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "contacts_viewer"; + parts{ + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.02 0.0; } + rel2 {relative: 0.98 TEXT_HEIGHT; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/systemsettings_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/systemsettings_viewer.edc new file mode 100755 index 0000000..ad5eb75 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/systemsettings_viewer.edc @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +collections +{ + base_scale: 1.33; + group + { + name: "systemsettings_viewer"; + parts{ + + part{ + name: "info_text"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 0.10; } + rel2 {relative: 1.0 0.50; } + } + } + + part { name: "padding2"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.70; } + rel2 { relative: 1.0 1.0; } + fixed: 1 0; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + } + } + } + } +} diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index 6c22e2e..70c4599 100644 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -443,6 +443,100 @@ static tbt_info tbtapps[] = #endif #endif + +#ifdef TBT_MODULE_BT_CALLBACK_TEST + + #ifdef TBT_MODULE_APP_BT_CALLBACK_CREATE_BOND_TEST + + //Create Bond + { + .name = "Create Bond CB", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_CREATE_BOND_TEST, + .icon_name = "dummy", + .info = "Instructions:
Test Type One
1.Bluetooth On
2. Create Bonding callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + + #ifdef TBT_MODULE_APP_BT_CALLBACK_DESTROY_BOND_TEST + + //Destroy Bond + { + .name = "Destroy Bond CB", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST, + .icon_name = "dummy", + .info = "Instructions:
Test Type One
1.Bluetooth On
2. Destroy Bonding callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + + #ifdef TBT_MODULE_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST + + //Discover Device + { + .name = "Discover Devices CB", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST, + .icon_name = "dummy", + .info = "Instructions:
Test Type One
1.Bluetooth On
2. Device Discovery callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + + #ifdef TBT_MODULE_APP_BT_CALLBACK_GET_DEVICE_TEST + + //Get Device List + { + .name = "Get Device CB", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_GET_DEVICE_TEST, + .icon_name = "dummy", + .info = "Instructions:
Test Type One
1.Bluetooth On
2. Scanned callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + + #ifdef TBT_MODULE_APP_BT_CALLBACK_SET_NAME_TEST + + //Set Name + { + .name = "Set Name CB", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_SET_NAME_TEST, + .icon_name = "dummy", + .info = "Instructions:
Test Type One
1.Bluetooth On
2. Name Changed callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + + #ifdef TBT_MODULE_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST + + //Add UUID + { + .name = "Add Advertising Service UUID", + .parent = "Bluetooth Callback Test", + .apptype = TBT_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST, + .icon_name = "dummy", + .info = "Instructions:
Correct Error Message Displayed

NOTE: SEE INFO", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif +#endif + #ifdef TBT_MODULE_WIFI #ifdef TBT_MODULE_APP_WIFI_WIFI @@ -1317,9 +1411,150 @@ static tbt_info tbtapps[] = .icon_name = "dummy", .info = "View HW supported
feature's of the phone", .result = 0 + }, + #endif +#endif + +#ifdef TBT_MODULE_SYSTEMSETTINGS + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_FONT + + //System Settings + { + .name = "System Settings Font", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_FONT, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_TIMEFORMAT + + //System Settings + { + .name = "System Settings Time Format", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_TIMEFORMAT, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_TIMECHANGE + + //System Settings + { + .name = "System Settings Time Change", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_TIMECHANGE, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_LOCKSOUND + + //System Settings + { + .name = "System Settings Lock Sound", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_LOCKSOUND, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_SILENT + + //System Settings + { + .name = "System Settings Silent Mode", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_SILENT, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_TOUCHSOUND + + //System Settings + { + .name = "System Settings Touch Sound", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_TOUCHSOUND, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_SCREENROTATION + + //System Settings + { + .name = "System Settings Screen Rotation", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_SCREENROTATION, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_MOTION + + //System Settings + { + .name = "System Settings Motion", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_MOTION, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_FILGHTMODE + + //System Settings + { + .name = "System Settings Flight Mode", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_FILGHTMODE, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_LOCKSTATE + + //System Settings + { + .name = "System Settings Lock State", + .parent = "System Settings", + .apptype = TBT_APP_SYSTEM_SETTINGS_LOCKSTATE, + .icon_name = "dummy", + .info = "Instructions:

1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .result = 0 } #endif #endif + +//#ifdef TBT_MODULE_CONTACTS + //#ifdef TBT_MODULE_APP_CONTACTS + + //Contacts + //{ + //.name = "Contacts", + //.parent = "Contacts", + //.apptype = TBT_APP_CONTACTS, + //.icon_name = "dummy", + //.info = "Instructions:
1. Make a contact Test with number 12345678.
1. Call and message Test.
3. Verify the count with the number of calls and messages made to test.
4. Delete the contact Test.", + //.result = 0, + //.required_features_count = 1, + //.features_required = { 21 } + //} + //#endif +//#endif + }; #ifdef TBT_MODULE_SENSOR diff --git a/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c new file mode 100644 index 0000000..8f73c47 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c @@ -0,0 +1,484 @@ +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + *******************************************************************************/ +/** + * @file tbt-bluetooth-callback-view.c + * @brief retrieves bluetooth callback status + * + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date October, 2014 + * @bug none + * @credit + * + */ +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_BT_CALLBACK_TEST + +#include +#include + +#include "utils/logger.h" +#include "utils/config.h" +#include "utils/ui-utils.h" +#include "view/tbt-bluetooth-callback-view.h" +#include "view/tbt-common-view.h" + +struct _bluetooth_view +{ + common_view* view; + + Evas_Object *create_label; +}; + +static bool is_not_supported = false; +static const char *remote_address = "B8:5E:7B:E7:92:7D"; +static void _app_destroy_cb(void* this); +static void Bluetooth_bt_device_bond_created_cb_p(int result, bt_device_info_s * device_info, void *user_data); +static void Bluetooth_bt_device_bond_destroyed_cb_p(int result, char *remote_address, void *user_data); +static void Bluetooth_adapter_device_discovery_state_changed_cb_p(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data); +static void Bluetooth_bt_adapter_le_scan_result_cb(int result,bt_adapter_le_device_scan_result_info_s *info, void *user_data); +static void Bluetooth_bt_adapter_name_changed_cb_p(char *pszDeviceName, void *user_data); + + +/** + * @function get_bluetooth_error + * @since_tizen 2.3 + * @description Get Bluetooth Error + * @parameter bt_error_e: Bt Error E + * @return static char* + */ +static char* get_bluetooth_error(bt_error_e error) +{ + char* ret; + +switch(error) +{ + case BT_ERROR_NONE: + ret = "BT_ERROR_NONE"; + break; + case BT_ERROR_CANCELLED: + ret = "BT_ERROR_CANCELLED"; + break; + case BT_ERROR_INVALID_PARAMETER: + ret = "BT_ERROR_INVALID_PARAMETER"; + break; + case BT_ERROR_OUT_OF_MEMORY: + ret = "BT_ERROR_OUT_OF_MEMORY"; + break; + case BT_ERROR_RESOURCE_BUSY: + ret = "BT_ERROR_RESOURCE_BUSY"; + break; + case BT_ERROR_TIMED_OUT: + ret = "BT_ERROR_TIMED_OUT"; + break; + case BT_ERROR_NOW_IN_PROGRESS: + ret = "BT_ERROR_NOW_IN_PROGRESS"; + break; + case BT_ERROR_NOT_SUPPORTED: + ret = "BT_ERROR_NOT_SUPPORTED"; + break; + case BT_ERROR_PERMISSION_DENIED: + ret = "BT_ERROR_PERMISSION_DENIED"; + break; + case BT_ERROR_QUOTA_EXCEEDED: + ret = "BT_ERROR_QUOTA_EXCEEDED"; + break; + case BT_ERROR_NO_DATA: + ret = "BT_ERROR_NO_DATA"; + break; + case BT_ERROR_NOT_INITIALIZED: + ret = "BT_ERROR_NOT_INITIALIZED"; + break; + case BT_ERROR_NOT_ENABLED: + ret = "BT_ERROR_NOT_ENABLED"; + break; + case BT_ERROR_ALREADY_DONE: + ret = "BT_ERROR_ALREADY_DONE"; + break; + case BT_ERROR_OPERATION_FAILED: + ret = "BT_ERROR_OPERATION_FAILED"; + break; + case BT_ERROR_NOT_IN_PROGRESS: + ret = "BT_ERROR_NOT_IN_PROGRESS"; + break; + case BT_ERROR_REMOTE_DEVICE_NOT_BONDED: + ret = "BT_ERROR_REMOTE_DEVICE_NOT_BONDED"; + break; + case BT_ERROR_AUTH_REJECTED: + ret = "BT_ERROR_AUTH_REJECTED"; + break; + case BT_ERROR_AUTH_FAILED: + ret = "BT_ERROR_AUTH_FAILED"; + break; + case BT_ERROR_REMOTE_DEVICE_NOT_FOUND: + ret = "BT_ERROR_NONE"; + break; + case BT_ERROR_SERVICE_SEARCH_FAILED: + ret = "BT_ERROR_SERVICE_SEARCH_FAILED"; + break; + case BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED: + ret = "BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED"; + break; + case BT_ERROR_AGAIN: + ret = "BT_ERROR_AGAIN"; + break; + case BT_ERROR_SERVICE_NOT_FOUND: + ret = "BT_ERROR_SERVICE_NOT_FOUND"; + break; + default: + ret = "Unknown Error"; + break; + } + + return ret; +} + +/** + * @function bluetooth_callback_view_add + * @since_tizen 2.3 + * @description Bluetooth Callback View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return bluetooth_view* + */ +bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + int ret, value; + bluetooth_view *this = NULL; + this = calloc(1, sizeof(bluetooth_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "bluetooth_callback_viewer"; + tbt_info->layout_file = get_edje_path("bluetooth_callback_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + ret = bt_initialize(); + + if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_CREATE_BOND_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Create Bond: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + char resultc[256] ={0,}; + ret = bt_device_set_bond_created_cb(Bluetooth_bt_device_bond_created_cb_p, this); + DBG("bt_device_set_bond_created_cb %d", ret); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_device_set_bond_created_cb failed : %s", get_bluetooth_error(ret)); + + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + ret = bt_device_create_bond(remote_address); + DBG("bt_device_create_bond %d", ret); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + } + + else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Destroy Bond: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Test Type One
1.Bluetooth On
2. Destroy Bonding callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
Note:You can also refer info section"); + + char resultc[256] ={0,}; + ret = bt_device_set_bond_destroyed_cb(Bluetooth_bt_device_bond_destroyed_cb_p, this); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_device_set_bond_created_cb failed : %s", get_bluetooth_error(ret)); + + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + ret = bt_device_create_bond(remote_address); + DBG("bt_device_create_bond %d", ret); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + ret = bt_device_destroy_bond(remote_address); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + } + + else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Discover Devices: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Test Type One
1.Bluetooth On
2. Device Discovery callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
Note:You can also refer info section"); + + char resultc[256] ={0,}; + ret = bt_adapter_set_device_discovery_state_changed_cb(Bluetooth_adapter_device_discovery_state_changed_cb_p, this); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_adapter_set_device_discovery_state_changed_cb failed : %s", get_bluetooth_error(ret)); + + ret = bt_adapter_start_device_discovery(); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + } + + else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_GET_DEVICE_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Get Device List: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Test Type One
1.Bluetooth On
2. Scanned callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
Note:You can also refer info section"); + + char resultc[256] ={0,}; + + ret = bt_adapter_le_start_scan(Bluetooth_bt_adapter_le_scan_result_cb, this); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + } + + else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_SET_NAME_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Set Name: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Test Type One
1.Bluetooth On
2. Name Changed callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
Note:You can also refer info section"); + + char resultc[256] ={0,}; + ret = bt_adapter_set_name_changed_cb(Bluetooth_bt_adapter_name_changed_cb_p, this); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_adapter_set_name_changed_cb failed : %s", get_bluetooth_error(ret)); + + ret = bt_adapter_set_name("BT_TEST"); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + + ret = bt_adapter_set_name("BT_TEST2"); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + + ret = bt_adapter_set_name("BT_TEST3"); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + ret = bt_adapter_set_name("BT_TEST4"); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + ret = bt_adapter_set_name("BT_TEST5"); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + } + + else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST) + { + this->create_label = ui_utils_label_add(this->view->layout, "Set Name: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Correct Error Message Displayed

Note:You can also refer info section"); + + char resultc[256] ={0,}; + + bt_advertiser_h advertiser = NULL; + const char *time_svc_uuid_16 = "111FFFFFFFFFFFFFFFFFFFFF11100805F9B34FB"; + ret = bt_adapter_le_create_advertiser(&advertiser); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_adapter_le_create_advertiser failed : %s", get_bluetooth_error(ret)); + if(ret == BT_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + + ret = bt_adapter_le_add_advertising_service_uuid(advertiser,BT_ADAPTER_LE_PACKET_ADVERTISING, time_svc_uuid_16); + sprintf(resultc, "result for UUID = %s is = %s", time_svc_uuid_16,get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + + ret = bt_adapter_le_destroy_advertiser(advertiser); + RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_adapter_le_destroy_advertiser failed : %s", get_bluetooth_error(ret)); + + } + elm_object_part_content_set(this->view->layout, "info_text", this->create_label); + + return this; +} + +/** + * @function Bluetooth_bt_device_bond_created_cb_p + * @since_tizen 2.3 + * @description Bond Destroyed Callback + * @parameter int: result, bt_device_info_s*: device_info, void*: user data + * @return static void + */ + +static void Bluetooth_bt_device_bond_created_cb_p(int result, bt_device_info_s * device_info, void *user_data) +{ + DBG("Create Bond Callback"); + bluetooth_view *this = NULL; + this = (bluetooth_view*) user_data; + char resultc[256] ={0,}; + sprintf(resultc, "CreateBonding Callback Invoked with result = %s", get_bluetooth_error(result)); + ui_utils_label_set_text(this->create_label, resultc, "left"); +} + +/** + * @function Bluetooth_bt_device_bond_destroyed_cb_p + * @since_tizen 2.3 + * @description Bond Destroyed Callback + * @parameter int: result, char*: remote_address, void*: user data + * @return static void + */ +static void Bluetooth_bt_device_bond_destroyed_cb_p(int result, char *remote_address, void *user_data) +{ + bluetooth_view *this = NULL; + this = (bluetooth_view*) user_data; + char resultc[256] ={0,}; + sprintf(resultc, "DestroyBonding Callback Invoked with result = %s", get_bluetooth_error(result)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + +} + +/** + * @function Bluetooth_adapter_device_discovery_state_changed_cb_p + * @since_tizen 2.3 + * @description Discovery State Changed Callback + * @parameter int: result, bt_adapter_device_discovery_state_e*: discovery_state, bt_adapter_device_discovery_info_s*: discovery_info,void*: user data + * @return static void + */ +static void Bluetooth_adapter_device_discovery_state_changed_cb_p(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data) +{ + bluetooth_view *this = NULL; + this = (bluetooth_view*) user_data; + char resultc[256] ={0,}; + if ( result != 0 ) + { + sprintf(resultc, "Device Discovery result = %s", get_bluetooth_error(result)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + } + else + { + switch ( discovery_state ) + { + case BT_ADAPTER_DEVICE_DISCOVERY_STARTED: + ui_utils_label_set_text(this->create_label, "Device Discovery Invoked, device is discovering", "left"); + break; + case BT_ADAPTER_DEVICE_DISCOVERY_FINISHED: + ui_utils_label_set_text(this->create_label, "Device Discovery Invoked, device discovery is finished", "left"); + break; + case BT_ADAPTER_DEVICE_DISCOVERY_FOUND: + ui_utils_label_set_text(this->create_label, "Device Discovery Invoked, device is found", "left"); + break; + default: + ui_utils_label_set_text(this->create_label, "Device Discovery Invoked, No Status yet", "left"); + break; + } + } +} + +/** + * @function Bluetooth_bt_adapter_le_scan_result_cb + * @since_tizen 2.3 + * @description Scanned Callback + * @parameter int: result, bt_adapter_le_device_scan_result_info_s*: info, void*: user data + * @return static void + */ +static void Bluetooth_bt_adapter_le_scan_result_cb(int result,bt_adapter_le_device_scan_result_info_s *info, void *user_data) +{ + bluetooth_view *this = NULL; + this = (bluetooth_view*) user_data; + char resultc[256] ={0,}; + sprintf(resultc, "Scan Result Callback Invoked with result = %s", get_bluetooth_error(result)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + +} + +/** + * @function Bluetooth_bt_adapter_name_changed_cb_p + * @since_tizen 2.3 + * @description Adapter Name Changed Callback + * @parameter char*: pszDeviceName, void*: user data + * @return static void + */ +static void Bluetooth_bt_adapter_name_changed_cb_p(char *pszDeviceName, void *user_data) +{ + bluetooth_view *this = NULL; + this = (bluetooth_view*) user_data; + char resultc[256] ={0,}; + sprintf(resultc, "Adapter Namechanged Callback Invoked with new name of BT = %s", pszDeviceName); + ui_utils_label_set_text(this->create_label, resultc, "left"); +} + +/** + * @function _app_destroy_cb + * @since_tizen 2.3 + * @description App Destroy Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void _app_destroy_cb(void* this) +{ + + RETM_IF(NULL == this, "data is NULL"); + + bluetooth_view *view = NULL; + view = (bluetooth_view*)this; + RETM_IF(NULL == view, "view is NULL"); + + if(is_not_supported == true) + { + view->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED; + elm_genlist_item_update(view->view->item); + } + + int ret; + ret = bt_device_unset_bond_created_cb(); + ret = bt_device_unset_bond_destroyed_cb(); + ret = bt_adapter_unset_device_discovery_state_changed_cb(); + ret = bt_adapter_le_stop_scan(); + ret = bt_adapter_unset_name_changed_cb(); + + SAFE_DELETE(view->view); + SAFE_DELETE(view); +} +#endif diff --git a/tbtcoreapp/src/view/tbt-contacts-view.c b/tbtcoreapp/src/view/tbt-contacts-view.c new file mode 100644 index 0000000..1ef7ed5 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-contacts-view.c @@ -0,0 +1,221 @@ +#if 0 +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + *******************************************************************************/ +/** + * @file tbt-contacts-view.c + * @brief retrieves contacts + * + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * + */ +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_CONTACTS + +#include +#include + +#include "utils/logger.h" +#include "utils/config.h" +#include "utils/ui-utils.h" +#include "view/tbt-contacts-view.h" +#include "view/tbt-common-view.h" + +struct _contacts_view +{ + common_view* view; + + Evas_Object *info_label; +}; + +static bool is_not_supported = false; +static void _app_destroy_cb(void* this); + + +/** + * @function get_contacts_error + * @since_tizen 2.3 + * @description Get contacts Error + * @parameter int: Int + * @return char* + */ +char* get_contacts_error(int ret) +{ + char* err_msg = NULL; + switch (ret) { + case CONTACTS_ERROR_NONE: + err_msg = "CONTACTS_ERROR_NONE"; + break; + case CONTACTS_ERROR_OUT_OF_MEMORY: + err_msg = "CONTACTS_ERROR_OUT_OF_MEMORY"; + break; + case CONTACTS_ERROR_INVALID_PARAMETER: + err_msg = "CONTACTS_ERROR_INVALID_PARAMETER"; + break; + case CONTACTS_ERROR_FILE_NO_SPACE: + err_msg = "CONTACTS_ERROR_FILE_NO_SPACE"; + break; + case CONTACTS_ERROR_NO_DATA: + err_msg = "CONTACTS_ERROR_NO_DATA"; + break; + case CONTACTS_ERROR_PERMISSION_DENIED: + err_msg = "CONTACTS_ERROR_PERMISSION_DENIED"; + break; + case CONTACTS_ERROR_DB: + err_msg = "CONTACTS_ERROR_DB"; + break; + case CONTACTS_ERROR_DB_LOCKED: + err_msg = "CONTACTS_ERROR_DB_LOCKED"; + break; + case CONTACTS_ERROR_IPC_NOT_AVALIABLE: + err_msg = "CONTACTS_ERROR_IPC_NOT_AVALIABLE"; + break; + case CONTACTS_ERROR_IPC: + err_msg = "CONTACTS_ERROR_IPC"; + break; + case CONTACTS_ERROR_SYSTEM: + err_msg = "CONTACTS_ERROR_SYSTEM"; + break; + case CONTACTS_ERROR_INTERNAL: + err_msg = "CONTACTS_ERROR_INTERNAL"; + break; + + default: + err_msg = "Unknown Error"; + } + + return err_msg; +} + + +/** + * @function contacts_view_add + * @since_tizen 2.3 + * @description Contacts View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return contacts_view* + */ +contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + int ret; + contacts_view *this = NULL; + this = calloc(1, sizeof(contacts_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "contacts_viewer"; + tbt_info->layout_file = get_edje_path("contacts_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + this->info_label = ui_utils_label_add(this->view->layout, "Contacts: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + //ui_utils_guide_instruction_popup_button(navi, "Instructions:
1. Make a contact Test with number 12345678.
1. Call and message Test.
3. Verify the count with the number of calls and messages made to test.
4. Delete the contact Test.
Note:You can also refer info section"); + + contacts_list_h list = NULL; + contacts_query_h query; + contacts_filter_h filter = NULL; + contacts_record_h record; + char resultc[256] ={0,}; + int usage_count = 0; + + ret = contacts_connect(); + DBG("contacts_connect = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_connect failed: %s",get_contacts_error(ret)); + + if(ret == CONTACTS_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Contacts is not supported"); + RETVM_IF(!this->view, NULL,"Contacts is not supported"); + } + + ret = contacts_query_create(_contacts_person_usage._uri, &query); + DBG("contacts_query_create = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_query_create failed: %s",get_contacts_error(ret)); + + ret = contacts_filter_create(_contacts_person_usage._uri, &filter); + DBG("contacts_filter_create = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_filter_create failed: %s",get_contacts_error(ret)); + + ret = contacts_filter_add_str(filter, _contacts_person_usage.display_name, CONTACTS_MATCH_FULLSTRING, "Test"); + DBG("contacts_filter_add_str = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_filter_add_str failed: %s",get_contacts_error(ret)); + + ret = contacts_query_set_filter(query, filter); + DBG("contacts_query_set_filter = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_query_set_filter failed: %s",get_contacts_error(ret)); + + ret = contacts_db_get_records_with_query(query, 0, 0, &list); + DBG("contacts_db_get_records_with_query = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_db_get_records_with_query failed: %s",get_contacts_error(ret)); + + while (contacts_list_get_current_record_p(list, &record) == 0) + { + // Get details + ret = contacts_record_get_int(record, _contacts_person_usage.times_used, &usage_count); + DBG("contacts_record_get_int = %d", ret); + RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_record_get_int failed: %s",get_contacts_error(ret)); + + DBG("Usage Count = %d", usage_count); + + sprintf(resultc, "Total call and messages made to Test is = %d", usage_count); + ui_utils_label_set_text(this->info_label, resultc, "left"); + + break; + } + + elm_object_part_content_set(this->view->layout, "info_text", this->info_label); + + return this; +} + +/** + * @function _app_destroy_cb + * @since_tizen 2.3 + * @description App Destroy Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void _app_destroy_cb(void* this) +{ + + RETM_IF(NULL == this, "data is NULL"); + + contacts_view *view = NULL; + view = (contacts_view*)this; + RETM_IF(NULL == view, "view is NULL"); + + if(is_not_supported == true) + { + view->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED; + elm_genlist_item_update(view->view->item); + } + + SAFE_DELETE(view->view); + SAFE_DELETE(view); +} + +#endif +#endif diff --git a/tbtcoreapp/src/view/tbt-genlist-view.c b/tbtcoreapp/src/view/tbt-genlist-view.c index da095cb..89c7020 100644 --- a/tbtcoreapp/src/view/tbt-genlist-view.c +++ b/tbtcoreapp/src/view/tbt-genlist-view.c @@ -61,6 +61,7 @@ #include "view/tbt-genlist-view.h" #include "view/tbt-display-view.h" #include "view/tbt-bluetooth-view.h" +#include "view/tbt-bluetooth-callback-view.h" #include "view/tbt-animation-view.h" #include "view/tbt-feature-view.h" #include "view/tbt-touch-view.h" @@ -79,6 +80,9 @@ #include "view/tbt-ime-view.h" #include "view/tbt-widget-view.h" #include "view/tbt-bluetoothle-view.h" +#include "view/tbt-systemsettings-view.h" +//#include "view/tbt-contacts-view.h" + typedef struct { @@ -735,6 +739,28 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void bluetoothle_view_add(view->navi, info, it); break; #endif + + #ifdef TBT_MODULE_BT_CALLBACK_TEST + case TBT_APP_BT_CALLBACK_CREATE_BOND_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + case TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + case TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + case TBT_APP_BT_CALLBACK_GET_DEVICE_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + case TBT_APP_BT_CALLBACK_SET_NAME_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + case TBT_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST: + bluetooth_callback_view_add(view->navi, info, it); + break; + #endif + #ifdef TBT_MODULE_WIFI case TBT_APP_WIFI_WIFI: wifi_view_add(view->navi, info, it); @@ -978,7 +1004,44 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void break; #endif + #ifdef TBT_MODULE_SYSTEMSETTINGS + case TBT_APP_SYSTEM_SETTINGS_FONT: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_TIMEFORMAT: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_TIMECHANGE: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_LOCKSOUND: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_SILENT: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_TOUCHSOUND: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_SCREENROTATION: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_MOTION: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_FILGHTMODE: + systemsettings_view_add(view->navi, info, it); + break; + case TBT_APP_SYSTEM_SETTINGS_LOCKSTATE: + systemsettings_view_add(view->navi, info, it); + break; + #endif + //#ifdef TBT_MODULE_CONTACTS + //case TBT_APP_CONTACTS: + //contacts_view_add(view->navi, info, it); + //break; + //#endif default: assert(false); diff --git a/tbtcoreapp/src/view/tbt-systemsettings-view.c b/tbtcoreapp/src/view/tbt-systemsettings-view.c new file mode 100755 index 0000000..a5dc5d5 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-systemsettings-view.c @@ -0,0 +1,842 @@ +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + *******************************************************************************/ +/** + * @file tbt-systemsettings-view.c + * @brief retrieves system settings + * + * @author Shashank Shekhar Shukla(shekhar1.s@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * + */ +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_SYSTEMSETTINGS + +#include +#include + +#include "utils/logger.h" +#include "utils/config.h" +#include "utils/ui-utils.h" +#include "view/tbt-systemsettings-view.h" +#include "view/tbt-common-view.h" + +struct _systemsettings_view +{ + common_view* view; + + Evas_Object *create_label; +}; + +static bool is_not_supported = false; +static void _app_destroy_cb(void* this); +void _system_settings_font_size_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_timeformat_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_time_changed_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_sound_lock_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_sound_silent_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_sound_touch_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_screen_rotation_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_motion_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_flight_mode_changed_cb(system_settings_key_e key, void *user_data); +void _system_settings_lock_state_changed_cb(system_settings_key_e key, void *user_data); + + +/** + * @function get_system_settings_error + * @since_tizen 2.3 + * @description Get System SettingsError + * @parameter int: Int + * @return char* + */ +char* get_system_settings_error(int ret) +{ + char* err_msg = NULL; + switch (ret) { + case SYSTEM_SETTINGS_ERROR_NONE: + err_msg = "SYSTEM_SETTINGS_ERROR_NONE"; + break; + case SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER: + err_msg = "SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER"; + break; + case SYSTEM_SETTINGS_ERROR_OUT_OF_MEMORY: + err_msg = "SYSTEM_SETTINGS_ERROR_OUT_OF_MEMORY"; + break; + case SYSTEM_SETTINGS_ERROR_IO_ERROR: + err_msg = "SYSTEM_SETTINGS_ERROR_IO_ERROR"; + break; + case SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED: + err_msg = "SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED"; + break; + case SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED: + err_msg = "SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED"; + break; + case SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE: + err_msg = "SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE"; + break; + default: + err_msg = "Unknown Error"; + } + + return err_msg; +} + + +/** + * @function systemsettings_view_add + * @since_tizen 2.3 + * @description System settings View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return systemsettings_view* + */ +systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = calloc(1, sizeof(systemsettings_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "systemsettings_viewer"; + tbt_info->layout_file = get_edje_path("systemsettings_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_FONT) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE, _system_settings_font_size_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Key Font Size: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + if(ret == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "System Settings is not supported"); + RETVM_IF(!this->view, NULL,"System Settings is not supported"); + } + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &value); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", value); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Small Size", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Normal Size", "left"); + break; + + case 2: + ui_utils_label_set_text(this->create_label, "Large Size", "left"); + break; + + case 3: + ui_utils_label_set_text(this->create_label, "Huge Size", "left"); + break; + + case 4: + ui_utils_label_set_text(this->create_label, "Giant Size", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "Unknown status", "left"); + break; + + } + } + /*timeformat*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_TIMEFORMAT) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, _system_settings_timeformat_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Time Format: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "12-Hour Clock used", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "24-Hour Clock used", "left"); + break; + + } + } + /*timeformat*/ + /*time_changed*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_TIMECHANGE) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED, _system_settings_time_changed_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Key Font Size: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, &value); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Time unchanged", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Time changed", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "System Time Unknown status", "left"); + break; + + } + } + + /*time_changed*/ + /*sound_lock*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_LOCKSOUND) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK, _system_settings_sound_lock_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Lock Sound: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Lock Sound is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Lock Sound is enabled", "left"); + break; + + } + } + /*sound_lock*/ + /*sound_silent*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_SILENT) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, _system_settings_sound_silent_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Silent Mode: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Silent Mode is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Silent Mode is enabled", "left"); + break; + + } + } + /*sound_silent*/ + /*sound_touch*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_TOUCHSOUND) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, _system_settings_sound_touch_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Screen Touch Sound: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Screen Touch Sound is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Screen Touch Sound is enabled", "left"); + break; + + } + } + /*sound_touch*/ + /*screen_rotation*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_SCREENROTATION) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, _system_settings_screen_rotation_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Rotation Control: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Rotation Control is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Rotation Control is enabled", "left"); + break; + + } + } + /*screen_rotation*/ + /*motion*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_MOTION) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, _system_settings_motion_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Motion Feature: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Motion Feature is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Motion Feature is enabled", "left"); + break; + + } + } + /*motion*/ + /*filght_mode*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_FILGHTMODE) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, _system_settings_flight_mode_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Flight Mode: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &bvalue); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", bvalue); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Flight Mode is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Flight Mode is enabled", "left"); + break; + + } + } + /*filght_mode*/ + /*lock_state*/ + if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_LOCKSTATE) + { + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCK_STATE, _system_settings_lock_state_changed_cb, this); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_set_changed_cb failed : %s", get_system_settings_error(ret)); + + this->create_label = ui_utils_label_add(this->view->layout, "Flight Mode: "); + elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD); + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_LOCK_STATE, &value); + RETVM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, NULL, "system_settings_get_value_bool failed: %s",get_system_settings_error(ret)); + + DBG("value: %d", value); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Device is unlocked", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Device is locked", "left"); + break; + + case 2: + ui_utils_label_set_text(this->create_label, "Device is being locked", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "Unknown status", "left"); + break; + + } + } +/*lock_state*/ + elm_object_part_content_set(this->view->layout, "info_text", this->create_label); + + DBG("view complete: %d", value); + + return this; +} + + +/** + * @function _app_destroy_cb + * @since_tizen 2.3 + * @description App Destroy Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void _app_destroy_cb(void* this) +{ + int ret = -1; + RETM_IF(NULL == this, "data is NULL"); + + systemsettings_view *view = NULL; + view = (systemsettings_view*)this; + RETM_IF(NULL == view, "view is NULL"); + + if(is_not_supported == true) + { + view->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED; + elm_genlist_item_update(view->view->item); + } + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCK_STATE); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_unset_changed_cb failed: %s",get_system_settings_error(ret)); + + SAFE_DELETE(view->view); + SAFE_DELETE(view); +} + + +/** + * @function _system_settings_font_size_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_font_size_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &value); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Small Size", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Normal Size", "left"); + break; + + case 2: + ui_utils_label_set_text(this->create_label, "Large Size", "left"); + break; + + case 3: + ui_utils_label_set_text(this->create_label, "Huge Size", "left"); + break; + + case 4: + ui_utils_label_set_text(this->create_label, "Giant Size", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "Unknown status", "left"); + break; + + } +} + +/** + * @function _system_settings_timeformat_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_timeformat_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "12-Hour Clock used", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "24-Hour Clock used", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "Unknown status", "left"); + break; + + } +} + +/** + * @function _system_settings_time_changed_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_time_changed_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, &value); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Time unchanged", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Time changed", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "System Time Unknown status", "left"); + break; + + } +} + +/** + * @function _system_settings_sound_lock_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_sound_lock_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Lock Sound is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Lock Sound is enabled", "left"); + break; + + } +} + +/** + * @function _system_settings_sound_silent_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_sound_silent_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Silent Mode is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Silent Mode is enabled", "left"); + break; + + } +} + +/** + * @function _system_settings_sound_touch_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_sound_touch_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Screen Touch Sound is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Screen Touch Sound is enabled", "left"); + break; + + } +} + +/** + * @function _system_settings_screen_rotation_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_screen_rotation_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Rotation Control is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Rotation Control is enabled", "left"); + break; + } +} + +/** + * @function _system_settings_motion_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_motion_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Motion Feature is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Motion Feature is enabled", "left"); + break; + + } +} + +/** + * @function _system_settings_flight_mode_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_flight_mode_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + bool bvalue; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &bvalue); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch((int)bvalue) + { + case 0: + ui_utils_label_set_text(this->create_label, "Flight Mode is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Flight Mode is enabled", "left"); + break; + + } +} + +/** + * @function _system_settings_lock_state_changed_cb + * @since_tizen 2.3 + * @description System Settings Key Font Size Changed Cb + * @parameter system_settings_key_e: System Settings Key E, void*: Void Pointer + * @return void + */ +void _system_settings_lock_state_changed_cb(system_settings_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + systemsettings_view *this = NULL; + this = (systemsettings_view*) user_data; + + ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_LOCK_STATE, &value); + RETM_IF(ret != SYSTEM_SETTINGS_ERROR_NONE && ret != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, "system_settings_get_value_int failed: %s",get_system_settings_error(ret)); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->create_label, "Device is unlocked", "left"); + break; + + case 1: + ui_utils_label_set_text(this->create_label, "Device is locked", "left"); + break; + + case 2: + ui_utils_label_set_text(this->create_label, "Device is being locked", "left"); + break; + + default: + ui_utils_label_set_text(this->create_label, "Unknown status", "left"); + break; + + } +} +#endif diff --git a/tbtcoreapp/tizen-manifest.xml b/tbtcoreapp/tizen-manifest.xml index 0ac176d..4509b62 100644 --- a/tbtcoreapp/tizen-manifest.xml +++ b/tbtcoreapp/tizen-manifest.xml @@ -19,5 +19,9 @@ http://tizen.org/privilege/internet http://tizen.org/privilege/network.set http://tizen.org/privilege/notification - + http://tizen.org/privilege/callhistory.read + http://tizen.org/privilege/callhistory.write + http://tizen.org/privilege/contact.read + http://tizen.org/privilege/contact.write +