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,
TBT_APP_NOTIFICATION_IMAGE,
- TBT_APP_CONNECTION
+ TBT_APP_CONNECTION,
+
+ TBT_APP_SYSTEM_SETTINGS,
+
+ TBT_APP_CONTACTS
} tbt_app_type_e;
#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
#define TBT_MODULE_CONNECTION
#define TBT_MODULE_APP_CONNECTION
+#define TBT_MODULE_SYSTEMSETTINGS
+#define TBT_MODULE_APP_SYSTEM_SETTINGS
+
+#define TBT_MODULE_CONTACTS
+#define TBT_MODULE_APP_CONTACTS
+
#endif
--- /dev/null
+/*******************************************************************************
+ * 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 <Evas.h>
+#include "model/tbt-list.h"
+#include <bluetooth.h>
+
+
+/**
+ * @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__
--- /dev/null
+/*******************************************************************************
+ * 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 <Evas.h>
+#include "model/tbt-list.h"
+#include <contacts.h>
+
+
+/**
+ * @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__
--- /dev/null
+/*******************************************************************************
+ * 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 <Evas.h>
+#include "model/tbt-list.h"
+#include <system_settings.h>
+
+
+/**
+ * @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__
--- /dev/null
+/*
+ * 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 1.0
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "bluetooth_callback_viewer";
+ parts{
+ part{
+ name: "bluetooth_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; }
+ }
+ }
+
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 1.0
+
+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; }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "systemsettings_viewer";
+ parts{
+ part{
+ name: "info_text1";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text2";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 TEXT_HEIGHT; }
+ rel2 {relative: 1.0 2*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text3";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 2*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 3*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text4";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 3*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 4*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text5";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 4*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 5*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text6";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 5*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 6*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text7";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 6*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 7*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text8";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 7*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 8*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text9";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 8*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 9*TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "info_text10";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 9*TEXT_HEIGHT; }
+ rel2 {relative: 1.0 10*TEXT_HEIGHT; }
+ }
+ }
+ }
+ }
+}
#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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Create Bonding callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/>",
+ .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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Destroy Bonding callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Device Discovery callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Scanned callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Name Changed callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>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:<br/>Correct Error Message Displayed<br/><br/>NOTE: SEE INFO",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {16}
+ },
+ #endif
+#endif
+
#ifdef TBT_MODULE_WIFI
#ifdef TBT_MODULE_APP_WIFI_WIFI
.result = 0,
.required_features_count = 2,
.features_required = {24,21}
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_SYSTEMSETTINGS
+ #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS
+
+ //System Settings
+ {
+ .name = "System Settings",
+ .parent = "System Settings",
+ .apptype = TBT_APP_SYSTEM_SETTINGS,
+ .icon_name = "dummy",
+ .info = "Instructions:<br/><br/>1.Manually change settings for each item through device Settings.<br/>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:<br/>1. Make a contact Test with number 12345678.<br/>1. Call and message Test.<br/>3. Verify the count with the number of calls and messages made to test.<br/>4. Delete the contact Test.",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = { 21 }
}
#endif
#endif
+
};
#ifdef TBT_MODULE_SENSOR
--- /dev/null
+/*******************************************************************************
+ * 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 <Elementary.h>
+#include <locations.h>
+
+#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);
+
+ ui_utils_guide_instruction_popup_button(navi, "Instructions:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Create Bonding callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>Note:You can also refer info section");
+
+ 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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Destroy Bonding callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Device Discovery callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Scanned callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>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:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Name Changed callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>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:<br/>Correct Error Message Displayed<br/><br/><b>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, "bluetooth_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
--- /dev/null
+/*******************************************************************************
+ * 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 <Elementary.h>
+#include <locations.h>
+
+#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:<br/>1. Make a contact Test with number 12345678.<br/>1. Call and message Test.<br/>3. Verify the count with the number of calls and messages made to test.<br/>4. Delete the contact Test.<br/><b>Note:You can also refer info section</b>");
+
+ 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
#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"
#include "view/tbt-package-manager-view.h"
#include "view/tbt-notification-view.h"
#include "view/tbt-connection-view.h"
+#include "view/tbt-systemsettings-view.h"
+#include "view/tbt-contacts-view.h"
typedef struct
{
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);
connection_view_add(view->navi, info, it);
break;
#endif
+ #ifdef TBT_MODULE_SYSTEMSETTINGS
+ case TBT_APP_SYSTEM_SETTINGS:
+ 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);
break;
--- /dev/null
+/*******************************************************************************
+ * 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 <Elementary.h>
+#include <locations.h>
+
+#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 *font_size_label;
+ Evas_Object *timeformat_label;
+ Evas_Object *time_changed_label;
+ Evas_Object *sound_lock_label;
+ Evas_Object *sound_silent_label;
+ Evas_Object *sound_touch_label;
+ Evas_Object *screen_rotation_label;
+ Evas_Object *motion_label;
+ Evas_Object *flight_mode_label;
+ Evas_Object *lock_state_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");
+
+ ui_utils_guide_instruction_popup_button(navi, "Instructions:<br/><br/>1.Manually change settings for each item through device Settings.<br/>2. Verify all the items' values.<br/><b>Note:You can also refer info section</b>");
+
+ 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->font_size_label = ui_utils_label_add(this->view->layout, "Key Font Size: ");
+ elm_label_line_wrap_set(this->font_size_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->font_size_label, "Small Size", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->font_size_label, "Normal Size", "left");
+ break;
+
+ case 2:
+ ui_utils_label_set_text(this->font_size_label, "Large Size", "left");
+ break;
+
+ case 3:
+ ui_utils_label_set_text(this->font_size_label, "Huge Size", "left");
+ break;
+
+ case 4:
+ ui_utils_label_set_text(this->font_size_label, "Giant Size", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->font_size_label, "Unknown status", "left");
+ break;
+
+ }
+/*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->timeformat_label = ui_utils_label_add(this->view->layout, "Time Format: ");
+ elm_label_line_wrap_set(this->timeformat_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->timeformat_label, "12-Hour Clock used", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->timeformat_label, "24-Hour Clock used", "left");
+ break;
+
+ }
+/*timeformat*/
+/*time_changed*/
+
+ 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->time_changed_label = ui_utils_label_add(this->view->layout, "Key Font Size: ");
+ elm_label_line_wrap_set(this->time_changed_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->time_changed_label, "Time unchanged", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->time_changed_label, "Time changed", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->time_changed_label, "System Time Unknown status", "left");
+ break;
+
+ }
+
+/*time_changed*/
+/*sound_lock*/
+ 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->sound_lock_label = ui_utils_label_add(this->view->layout, "Lock Sound: ");
+ elm_label_line_wrap_set(this->sound_lock_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->sound_lock_label, "Lock Sound is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_lock_label, "Lock Sound is enabled", "left");
+ break;
+
+ }
+/*sound_lock*/
+/*sound_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->sound_silent_label = ui_utils_label_add(this->view->layout, "Silent Mode: ");
+ elm_label_line_wrap_set(this->sound_silent_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->sound_silent_label, "Silent Mode is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_silent_label, "Silent Mode is enabled", "left");
+ break;
+
+ }
+/*sound_silent*/
+/*sound_touch*/
+ 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->sound_touch_label = ui_utils_label_add(this->view->layout, "Screen Touch Sound: ");
+ elm_label_line_wrap_set(this->sound_touch_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->sound_touch_label, "Screen Touch Sound is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_touch_label, "Screen Touch Sound is enabled", "left");
+ break;
+
+ }
+/*sound_touch*/
+/*screen_rotation*/
+ 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->screen_rotation_label = ui_utils_label_add(this->view->layout, "Rotation Control: ");
+ elm_label_line_wrap_set(this->screen_rotation_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->screen_rotation_label, "Rotation Control is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->screen_rotation_label, "Rotation Control is enabled", "left");
+ break;
+
+ }
+/*screen_rotation*/
+/*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->motion_label = ui_utils_label_add(this->view->layout, "Motion Feature: ");
+ elm_label_line_wrap_set(this->motion_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->motion_label, "Motion Feature is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->motion_label, "Motion Feature is enabled", "left");
+ break;
+
+ }
+/*motion*/
+/*filght_mode*/
+ 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->flight_mode_label = ui_utils_label_add(this->view->layout, "Flight Mode: ");
+ elm_label_line_wrap_set(this->flight_mode_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->flight_mode_label, "Flight Mode is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->flight_mode_label, "Flight Mode is enabled", "left");
+ break;
+
+ }
+/*filght_mode*/
+/*lock_state*/
+ 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->lock_state_label = ui_utils_label_add(this->view->layout, "Flight Mode: ");
+ elm_label_line_wrap_set(this->lock_state_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->lock_state_label, "Device is unlocked", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->lock_state_label, "Device is locked", "left");
+ break;
+
+ case 2:
+ ui_utils_label_set_text(this->lock_state_label, "Device is being locked", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->lock_state_label, "Unknown status", "left");
+ break;
+
+ }
+/*lock_state*/
+ elm_object_part_content_set(this->view->layout, "info_text1", this->font_size_label);
+ elm_object_part_content_set(this->view->layout, "info_text2", this->timeformat_label);
+ elm_object_part_content_set(this->view->layout, "info_text3", this->time_changed_label);
+ elm_object_part_content_set(this->view->layout, "info_text4", this->sound_lock_label);
+ elm_object_part_content_set(this->view->layout, "info_text5", this->sound_silent_label);
+ elm_object_part_content_set(this->view->layout, "info_text6", this->sound_touch_label);
+ elm_object_part_content_set(this->view->layout, "info_text7", this->screen_rotation_label);
+ elm_object_part_content_set(this->view->layout, "info_text8", this->motion_label);
+ elm_object_part_content_set(this->view->layout, "info_text9", this->flight_mode_label);
+ elm_object_part_content_set(this->view->layout, "info_text10", this->lock_state_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)
+{
+ 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->font_size_label, "Small Size", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->font_size_label, "Normal Size", "left");
+ break;
+
+ case 2:
+ ui_utils_label_set_text(this->font_size_label, "Large Size", "left");
+ break;
+
+ case 3:
+ ui_utils_label_set_text(this->font_size_label, "Huge Size", "left");
+ break;
+
+ case 4:
+ ui_utils_label_set_text(this->font_size_label, "Giant Size", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->font_size_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->timeformat_label, "12-Hour Clock used", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->timeformat_label, "24-Hour Clock used", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->timeformat_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->time_changed_label, "Time unchanged", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->time_changed_label, "Time changed", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->time_changed_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->sound_lock_label, "Lock Sound is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_lock_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->sound_silent_label, "Silent Mode is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_silent_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->sound_touch_label, "Screen Touch Sound is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->sound_touch_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->screen_rotation_label, "Rotation Control is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->screen_rotation_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->motion_label, "Motion Feature is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->motion_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->flight_mode_label, "Flight Mode is disabled", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->flight_mode_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->lock_state_label, "Device is unlocked", "left");
+ break;
+
+ case 1:
+ ui_utils_label_set_text(this->lock_state_label, "Device is locked", "left");
+ break;
+
+ case 2:
+ ui_utils_label_set_text(this->lock_state_label, "Device is being locked", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->lock_state_label, "Unknown status", "left");
+ break;
+
+ }
+}
+#endif
<privilege>http://tizen.org/privilege/packagemanager.info</privilege>
<privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
<privilege>http://tizen.org/privilege/network.profile</privilege>
+ <privilege>http://tizen.org/privilege/callhistory.read</privilege>
+ <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+ <privilege>http://tizen.org/privilege/contact.read</privilege>
+ <privilege>http://tizen.org/privilege/contact.write</privilege>
</privileges>
</manifest>