--- /dev/null
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+ Apache License\r
+ Version 2.0, January 2004\r
+ http://www.apache.org/licenses/\r
+\r
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+ 1. Definitions.\r
+\r
+ "License" shall mean the terms and conditions for use, reproduction,\r
+ and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+ "Licensor" shall mean the copyright owner or entity authorized by\r
+ the copyright owner that is granting the License.\r
+\r
+ "Legal Entity" shall mean the union of the acting entity and all\r
+ other entities that control, are controlled by, or are under common\r
+ control with that entity. For the purposes of this definition,\r
+ "control" means (i) the power, direct or indirect, to cause the\r
+ direction or management of such entity, whether by contract or\r
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+ outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+ "You" (or "Your") shall mean an individual or Legal Entity\r
+ exercising permissions granted by this License.\r
+\r
+ "Source" form shall mean the preferred form for making modifications,\r
+ including but not limited to software source code, documentation\r
+ source, and configuration files.\r
+\r
+ "Object" form shall mean any form resulting from mechanical\r
+ transformation or translation of a Source form, including but\r
+ not limited to compiled object code, generated documentation,\r
+ and conversions to other media types.\r
+\r
+ "Work" shall mean the work of authorship, whether in Source or\r
+ Object form, made available under the License, as indicated by a\r
+ copyright notice that is included in or attached to the work\r
+ (an example is provided in the Appendix below).\r
+\r
+ "Derivative Works" shall mean any work, whether in Source or Object\r
+ form, that is based on (or derived from) the Work and for which the\r
+ editorial revisions, annotations, elaborations, or other modifications\r
+ represent, as a whole, an original work of authorship. For the purposes\r
+ of this License, Derivative Works shall not include works that remain\r
+ separable from, or merely link (or bind by name) to the interfaces of,\r
+ the Work and Derivative Works thereof.\r
+\r
+ "Contribution" shall mean any work of authorship, including\r
+ the original version of the Work and any modifications or additions\r
+ to that Work or Derivative Works thereof, that is intentionally\r
+ submitted to Licensor for inclusion in the Work by the copyright owner\r
+ or by an individual or Legal Entity authorized to submit on behalf of\r
+ the copyright owner. For the purposes of this definition, "submitted"\r
+ means any form of electronic, verbal, or written communication sent\r
+ to the Licensor or its representatives, including but not limited to\r
+ communication on electronic mailing lists, source code control systems,\r
+ and issue tracking systems that are managed by, or on behalf of, the\r
+ Licensor for the purpose of discussing and improving the Work, but\r
+ excluding communication that is conspicuously marked or otherwise\r
+ designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+ "Contributor" shall mean Licensor and any individual or Legal Entity\r
+ on behalf of whom a Contribution has been received by Licensor and\r
+ subsequently incorporated within the Work.\r
+\r
+ 2. Grant of Copyright License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ copyright license to reproduce, prepare Derivative Works of,\r
+ publicly display, publicly perform, sublicense, and distribute the\r
+ Work and such Derivative Works in Source or Object form.\r
+\r
+ 3. Grant of Patent License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ (except as stated in this section) patent license to make, have made,\r
+ use, offer to sell, sell, import, and otherwise transfer the Work,\r
+ where such license applies only to those patent claims licensable\r
+ by such Contributor that are necessarily infringed by their\r
+ Contribution(s) alone or by combination of their Contribution(s)\r
+ with the Work to which such Contribution(s) was submitted. If You\r
+ institute patent litigation against any entity (including a\r
+ cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+ or a Contribution incorporated within the Work constitutes direct\r
+ or contributory patent infringement, then any patent licenses\r
+ granted to You under this License for that Work shall terminate\r
+ as of the date such litigation is filed.\r
+\r
+ 4. Redistribution. You may reproduce and distribute copies of the\r
+ Work or Derivative Works thereof in any medium, with or without\r
+ modifications, and in Source or Object form, provided that You\r
+ meet the following conditions:\r
+\r
+ (a) You must give any other recipients of the Work or\r
+ Derivative Works a copy of this License; and\r
+\r
+ (b) You must cause any modified files to carry prominent notices\r
+ stating that You changed the files; and\r
+\r
+ (c) You must retain, in the Source form of any Derivative Works\r
+ that You distribute, all copyright, patent, trademark, and\r
+ attribution notices from the Source form of the Work,\r
+ excluding those notices that do not pertain to any part of\r
+ the Derivative Works; and\r
+\r
+ (d) If the Work includes a "NOTICE" text file as part of its\r
+ distribution, then any Derivative Works that You distribute must\r
+ include a readable copy of the attribution notices contained\r
+ within such NOTICE file, excluding those notices that do not\r
+ pertain to any part of the Derivative Works, in at least one\r
+ of the following places: within a NOTICE text file distributed\r
+ as part of the Derivative Works; within the Source form or\r
+ documentation, if provided along with the Derivative Works; or,\r
+ within a display generated by the Derivative Works, if and\r
+ wherever such third-party notices normally appear. The contents\r
+ of the NOTICE file are for informational purposes only and\r
+ do not modify the License. You may add Your own attribution\r
+ notices within Derivative Works that You distribute, alongside\r
+ or as an addendum to the NOTICE text from the Work, provided\r
+ that such additional attribution notices cannot be construed\r
+ as modifying the License.\r
+\r
+ You may add Your own copyright statement to Your modifications and\r
+ may provide additional or different license terms and conditions\r
+ for use, reproduction, or distribution of Your modifications, or\r
+ for any such Derivative Works as a whole, provided Your use,\r
+ reproduction, and distribution of the Work otherwise complies with\r
+ the conditions stated in this License.\r
+\r
+ 5. Submission of Contributions. Unless You explicitly state otherwise,\r
+ any Contribution intentionally submitted for inclusion in the Work\r
+ by You to the Licensor shall be under the terms and conditions of\r
+ this License, without any additional terms or conditions.\r
+ Notwithstanding the above, nothing herein shall supersede or modify\r
+ the terms of any separate license agreement you may have executed\r
+ with Licensor regarding such Contributions.\r
+\r
+ 6. Trademarks. This License does not grant permission to use the trade\r
+ names, trademarks, service marks, or product names of the Licensor,\r
+ except as required for reasonable and customary use in describing the\r
+ origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+ 7. Disclaimer of Warranty. Unless required by applicable law or\r
+ agreed to in writing, Licensor provides the Work (and each\r
+ Contributor provides its Contributions) on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+ implied, including, without limitation, any warranties or conditions\r
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+ PARTICULAR PURPOSE. You are solely responsible for determining the\r
+ appropriateness of using or redistributing the Work and assume any\r
+ risks associated with Your exercise of permissions under this License.\r
+\r
+ 8. Limitation of Liability. In no event and under no legal theory,\r
+ whether in tort (including negligence), contract, or otherwise,\r
+ unless required by applicable law (such as deliberate and grossly\r
+ negligent acts) or agreed to in writing, shall any Contributor be\r
+ liable to You for damages, including any direct, indirect, special,\r
+ incidental, or consequential damages of any character arising as a\r
+ result of this License or out of the use or inability to use the\r
+ Work (including but not limited to damages for loss of goodwill,\r
+ work stoppage, computer failure or malfunction, or any and all\r
+ other commercial damages or losses), even if such Contributor\r
+ has been advised of the possibility of such damages.\r
+\r
+ 9. Accepting Warranty or Additional Liability. While redistributing\r
+ the Work or Derivative Works thereof, You may choose to offer,\r
+ and charge a fee for, acceptance of support, warranty, indemnity,\r
+ or other liability obligations and/or rights consistent with this\r
+ License. However, in accepting such obligations, You may act only\r
+ on Your own behalf and on Your sole responsibility, not on behalf\r
+ of any other Contributor, and only if You agree to indemnify,\r
+ defend, and hold each Contributor harmless for any liability\r
+ incurred by, or claims asserted against, such Contributor by reason\r
+ of your accepting any such warranty or additional liability.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ APPENDIX: How to apply the Apache License to your work.\r
+\r
+ To apply the Apache License to your work, attach the following\r
+ boilerplate notice, with the fields enclosed by brackets "[]"\r
+ replaced with your own identifying information. (Don't include\r
+ the brackets!) The text should be enclosed in the appropriate\r
+ comment syntax for the file format. We also recommend that a\r
+ file or class name and description of purpose be included on the\r
+ same "printed page" as the copyright notice for easier\r
+ identification within third-party archives.\r
+\r
+ Copyright [yyyy] [name of copyright owner]\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
--- /dev/null
+/*
+ * tel-plugin-vconf
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include <glib.h>
+#include <vconf.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <storage.h>
+#include <co_network.h>
+
+static TcoreStorageDispatchCallback callback_dispatch;
+
+static const gchar* convert_strgkey_to_vconf(enum tcore_storage_key key)
+{
+ switch (key) {
+ case STORAGE_KEY_TELEPHONY_PLMN:
+ return VCONFKEY_TELEPHONY_PLMN;
+ case STORAGE_KEY_TELEPHONY_LAC:
+ return VCONFKEY_TELEPHONY_LAC;
+ case STORAGE_KEY_TELEPHONY_CELLID:
+ return VCONFKEY_TELEPHONY_CELLID;
+ case STORAGE_KEY_TELEPHONY_SVCTYPE:
+ return VCONFKEY_TELEPHONY_SVCTYPE;
+ case STORAGE_KEY_TELEPHONY_SVC_CS:
+ return VCONFKEY_TELEPHONY_SVC_CS;
+ case STORAGE_KEY_TELEPHONY_SVC_PS:
+ return VCONFKEY_TELEPHONY_SVC_PS;
+ case STORAGE_KEY_TELEPHONY_SVC_ROAM:
+ return VCONFKEY_TELEPHONY_SVC_ROAM;
+ case STORAGE_KEY_TELEPHONY_ZONE_TYPE:
+ return VCONFKEY_TELEPHONY_ZONE_TYPE;
+ case STORAGE_KEY_TELEPHONY_SIM_INIT:
+ return VCONFKEY_TELEPHONY_SIM_INIT;
+ case STORAGE_KEY_TELEPHONY_SIM_CHV:
+ return VCONFKEY_TELEPHONY_SIM_CHV;
+ case STORAGE_KEY_TELEPHONY_SIM_PB_INIT:
+ return VCONFKEY_TELEPHONY_SIM_PB_INIT;
+ case STORAGE_KEY_TELEPHONY_CALL_STATE:
+ return VCONFKEY_TELEPHONY_CALL_STATE;
+ case STORAGE_KEY_TELEPHONY_CALL_FORWARD_STATE:
+ return VCONFKEY_TELEPHONY_CALL_FORWARD_STATE;
+ case STORAGE_KEY_TELEPHONY_TAPI_STATE:
+ return VCONFKEY_TELEPHONY_TAPI_STATE;
+ case STORAGE_KEY_TELEPHONY_SPN_DISP_CONDITION:
+ return VCONFKEY_TELEPHONY_SPN_DISP_CONDITION;
+ case STORAGE_KEY_TELEPHONY_SAT_STATE:
+ return VCONFKEY_TELEPHONY_SAT_STATE;
+ case STORAGE_KEY_TELEPHONY_ZONE_ZUHAUSE:
+ return VCONFKEY_TELEPHONY_ZONE_ZUHAUSE;
+ case STORAGE_KEY_TELEPHONY_RSSI:
+ return VCONFKEY_TELEPHONY_RSSI;
+ case STORAGE_KEY_TELEPHONY_LOW_BATTERY:
+ return VCONFKEY_TELEPHONY_LOW_BATTERY;
+ case STORAGE_KEY_TELEPHONY_EVENT_SYSTEM_READY:
+ return "memory/telephony/event_system_ready";
+ case STORAGE_KEY_TELEPHONY_SIM_SLOT:
+ return VCONFKEY_TELEPHONY_SIM_SLOT;
+ case STORAGE_KEY_PM_STATE:
+ return VCONFKEY_PM_STATE;
+ case STORAGE_KEY_PACKET_SERVICE_STATE:
+ return VCONFKEY_DNET_STATE;
+ case STORAGE_KEY_MESSAGE_NETWORK_MODE:
+ return VCONFKEY_MESSAGE_NETWORK_MODE;
+ case STORAGE_KEY_3G_ENABLE:
+ return VCONFKEY_3G_ENABLE;
+ case STORAGE_KEY_SETAPPL_STATE_DATA_ROAMING_BOOL:
+ return VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL;
+ case STORAGE_KEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL:
+ return VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL;
+ case STORAGE_KEY_SETAPPL_FLIGHT_MODE_BOOL:
+ return VCONFKEY_SETAPPL_FLIGHT_MODE_BOOL;
+ case STORAGE_KEY_TELEPHONY_NWNAME:
+ return VCONFKEY_TELEPHONY_NWNAME;
+ case STORAGE_KEY_TELEPHONY_SPN_NAME:
+ return VCONFKEY_TELEPHONY_SPN_NAME;
+ case STORAGE_KEY_TELEPHONY_SAT_SETUP_IDLE_TEXT:
+ return VCONFKEY_TELEPHONY_SAT_SETUP_IDLE_TEXT;
+ case STORAGE_KEY_TELEPHONY_IMEI:
+ return VCONFKEY_TELEPHONY_IMEI;
+ case STORAGE_KEY_TELEPHONY_SUBSCRIBER_NUMBER:
+ return VCONFKEY_TELEPHONY_SUBSCRIBER_NUMBER;
+ case STORAGE_KEY_TELEPHONY_SUBSCRIBER_NAME:
+ return VCONFKEY_TELEPHONY_SUBSCRIBER_NAME;
+ case STORAGE_KEY_TELEPHONY_SWVERSION:
+ return VCONFKEY_TELEPHONY_SWVERSION;
+ case STORAGE_KEY_TELEPHONY_HWVERSION:
+ return VCONFKEY_TELEPHONY_HWVERSION;
+ case STORAGE_KEY_TELEPHONY_CALDATE:
+ return VCONFKEY_TELEPHONY_CALDATE;
+ case STORAGE_KEY_TELEPHONY_IMEI_FACTORY_REBOOT:
+ return VCONFKEY_TELEPHONY_IMEI_FACTORY_REBOOT;
+ case STORAGE_KEY_TELEPHONY_SIM_FACTORY_MODE:
+ return VCONFKEY_TELEPHONY_SIM_FACTORY_MODE;
+ case STORAGE_KEY_TELEPHONY_PRODUCTCODE:
+ return VCONFKEY_TELEPHONY_PRODUCTCODE;
+ case STORAGE_KEY_TELEPHONY_FACTORY_KSTRINGB:
+ return VCONFKEY_TELEPHONY_FACTORY_KSTRINGB;
+ case STORAGE_KEY_TELEPHONY_IMSI:
+ return "db/telephony/imsi";
+ case STORAGE_KEY_CELLULAR_STATE:
+ return VCONFKEY_NETWORK_CELLULAR_STATE;
+ case STORAGE_KEY_CELLULAR_PKT_TOTAL_RCV:
+ return VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_RCV;
+ case STORAGE_KEY_CELLULAR_PKT_TOTAL_SNT:
+ return VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_SNT;
+ case STORAGE_KEY_CELLULAR_PKT_LAST_RCV:
+ return VCONFKEY_NETWORK_CELLULAR_PKT_LAST_RCV;
+ case STORAGE_KEY_CELLULAR_PKT_LAST_SNT:
+ return VCONFKEY_NETWORK_CELLULAR_PKT_LAST_SNT;
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+static enum tcore_storage_key convert_vconf_to_strgkey(const gchar* key)
+{
+ if (g_str_equal(key, VCONFKEY_TELEPHONY_PLMN) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_PLMN;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_LAC) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_LAC;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_CELLID) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_CELLID;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SVCTYPE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SVCTYPE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SVC_CS) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SVC_CS;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SVC_PS) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SVC_PS;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SVC_ROAM) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SVC_ROAM;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_ZONE_TYPE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_ZONE_TYPE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SIM_INIT) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SIM_INIT;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SIM_CHV) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SIM_CHV;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SIM_PB_INIT) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SIM_PB_INIT;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_CALL_STATE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_CALL_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_CALL_FORWARD_STATE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_CALL_FORWARD_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_TAPI_STATE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_TAPI_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SPN_DISP_CONDITION) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SPN_DISP_CONDITION;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SAT_STATE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SAT_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_ZONE_ZUHAUSE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_ZONE_ZUHAUSE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_RSSI) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_RSSI;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_LOW_BATTERY) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_LOW_BATTERY;
+ }
+ else if (g_str_equal(key, "memory/telephony/event_system_ready") == TRUE) {
+ return STORAGE_KEY_TELEPHONY_EVENT_SYSTEM_READY;
+ }
+ else if (g_str_equal(key, VCONFKEY_3G_ENABLE) == TRUE) {
+ return STORAGE_KEY_3G_ENABLE;
+ }
+ else if (g_str_equal(key, VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL) == TRUE) {
+ return STORAGE_KEY_SETAPPL_STATE_DATA_ROAMING_BOOL;
+ }
+ else if (g_str_equal(key, VCONFKEY_PM_STATE) == TRUE) {
+ return STORAGE_KEY_PM_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_MESSAGE_NETWORK_MODE) == TRUE) {
+ return STORAGE_KEY_MESSAGE_NETWORK_MODE;
+ }
+ else if (g_str_equal(key, VCONFKEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL) == TRUE) {
+ return STORAGE_KEY_SETAPPL_STATE_AUTOMATIC_TIME_UPDATE_BOOL;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SIM_SLOT) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SIM_SLOT;
+ }
+ else if (g_str_equal(key, VCONFKEY_SETAPPL_FLIGHT_MODE_BOOL) == TRUE) {
+ return STORAGE_KEY_SETAPPL_FLIGHT_MODE_BOOL;
+ }
+ else if (g_str_equal(key, VCONFKEY_DNET_STATE) == TRUE) {
+ return STORAGE_KEY_PACKET_SERVICE_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_NWNAME) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_NWNAME;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SPN_NAME) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SPN_NAME;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SAT_SETUP_IDLE_TEXT) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SAT_SETUP_IDLE_TEXT;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_IMEI) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_IMEI;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SUBSCRIBER_NUMBER) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SUBSCRIBER_NUMBER;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SUBSCRIBER_NAME) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SUBSCRIBER_NAME;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SWVERSION) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SWVERSION;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_HWVERSION) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_HWVERSION;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_CALDATE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_CALDATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_IMEI_FACTORY_REBOOT) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_IMEI_FACTORY_REBOOT;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_SIM_FACTORY_MODE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_SIM_FACTORY_MODE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_PRODUCTCODE) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_PRODUCTCODE;
+ }
+ else if (g_str_equal(key, VCONFKEY_TELEPHONY_FACTORY_KSTRINGB) == TRUE) {
+ return STORAGE_KEY_TELEPHONY_FACTORY_KSTRINGB;
+ }
+ else if (g_str_equal(key, "db/telephony/imsi") == TRUE) {
+ return STORAGE_KEY_TELEPHONY_IMSI;
+ }
+ else if (g_str_equal(key, VCONFKEY_NETWORK_CELLULAR_STATE) == TRUE) {
+ return STORAGE_KEY_CELLULAR_STATE;
+ }
+ else if (g_str_equal(key, VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_RCV) == TRUE) {
+ return STORAGE_KEY_CELLULAR_PKT_TOTAL_RCV;
+ }
+ else if (g_str_equal(key, VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_SNT) == TRUE) {
+ return STORAGE_KEY_CELLULAR_PKT_TOTAL_SNT;
+ }
+ else if (g_str_equal(key, VCONFKEY_NETWORK_CELLULAR_PKT_LAST_RCV) == TRUE) {
+ return STORAGE_KEY_CELLULAR_PKT_LAST_RCV;
+ }
+ else if (g_str_equal(key, VCONFKEY_NETWORK_CELLULAR_PKT_LAST_SNT) == TRUE) {
+ return STORAGE_KEY_CELLULAR_PKT_LAST_SNT;
+ }
+ return 0;
+}
+
+static void* create_handle(Storage *strg, const char *path)
+{
+ void *tmp = NULL;
+ if(!strg)
+ return NULL;
+
+ tmp = malloc(sizeof(char));
+ return tmp;
+}
+
+static gboolean remove_handle(Storage *strg, void *handle)
+{
+ if(!strg || !handle)
+ return FALSE;
+
+ free(handle);
+ return TRUE;
+}
+
+static gboolean set_int(Storage *strg, enum tcore_storage_key key, int value)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return FALSE;
+
+ if(key & STORAGE_KEY_INT)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(!s_key)
+ return FALSE;
+
+ vconf_set_int(s_key, value);
+ return TRUE;
+}
+
+static gboolean set_bool(Storage *strg, enum tcore_storage_key key, gboolean value)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return FALSE;
+
+ if(key & STORAGE_KEY_BOOL)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(!s_key)
+ return FALSE;
+
+ vconf_set_bool(s_key, value);
+ return TRUE;
+}
+
+static gboolean set_string(Storage *strg, enum tcore_storage_key key, const char *value)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return FALSE;
+
+ if(key & STORAGE_KEY_STRING)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(!s_key)
+ return FALSE;
+
+ vconf_set_str(s_key, value);
+ return TRUE;
+}
+
+static int get_int(Storage *strg, enum tcore_storage_key key)
+{
+ int value = -1;
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return value;
+
+ if(key & STORAGE_KEY_INT)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(s_key != NULL)
+ vconf_get_int(s_key, &value);
+
+ return value;
+}
+
+static gboolean get_bool(Storage *strg, enum tcore_storage_key key)
+{
+ gboolean value = FALSE;
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return value;
+
+ if(key & STORAGE_KEY_BOOL)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(s_key != NULL)
+ vconf_get_bool(s_key, &value);
+
+ return value;
+}
+
+static char *get_string(Storage *strg, enum tcore_storage_key key)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return NULL;
+
+ if(key & STORAGE_KEY_STRING)
+ s_key = convert_strgkey_to_vconf(key);
+
+ if(s_key != NULL)
+ return vconf_get_str(s_key);
+
+ return NULL;
+}
+
+static void __vconfkey_callback(keynode_t* node, void* data)
+{
+ int type = 0;
+ char *vkey = NULL;
+ GVariant *value = NULL;
+ enum tcore_storage_key s_key = 0;
+ Storage *strg = NULL;
+
+ strg = (Storage *)data;
+ vkey = vconf_keynode_get_name(node);
+ type = vconf_keynode_get_type(node);
+ s_key = convert_vconf_to_strgkey(vkey);
+
+ if(type == VCONF_TYPE_STRING){
+ gchar *tmp;
+ tmp = (gchar *)vconf_keynode_get_str(node);
+ value = g_variant_new_string( tmp );
+ }
+ else if(type == VCONF_TYPE_INT){
+ gint32 tmp = 0;
+ tmp = vconf_keynode_get_int(node);
+ value = g_variant_new_int32( tmp );
+ }
+ else if(type == VCONF_TYPE_DOUBLE){
+ gdouble tmp = 0;
+ tmp = vconf_keynode_get_dbl(node);
+ value = g_variant_new_double( tmp );
+ }
+ else if(type == VCONF_TYPE_BOOL){
+ gboolean tmp = FALSE;
+ tmp = vconf_keynode_get_bool(node);
+ value = g_variant_new_boolean( tmp );
+ }
+
+
+ if(callback_dispatch != NULL)
+ callback_dispatch(strg, s_key, value);
+
+ return;
+}
+
+static gboolean set_key_callback(Storage *strg, enum tcore_storage_key key, TcoreStorageDispatchCallback cb)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return FALSE;
+
+ s_key = convert_strgkey_to_vconf(key);
+ dbg("s_key (%s)", s_key);
+
+ if(s_key == NULL)
+ return FALSE;
+
+ if(callback_dispatch == NULL)
+ callback_dispatch = cb;
+
+ vconf_notify_key_changed(s_key, __vconfkey_callback, strg);
+ return TRUE;
+}
+
+static gboolean remove_key_callback(Storage *strg, enum tcore_storage_key key)
+{
+ const gchar *s_key = NULL;
+
+ if (!strg)
+ return FALSE;
+
+ s_key = convert_strgkey_to_vconf(key);
+ dbg("s_key (%s)", s_key);
+
+ if(s_key == NULL)
+ return FALSE;
+
+ vconf_ignore_key_changed(s_key, __vconfkey_callback);
+ return TRUE;
+}
+
+struct storage_operations ops = {
+ .create_handle = create_handle,
+ .remove_handle = remove_handle,
+ .set_int = set_int,
+ .set_string = set_string,
+ .set_bool = set_bool,
+ .get_int = get_int,
+ .get_string = get_string,
+ .get_bool = get_bool,
+ .set_key_callback = set_key_callback,
+ .remove_key_callback = remove_key_callback,
+};
+
+static enum tcore_hook_return on_hook_network_location_cellinfo(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_network_location_cellinfo *info = data;
+
+ dbg("vconf set");
+
+ vconf_set_int(VCONFKEY_TELEPHONY_CELLID, info->cell_id);
+ vconf_set_int(VCONFKEY_TELEPHONY_LAC, info->lac);
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_network_icon_info(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_network_icon_info *info = data;
+
+ vconf_set_int(VCONFKEY_TELEPHONY_RSSI, info->rssi);
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_network_registration_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_network_registration_status *info = data;
+ int current;
+ int status;
+
+ dbg("vconf set");
+
+ /* CS */
+ if (info->cs_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL)
+ status = 2;
+ else
+ status = 1;
+
+ vconf_get_int(VCONFKEY_TELEPHONY_SVC_CS, ¤t);
+ if (current != status)
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_CS, status);
+
+ /* PS */
+ if (info->ps_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL)
+ status = 2;
+ else
+ status = 1;
+
+ vconf_get_int(VCONFKEY_TELEPHONY_SVC_PS, ¤t);
+ if (current != status)
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_PS, status);
+
+ /* Service type */
+ vconf_get_int(VCONFKEY_TELEPHONY_SVCTYPE, ¤t);
+ if (current != (int) info->service_type)
+ vconf_set_int(VCONFKEY_TELEPHONY_SVCTYPE, info->service_type);
+
+ switch(info->service_type) {
+ case NETWORK_SERVICE_TYPE_UNKNOWN:
+ case NETWORK_SERVICE_TYPE_NO_SERVICE:
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "No Service");
+ break;
+
+ case NETWORK_SERVICE_TYPE_EMERGENCY:
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "EMERGENCY");
+ break;
+
+ case NETWORK_SERVICE_TYPE_SEARCH:
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "Searching...");
+ break;
+ default:
+ break;
+ }
+
+ vconf_get_int(VCONFKEY_TELEPHONY_SVC_ROAM, ¤t);
+ if (current != info->roaming_status)
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_ROAM, info->roaming_status);
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_network_change(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_network_change *info = data;
+ struct tcore_network_operator_info *noi = NULL;
+ char mcc[4] = { 0, };
+ char mnc[4] = { 0, };
+ enum telephony_network_service_type svc_type;
+ enum tcore_network_name_priority network_name_priority;
+ char *tmp;
+
+ dbg("vconf set");
+
+ vconf_set_int(VCONFKEY_TELEPHONY_PLMN, atoi(info->plmn));
+ vconf_set_int(VCONFKEY_TELEPHONY_LAC, info->gsm.lac);
+
+ // nw_name
+ snprintf(mcc, 4, "%s", info->plmn);
+ snprintf(mnc, 4, "%s", info->plmn+3);
+
+ if (mnc[2] == '#')
+ mnc[2] = '\0';
+
+ tcore_network_get_service_type(source, &svc_type);
+ tcore_network_get_network_name_priority(source, &network_name_priority);
+ switch (network_name_priority) {
+ case TCORE_NETWORK_NAME_PRIORITY_SPN:
+ vconf_set_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, VCONFKEY_TELEPHONY_DISP_SPN);
+ break;
+
+ case TCORE_NETWORK_NAME_PRIORITY_NETWORK:
+ vconf_set_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, VCONFKEY_TELEPHONY_DISP_PLMN);
+ break;
+
+ case TCORE_NETWORK_NAME_PRIORITY_ANY:
+ vconf_set_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, VCONFKEY_TELEPHONY_DISP_SPN_PLMN);
+ break;
+
+ default:
+ vconf_set_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, VCONFKEY_TELEPHONY_DISP_INVALID);
+ break;
+ }
+
+ switch (svc_type) {
+ case NETWORK_SERVICE_TYPE_2G:
+ case NETWORK_SERVICE_TYPE_2_5G:
+ case NETWORK_SERVICE_TYPE_2_5G_EDGE:
+ case NETWORK_SERVICE_TYPE_3G:
+ case NETWORK_SERVICE_TYPE_HSDPA:
+ /* spn */
+ tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SPN);
+ if (tmp) {
+ dbg("SPN[%s]", tmp);
+ vconf_set_str(VCONFKEY_TELEPHONY_SPN_NAME, tmp);
+ free(tmp);
+ }
+
+ /* nitz */
+ tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SHORT);
+ if (tmp) {
+ dbg("NWNAME = NITZ_SHORT[%s]", tmp);
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, tmp);
+ free(tmp);
+ break;
+ }
+
+ /* pre-define table */
+ noi = tcore_network_operator_info_find(source, mcc, mnc);
+ if (noi) {
+ dbg("%s-%s: country=[%s], oper=[%s]", mcc, mnc, noi->country, noi->name);
+ dbg("NWNAME = pre-define table[%s]", noi->name);
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, noi->name);
+ }
+ else {
+ dbg("%s-%s: no network operator name", mcc, mnc);
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, info->plmn);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_sim_init(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_sim_status *sim = data;
+ dbg("vconf set");
+
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_CHV, sim->sim_status);
+
+ switch (sim->sim_status) {
+ case SIM_STATUS_CARD_ERROR:
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_SLOT, VCONFKEY_TELEPHONY_SIM_CARD_ERROR);
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "SIM Error");
+ break;
+
+ case SIM_STATUS_CARD_NOT_PRESENT:
+ case SIM_STATUS_CARD_REMOVED:
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_SLOT, VCONFKEY_TELEPHONY_SIM_NOT_PRESENT);
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "NO SIM");
+ break;
+
+ case SIM_STATUS_INIT_COMPLETED:
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_SLOT, VCONFKEY_TELEPHONY_SIM_INSERTED);
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_INIT, VCONFKEY_TELEPHONY_SIM_INIT_COMPLETED);
+ break;
+
+ case SIM_STATUS_INITIALIZING:
+ case SIM_STATUS_PIN_REQUIRED:
+ case SIM_STATUS_PUK_REQUIRED:
+ case SIM_STATUS_LOCK_REQUIRED:
+ case SIM_STATUS_CARD_BLOCKED:
+ case SIM_STATUS_NCK_REQUIRED:
+ case SIM_STATUS_NSCK_REQUIRED:
+ case SIM_STATUS_SPCK_REQUIRED:
+ case SIM_STATUS_CCK_REQUIRED:
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_SLOT, VCONFKEY_TELEPHONY_SIM_INSERTED);
+ break;
+
+ default:
+ break;
+ }
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_pb_init(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_phonebook_status *pb = data;
+ dbg("vconf set");
+
+ if (vconf_set_int(VCONFKEY_TELEPHONY_SIM_PB_INIT, pb->b_init) != 0)
+ dbg("[FAIL] UPDATE VCONFKEY_TELEPHONY_SIM_PB_INIT");
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_ps_protocol_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ TcorePlugin *p = NULL;
+ GSList *co_list = NULL;
+ CoreObject *co_network = NULL;
+ const struct tnoti_ps_protocol_status *noti = data;
+ enum telephony_network_service_type svc_type;
+ dbg("vconf set")
+
+ vconf_get_int(VCONFKEY_TELEPHONY_SVCTYPE, (int *)&svc_type);
+ if((int)svc_type < (int)VCONFKEY_TELEPHONY_SVCTYPE_2G){
+ dbg("service state is not available");
+ return TCORE_HOOK_RETURN_CONTINUE;
+ }
+
+ if(noti->status == TELEPHONY_HSDPA_ON)
+ vconf_set_int(VCONFKEY_TELEPHONY_SVCTYPE, VCONFKEY_TELEPHONY_SVCTYPE_HSDPA);
+ else{
+ p = tcore_object_ref_plugin(source);
+ co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
+ co_network = co_list->data;
+ if(!co_network)
+ dbg("network co does not exist");
+ tcore_network_get_service_type(co_network, &svc_type);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVCTYPE, svc_type);
+ g_slist_free(co_list);
+ }
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_modem_power(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_modem_power *power = data;
+ dbg("vconf set");
+
+ if (power->state == MODEM_STATE_ONLINE) {
+ dbg("tapi ready");
+ vconf_set_int(VCONFKEY_TELEPHONY_TAPI_STATE, VCONFKEY_TELEPHONY_TAPI_STATE_READY);
+ }
+ else {
+ dbg("tapi none");
+ vconf_set_int(VCONFKEY_TELEPHONY_TAPI_STATE, VCONFKEY_TELEPHONY_TAPI_STATE_NONE);
+ }
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static void reset_vconf()
+{
+ vconf_set_str(VCONFKEY_TELEPHONY_NWNAME, "no_network");
+ vconf_set_int(VCONFKEY_TELEPHONY_PLMN, 0);
+ vconf_set_int(VCONFKEY_TELEPHONY_LAC, 0);
+ vconf_set_int(VCONFKEY_TELEPHONY_CELLID, 0);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVCTYPE, VCONFKEY_TELEPHONY_SVCTYPE_NONE);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_CS, VCONFKEY_TELEPHONY_SVC_CS_UNKNOWN);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_PS, VCONFKEY_TELEPHONY_SVC_PS_UNKNOWN);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_ROAM, VCONFKEY_TELEPHONY_SVC_ROAM_OFF);
+ vconf_set_int(VCONFKEY_TELEPHONY_ZONE_TYPE, VCONFKEY_TELEPHONY_ZONE_NONE);
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_INIT, VCONFKEY_TELEPHONY_SIM_INIT_NONE);
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_CHV, 0xFF);
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_SLOT, VCONFKEY_TELEPHONY_SIM_UNKNOWN);
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_PB_INIT, VCONFKEY_TELEPHONY_SIM_PB_INIT_NONE);
+ vconf_set_int(VCONFKEY_TELEPHONY_CALL_STATE, VCONFKEY_TELEPHONY_CALL_CONNECT_IDLE);
+ vconf_set_int(VCONFKEY_TELEPHONY_CALL_FORWARD_STATE, VCONFKEY_TELEPHONY_CALL_FORWARD_OFF);
+ vconf_set_int(VCONFKEY_TELEPHONY_TAPI_STATE, VCONFKEY_TELEPHONY_TAPI_STATE_NONE);
+ vconf_set_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, VCONFKEY_TELEPHONY_DISP_INVALID);
+ vconf_set_str(VCONFKEY_TELEPHONY_SPN_NAME, "no_spn");
+ vconf_set_int(VCONFKEY_TELEPHONY_SAT_STATE, VCONFKEY_TELEPHONY_SAT_NONE);
+ vconf_set_str(VCONFKEY_TELEPHONY_SAT_SETUP_IDLE_TEXT, "");
+ vconf_set_int(VCONFKEY_TELEPHONY_ZONE_ZUHAUSE, 0);
+ vconf_set_int(VCONFKEY_TELEPHONY_RSSI, VCONFKEY_TELEPHONY_RSSI_0);
+ vconf_set_int(VCONFKEY_TELEPHONY_LOW_BATTERY, VCONFKEY_TELEPHONY_BATT_NORMAL_LEVEL);
+ vconf_set_str(VCONFKEY_TELEPHONY_IMEI, "deprecated_vconf_imei");
+ vconf_set_str(VCONFKEY_TELEPHONY_SUBSCRIBER_NUMBER, "");
+ vconf_set_str(VCONFKEY_TELEPHONY_SUBSCRIBER_NAME, "");
+ vconf_set_int(VCONFKEY_TELEPHONY_SIM_PB_INIT,VCONFKEY_TELEPHONY_SIM_PB_INIT_NONE);
+}
+
+static gboolean on_load()
+{
+ dbg("i'm load!");
+
+ return TRUE;
+}
+
+static gboolean on_init(TcorePlugin *p)
+{
+ Storage *strg;
+ Server *s;
+
+ if (!p)
+ return FALSE;
+
+ dbg("i'm init!");
+
+ strg = tcore_storage_new(p, "vconf", &ops);
+
+ reset_vconf();
+
+ vconf_set_int(VCONFKEY_TELEPHONY_LOW_BATTERY, VCONFKEY_TELEPHONY_BATT_NORMAL_LEVEL);
+ vconf_set_int(VCONFKEY_TELEPHONY_SVC_ROAM, VCONFKEY_TELEPHONY_SVC_ROAM_OFF);
+
+ s = tcore_plugin_ref_server(p);
+ tcore_server_add_notification_hook(s, TNOTI_NETWORK_LOCATION_CELLINFO, on_hook_network_location_cellinfo, strg);
+ tcore_server_add_notification_hook(s, TNOTI_NETWORK_ICON_INFO, on_hook_network_icon_info, strg);
+ tcore_server_add_notification_hook(s, TNOTI_NETWORK_REGISTRATION_STATUS, on_hook_network_registration_status, strg);
+ tcore_server_add_notification_hook(s, TNOTI_NETWORK_CHANGE, on_hook_network_change, strg);
+ tcore_server_add_notification_hook(s, TNOTI_SIM_STATUS, on_hook_sim_init, strg);
+ tcore_server_add_notification_hook(s, TNOTI_PHONEBOOK_STATUS, on_hook_pb_init, strg);
+ tcore_server_add_notification_hook(s, TNOTI_PS_PROTOCOL_STATUS, on_hook_ps_protocol_status, strg);
+ tcore_server_add_notification_hook(s, TNOTI_MODEM_POWER, on_hook_modem_power, strg);
+
+ return TRUE;
+}
+
+static void on_unload(TcorePlugin *p)
+{
+ Storage *strg;
+
+ if (!p)
+ return;
+
+ dbg("i'm unload");
+
+ strg = tcore_server_find_storage(tcore_plugin_ref_server(p), "vconf");
+ if (!strg)
+ return;
+
+ tcore_storage_free(strg);
+}
+
+struct tcore_plugin_define_desc plugin_define_desc =
+{
+ .name = "VCONF_STORAGE",
+ .priority = TCORE_PLUGIN_PRIORITY_HIGH - 1,
+ .version = 1,
+ .load = on_load,
+ .init = on_init,
+ .unload = on_unload
+};