tizen_2.0_build
authorgiyeol.ok <giyeol.ok@samsung.com>
Tue, 21 Aug 2012 09:13:51 +0000 (18:13 +0900)
committergiyeol.ok <giyeol.ok@samsung.com>
Wed, 22 Aug 2012 00:16:51 +0000 (09:16 +0900)
Change-Id: Ice0f7b67853877acf1f43a238f79dd460d8594eb

31 files changed:
AUTHORS
CMakeLists.txt [changed mode: 0644->0755]
LICENSE [changed mode: 0755->0644]
debian/changelog [deleted file]
debian/copyright [deleted file]
debian/rules
debian/system-server-bin.postinst.in
include/ss_data.h
packaging/system-server.spec [changed mode: 0644->0755]
ss_bs.c
ss_cpu_handler.c
ss_device_change_handler.c [changed mode: 0644->0755]
ss_lowbat_handler.c [changed mode: 0644->0755]
ss_lowmem_handler.c
ss_main.c
ss_mmc_handler.c
ss_pmon_handler.c
ss_pmon_handler.h
ss_predefine.c
ss_procmgr.c [changed mode: 0644->0755]
ss_sysnoti.c [changed mode: 0644->0755]
ss_ta_handler.c
ss_timemgr.c
ss_usb_handler.c
ss_usb_storage_handler.c
sys_device_noti/CMakeLists.txt [new file with mode: 0755]
sys_device_noti/data/batt_full_icon.png [new file with mode: 0755]
sys_device_noti/sys_device_noti.c [new file with mode: 0755]
sys_device_noti/sys_device_noti.h [new file with mode: 0755]
system_server.sh [changed mode: 0755->0644]
udev-rules/91-system-server.rules.in

diff --git a/AUTHORS b/AUTHORS
index 67e6bd9..6edd069 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,2 @@
-Jinkun Jang <jinkun.jang@samsung.com>\r
-DongGi Jang <dg0402.jang@samsung.com>\r
+Giyeol Ok <giyeol.ok@samsung.com>\r
+Taesoo Jun <steve.jun@samsung.com>\r
old mode 100644 (file)
new mode 100755 (executable)
index a7196e4..69d554f
@@ -14,6 +14,7 @@ SET(SRCS
        ss_noti.c
        ss_lowbat_handler.c
        ss_lowmem_handler.c
+       ss_pmon_handler.c
        ss_mmc_handler.c
        ss_usb_handler.c
        ss_ta_handler.c
@@ -42,8 +43,7 @@ pkg_check_modules(pkgs REQUIRED
        dlog
        syspopup-caller
        devman
-       devman_plugin
-       x11)
+       devman_plugin)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -77,3 +77,4 @@ INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/system_server.sh DESTINATION /etc/rc.d/init
 
 ADD_SUBDIRECTORY(restarter)
 ADD_SUBDIRECTORY(sys_event)
+ADD_SUBDIRECTORY(sys_device_noti)
diff --git a/LICENSE b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
index 7ccb5b5..ccbf311
--- a/LICENSE
+++ b/LICENSE
@@ -1,75 +1,75 @@
-Flora License
-
-Version 1.0, May, 2012
-
-http://www.tizenopensource.org/license
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Flora License to your work
-
-To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Flora License, Version 1.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.tizenopensource.org/license
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+Flora License\r
+\r
+Version 1.0, May, 2012\r
+\r
+http://www.tizenopensource.org/license\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, and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\r
+\r
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.\r
+\r
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\r
+\r
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\r
+\r
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\r
+\r
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\r
+\r
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\r
+\r
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.\r
+\r
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\r
+\r
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\r
+\r
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\r
+\r
+  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and\r
+\r
+  2. You must cause any modified files to carry prominent notices stating that You changed the files; and\r
+\r
+  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\r
+\r
+  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\r
+\r
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\r
+\r
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\r
+\r
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\r
+\r
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\r
+\r
+END OF TERMS AND CONDITIONS\r
+\r
+APPENDIX: How to apply the Flora License to your work\r
+\r
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Flora License, Version 1.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.tizenopensource.org/license\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
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index ad19656..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-system-server (0.1.51-67) unstable; urgency=low
-
-  * support battery err check
-  * Git: slp/pkgs/s/system-server
-  * Tag: system-server_0.1.51-67
-
- -- Jinkun Jang <jinkun.jang@samsung.com>  Mon, 19 Mar 2012 11:00:59 +0900
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index 8d1c8b6..0000000
+++ /dev/null
@@ -1 +0,0 @@
index cc5bfd5..bff6ad4 100755 (executable)
@@ -83,6 +83,8 @@ install: build
        # Add here commands to install the package into debian/tmp.
        $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 
+       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
+       ln -s ../init.d/system_server.sh $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S35system-server
        mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/
        ln -s ../init.d/system_server.sh $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S00system-server
 
index 0728a59..f449796 100644 (file)
@@ -1,31 +1,26 @@
 #!/bin/sh
 
-vconftool set -t int memory/Battery/Charger -1 -i
-vconftool set -t int memory/Battery/Status/Low -1 -i
-vconftool set -t int memory/Battery/Capacity -1 -i
-vconftool set -t int memory/Device/EarJackKey 0 -i
-vconftool set -t int db/system/timechange 0 -i
+vconftool set -t int memory/sysman/usbhost_status -1 -i
+vconftool set -t int memory/sysman/mmc -1 -i
+vconftool set -t int memory/sysman/earjack_key 0 -i
+
+vconftool set -t int memory/sysman/added_usb_storage 0 -i
+vconftool set -t int memory/sysman/removed_usb_storage 0 -i
+vconftool set -t int memory/sysman/charger_status -1 -i
+vconftool set -t int memory/sysman/charge_now -1 -i
+vconftool set -t int memory/sysman/battery_status_low -1 -i
+vconftool set -t int memory/sysman/battery_capacity -1 -i
+vconftool set -t int memory/sysman/usb_status -1 -i
+vconftool set -t int memory/sysman/earjack -1 -i
 vconftool set -t int memory/sysman/low_memory 1 -i
-vconftool set -t int memory/Connectivity/USB -1 -i
-vconftool set -t int memory/Device/mmc_format 0 -i
+vconftool set -t int memory/sysman/sliding_keyboard -1 -i
+vconftool set -t int memory/sysman/mmc_mount -1 -i
+vconftool set -t int memory/sysman/mmc_unmount -1 -i
+vconftool set -t int memory/sysman/mmc_format -1 -i
 
-vconftool set -t int memory/Device/Mmc -1 -i
-vconftool set -t int memory/Device/mmc_mount -1 -i
-vconftool set -t int memory/Device/mmc_unmount -1 -i
-vconftool set -t int memory/Device/mmc_format -1 -i
+vconftool set -t string memory/private/sysman/added_storage_uevent "" -i
+vconftool set -t string memory/private/sysman/removed_storage_uevent "" -i
 
-vconftool set -t int db/MainLCD/Backlight/Normal -1 -i
-vconftool set -t int memory/Device/EarJack -1 -i
-vconftool set -t int memory/Device/Cradle/Status -1 -i
-vconftool set -t int memory/Device/Sliding_keyboard -1 -i
-
-vconftool set -t int memory/Device/usbhost/added_storage 0 -i
-vconftool set -t int memory/Device/usbhost/removed_storage 0 -i
-
-vconftool set -t string memory/Device/usbhost/added_storage_uevent "" -i
-vconftool set -t string memory/Device/usbhost/removed_storage_uevent "" -i
-
-vconftool set -t int memory/Device/usbhost/connect -1 -i
 
 heynotitool set power_off_start
 
@@ -38,9 +33,12 @@ heynotitool set device_earjack_chgdet
 heynotitool set device_earkey_chgdet
 heynotitool set device_tvout_chgdet
 heynotitool set device_hdmi_chgdet
-heynotitool set device_cradle_chgdet
 heynotitool set device_charge_chgdet
 heynotitool set device_keyboard_chgdet
+heynotitool set device_keyboard_add
+heynotitool set device_keyboard_remove
+heynotitool set device_mouse_add
+heynotitool set device_mouse_remove
 
 mkdir -p /etc/udev/rules.d
 if ! [ -L /etc/udev/rules.d/91-system-server.rules ]; then
index 741c829..367079e 100644 (file)
@@ -34,8 +34,8 @@ enum {
 
 #define MMC_DEV                        "/dev/mmcblk"
 
-#define VCONFKEY_INTERNAL_ADDED_USB_STORAGE    "memory/Device/usbhost/added_storage_uevent"
-#define VCONFKEY_INTERNAL_REMOVED_USB_STORAGE  "memory/Device/usbhost/removed_storage_uevent"
+#define VCONFKEY_INTERNAL_ADDED_USB_STORAGE    "memory/private/sysman/added_storage_uevent"
+#define VCONFKEY_INTERNAL_REMOVED_USB_STORAGE  "memory/private/sysman/removed_storage_uevent"
 
 #define PREDEF_CALL                    "call"
 #define PREDEF_LOWMEM                  "lowmem"
old mode 100644 (file)
new mode 100755 (executable)
index 64f416a..570222c
@@ -1,6 +1,7 @@
+#sbs-git:slp/pkgs/s/system-server system-server 0.1.51 56e16bca39f96d6c8aed9ed3df2fea9b393801be
 Name:       system-server
 Summary:    System server
-Version:    0.1.51
+Version: 0.1.51
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Flora Software License
@@ -20,6 +21,8 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(syspopup-caller)
 BuildRequires:  pkgconfig(devman_plugin)
 BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(svi)
+BuildRequires:  pkgconfig(notification)
 
 %description
 Description: System server
@@ -36,33 +39,33 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d/
+ln -s %{_sysconfdir}/init.d/system_server.sh %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S35system-server
 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d/
 ln -s %{_sysconfdir}/init.d/system_server.sh %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S00system-server
 
-%post 
-
-vconftool set -t int memory/Battery/Charger -1 -i
-vconftool set -t int memory/Battery/Status/Low -1 -i
-vconftool set -t int memory/Battery/Capacity -1 -i
-vconftool set -t int memory/Device/EarJackKey 0 -i
-vconftool set -t int db/system/timechange 0 -i
+%post
+
+vconftool set -t int memory/sysman/usbhost_status -1 -i
+vconftool set -t int memory/sysman/mmc -1 -i
+vconftool set -t int memory/sysman/earjack_key 0 -i
+vconftool set -t int memory/sysman/added_usb_storage 0 -i
+vconftool set -t int memory/sysman/removed_usb_storage 0 -i
+vconftool set -t int memory/sysman/charger_status -1 -i
+vconftool set -t int memory/sysman/charge_now -1 -i
+vconftool set -t int memory/sysman/battery_status_low -1 -i
+vconftool set -t int memory/sysman/battery_capacity -1 -i
+vconftool set -t int memory/sysman/usb_status -1 -i
+vconftool set -t int memory/sysman/earjack -1 -i
 vconftool set -t int memory/sysman/low_memory 1 -i
-vconftool set -t int memory/Connectivity/USB -1 -i
-vconftool set -t int memory/Device/mmc_format 0 -i
-vconftool set -t int memory/Device/Sliding_keyboard -1 -i
-
-vconftool set -t int memory/Device/Mmc -1 -i
-vconftool set -t int db/MainLCD/Backlight/Normal -1 -i
-vconftool set -t int memory/Device/EarJack -1 -i
-vconftool set -t int memory/Device/Cradle/Status -1 -i
-
-vconftool set -t int memory/Device/usbhost/added_storage 0 -i
-vconftool set -t int memory/Device/usbhost/removed_storage 0 -i
+vconftool set -t int memory/sysman/sliding_keyboard -1 -i
+vconftool set -t int memory/sysman/mmc_mount -1 -i
+vconftool set -t int memory/sysman/mmc_unmount -1 -i
+vconftool set -t int memory/sysman/mmc_format -1 -i
 
-vconftool set -t string memory/Device/usbhost/added_storage_uevent "" -i
-vconftool set -t string memory/Device/usbhost/removed_storage_uevent "" -i
+vconftool set -t string memory/private/sysman/added_storage_uevent "" -i
+vconftool set -t string memory/private/sysman/removed_storage_uevent "" -u 5000 -i
 
-vconftool set -t int memory/Device/usbhost/connect -1 -i
 
 heynotitool set power_off_start
 
@@ -75,9 +78,17 @@ heynotitool set device_earjack_chgdet
 heynotitool set device_earkey_chgdet
 heynotitool set device_tvout_chgdet
 heynotitool set device_hdmi_chgdet
-heynotitool set device_cradle_chgdet
 heynotitool set device_charge_chgdet
 heynotitool set device_keyboard_chgdet
+heynotitool set device_keyboard_add
+heynotitool set device_keyboard_remove
+heynotitool set device_mouse_add
+heynotitool set device_mouse_remove
+heynotitool set device_unknown_usb_add
+heynotitool set device_unknown_usb_remove
+heynotitool set device_camera_add
+heynotitool set device_camera_remove
+
 
 mkdir -p /etc/udev/rules.d
 if ! [ -L /etc/udev/rules.d/91-system-server.rules ]; then
@@ -85,12 +96,14 @@ if ! [ -L /etc/udev/rules.d/91-system-server.rules ]; then
 fi
 
 
-%files 
+%files
 %{_bindir}/system_server
 %{_bindir}/restart
 %{_bindir}/movi_format.sh
 %{_bindir}/sys_event
+%{_bindir}/sys_device_noti
+%{_datadir}/system-server/sys_device_noti/batt_full_icon.png
 %{_datadir}/system-server/udev-rules/91-system-server.rules
 %{_sysconfdir}/rc.d/init.d/system_server.sh
+%{_sysconfdir}/rc.d/rc3.d/S35system-server
 %{_sysconfdir}/rc.d/rc5.d/S00system-server
-
diff --git a/ss_bs.c b/ss_bs.c
index e52ac80..3c8cc0f 100644 (file)
--- a/ss_bs.c
+++ b/ss_bs.c
@@ -31,7 +31,8 @@
 #define BSNOTI_DIR             "/opt/bs"
 #define BSNOTI_FILE            "curbs.log"
 #define BSNOTI_FULL_PATH       BSNOTI_DIR"/"BSNOTI_FILE
-#define CRASH_WORKER_PATH      "/usr/bin/crash-worker"
+
+#define CRASH_WORKER_PATH      "/usr/apps/org.tizen.crash-worker/bin/crash-worker"
 
 static int noti_fd;
 static int add_noti(void);
@@ -98,7 +99,7 @@ static void launch_crash_worker(void *data)
                                snprintf(args, sizeof(args), "%s %s",
                                         bsfile_name, bs_color);
                                PRT_TRACE("bsfile_name(size %d): %s\nargs: %s\n", i, bsfile_name, bs_color, args);
-                               ret = ss_launch_evenif_exist(CRASH_WORKER_PATH, args);
+                               ret = ss_launch_evenif_exist (CRASH_WORKER_PATH, args);
                                break;
                        }
                }
@@ -123,18 +124,18 @@ static Ecore_File_Monitor *bs_file_monitor;
 static Ecore_File_Monitor_Cb __bs_file_cb(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
 {
        switch (event) {
-               case ECORE_FILE_EVENT_DELETED_DIRECTORY:
-               case ECORE_FILE_EVENT_DELETED_SELF:
-                       if (0 > make_noti_file(BSNOTI_DIR, BSNOTI_FILE)) {
-                               launch_crash_worker((void *)path);
-                       }
-                       break;
-               case ECORE_FILE_EVENT_MODIFIED:
-               default:
+       case ECORE_FILE_EVENT_DELETED_DIRECTORY:
+       case ECORE_FILE_EVENT_DELETED_SELF:
+               if (0 > make_noti_file(BSNOTI_DIR, BSNOTI_FILE)) {
                        launch_crash_worker((void *)path);
-                       break;
+               }
+               break;
+       case ECORE_FILE_EVENT_MODIFIED:
+       default:
+               launch_crash_worker((void *)path);
+               break;
        }
-        
+
        return;
 }
 
@@ -144,12 +145,12 @@ int ss_bs_init(void)
                PRT_TRACE_ERR("make_noti_file() failed");
                launch_crash_worker((void *)BSNOTI_FULL_PATH);
        }
-                   
+
        if (0 == ecore_file_init()) {
                PRT_TRACE_ERR("ecore_file_init() failed");
                launch_crash_worker((void *)BSNOTI_FULL_PATH);
        }
-                           
+
        bs_file_monitor = ecore_file_monitor_add(BSNOTI_FULL_PATH,(void *) __bs_file_cb, NULL);
        if (!bs_file_monitor) {
                PRT_TRACE_ERR("ecore_file_monitor_add() failed");
index 38924c2..c9881ff 100644 (file)
 #include "ss_device_plugin.h"
 #include "ss_log.h"
 #include "include/ss_data.h"
+#include "vconf.h"
 
-#define DEFAULT_MAX_CPU_FREQ           12000000
-#define DEFAULT_MIN_CPU_FREQ           1000000
+#define DEFAULT_MAX_CPU_FREQ           1200000
+#define DEFAULT_MIN_CPU_FREQ           100000
+#define POWER_SAVING_CPUFREQ           800000
 
 static int max_cpu_freq_limit = -1;
 static int min_cpu_freq_limit = -1;
-static int cur_max_cpu_freq = INT_MIN;
-static int cur_min_cpu_freq = INT_MAX;
+static int cur_max_cpu_freq = INT_MAX;
+static int cur_min_cpu_freq = INT_MIN;
 
 static Eina_List *max_cpu_freq_list;
 static Eina_List *min_cpu_freq_list;
@@ -102,7 +104,7 @@ int release_max_frequency_action(int argc, char **argv)
                return -1;
        }
 
-       if (cur_max_cpu_freq == INT_MIN)
+       if (cur_max_cpu_freq == INT_MAX)
                cur_max_cpu_freq = max_cpu_freq_limit;
 
        r = __write_max_cpu_freq(cur_max_cpu_freq);
@@ -127,7 +129,7 @@ int release_min_frequency_action(int argc, char **argv)
                return -1;
        }
 
-       if (cur_min_cpu_freq == INT_MAX)
+       if (cur_min_cpu_freq == INT_MIN)
                cur_min_cpu_freq = min_cpu_freq_limit;
 
        r = __write_min_cpu_freq(cur_min_cpu_freq);
@@ -139,6 +141,74 @@ int release_min_frequency_action(int argc, char **argv)
        return 0;
 }
 
+static int power_saving_cb(keynode_t *key_nodes, void *data)
+{
+       int ret = -1;
+       int power_saving_stat = -1;
+       int power_saving_cpu_stat = -1;
+
+       power_saving_stat = vconf_keynode_get_bool(key_nodes);
+       if (power_saving_stat == 1) {
+               vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &power_saving_cpu_stat);
+               if (power_saving_cpu_stat == 1) {
+                       ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
+                       if (ret < 0) {
+                               PRT_TRACE_ERR("Add entry failed");
+                               return -1;
+                       }
+               }
+       } else {
+               ret = __remove_entry_from_max_cpu_freq_list(getpid());
+               if (ret < 0) {
+                       PRT_TRACE_ERR("Remove entry failed");
+                       return -1;
+               }
+               if (cur_max_cpu_freq == INT_MIN)
+                       cur_max_cpu_freq = max_cpu_freq_limit;
+       }
+       ret = __write_max_cpu_freq(cur_max_cpu_freq);
+       if (ret < 0) {
+               PRT_TRACE_ERR("Write failed");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int power_saving_cpu_cb(keynode_t *key_nodes, void *data)
+{
+       int ret = -1;
+       int power_saving_stat = -1;
+       int power_saving_cpu_stat = -1;
+
+       vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, &power_saving_stat);
+       if (power_saving_stat == 1) {
+               power_saving_cpu_stat = vconf_keynode_get_bool(key_nodes);
+               if (power_saving_cpu_stat == 1) {
+                       ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
+                       if (ret < 0) {
+                               PRT_TRACE_ERR("Add entry failed");
+                               return -1;
+                       }
+               } else {
+                       ret = __remove_entry_from_max_cpu_freq_list(getpid());
+                       if (ret < 0) {
+                               PRT_TRACE_ERR("Remove entry failed");
+                               return -1;
+                       }
+                       if (cur_max_cpu_freq == INT_MAX)
+                               cur_max_cpu_freq = max_cpu_freq_limit;
+               }
+               ret = __write_max_cpu_freq(cur_max_cpu_freq);
+               if (ret < 0) {
+                       PRT_TRACE_ERR("Write failed");
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
 int ss_cpu_handler_init(void)
 {
        __set_freq_limit();
@@ -148,6 +218,9 @@ int ss_cpu_handler_init(void)
        ss_action_entry_add_internal(PREDEF_RELEASE_MAX_FREQUENCY, release_max_frequency_action, NULL, NULL);
        ss_action_entry_add_internal(PREDEF_RELEASE_MIN_FREQUENCY, release_min_frequency_action, NULL, NULL);
 
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, (void *)power_saving_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, (void *)power_saving_cpu_cb, NULL);
+
        return 0;
 }
 
@@ -166,6 +239,25 @@ static void __set_freq_limit()
                PRT_TRACE_ERR("get cpufreq cpuinfo min readerror: %s", strerror(errno));
                min_cpu_freq_limit = DEFAULT_MIN_CPU_FREQ;
        }
+
+       /* check power saving */
+       int power_saving_stat = -1;
+       int power_saving_cpu_stat = -1;
+       vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, &power_saving_stat);
+       if (power_saving_stat == 1)
+               vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &power_saving_cpu_stat);
+       if (power_saving_cpu_stat == 1) {
+               ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
+               if (ret < 0) {
+                       PRT_TRACE_ERR("Add entry failed");
+                       return;
+               }
+               ret = __write_max_cpu_freq(cur_max_cpu_freq);
+               if (ret < 0) {
+                       PRT_TRACE_ERR("Write entry failed");
+                       return;
+               }
+       }
 }
 
 static int __is_entry_enable(int pid)
@@ -186,7 +278,7 @@ static int __remove_entry_from_max_cpu_freq_list(int pid)
        Eina_List *tmp_next;
        struct cpu_freq_entry *entry;
 
-       cur_max_cpu_freq = INT_MIN;
+       cur_max_cpu_freq = INT_MAX;
 
        EINA_LIST_FOREACH_SAFE(max_cpu_freq_list, tmp, tmp_next, entry) {
                if (entry != NULL) {
@@ -196,7 +288,7 @@ static int __remove_entry_from_max_cpu_freq_list(int pid)
                                continue;
                        }
 
-                       if (entry->freq > cur_max_cpu_freq) {
+                       if (entry->freq < cur_max_cpu_freq) {
                                cur_max_cpu_freq = entry->freq;
                        }
                }
@@ -211,7 +303,7 @@ static int __remove_entry_from_min_cpu_freq_list(int pid)
        Eina_List *tmp_next;
        struct cpu_freq_entry *entry;
 
-       cur_min_cpu_freq = INT_MAX;
+       cur_min_cpu_freq = INT_MIN;
 
        EINA_LIST_FOREACH_SAFE(min_cpu_freq_list, tmp, tmp_next, entry) {
                if (entry != NULL) {
@@ -221,7 +313,7 @@ static int __remove_entry_from_min_cpu_freq_list(int pid)
                                continue;
                        }
 
-                       if (entry->freq < cur_min_cpu_freq) {
+                       if (entry->freq > cur_min_cpu_freq) {
                                cur_min_cpu_freq = entry->freq;
                        }
 
@@ -241,7 +333,7 @@ static int __add_entry_to_max_cpu_freq_list(int pid, int freq)
                PRT_TRACE_ERR("Remove duplicated entry failed");
        }
 
-       if (freq > cur_max_cpu_freq) {
+       if (freq < cur_max_cpu_freq) {
                cur_max_cpu_freq = freq;
        }
 
@@ -273,7 +365,7 @@ static int __add_entry_to_min_cpu_freq_list(int pid, int freq)
                PRT_TRACE_ERR("Remove duplicated entry failed");
        }
 
-       if (freq < cur_min_cpu_freq) {
+       if (freq > cur_min_cpu_freq) {
                cur_min_cpu_freq = freq;
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 0f9463e..230d496
@@ -26,6 +26,9 @@
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include <syspopup_caller.h>
+#include <aul.h>
+#include <bundle.h>
+#include <dirent.h>
 
 #include "ss_queue.h"
 #include "ss_log.h"
 #include "ss_device_plugin.h"
 #include "ss_noti.h"
 #include "include/ss_data.h"
+#include "sys_device_noti/sys_device_noti.h"
 
-#define BUFF_MAX                                       255
-#define SYS_CLASS_INPUT                                        "/sys/class/input"
+#define BUFF_MAX               255
+#define SYS_CLASS_INPUT                "/sys/class/input"
 
 struct input_event {
        long dummy[2];
@@ -54,8 +58,13 @@ enum snd_jack_types {
        SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,
 };
 
+
+static int input_device_number;
+
 static void usb_chgdet_cb(struct ss_main_data *ad)
 {
+       int val = -1;
+       char params[BUFF_MAX];
        PRT_TRACE("jack - usb changed\n");
        pm_change_state(LCD_NORMAL);
        /* check charging now */
@@ -63,6 +72,14 @@ static void usb_chgdet_cb(struct ss_main_data *ad)
        /* check current battery level */
        ss_lowbat_monitor(NULL);
        ss_action_entry_call_internal(PREDEF_USBCON, 0);
+
+       if (plugin_intf->OEM_sys_get_jack_usb_online(&val)==0) {
+               if (val==1) {
+                       snprintf(params, sizeof(params), "%d", CB_NOTI_BATT_CHARGE);
+                       ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
+                       PRT_TRACE("usb device notification");
+               }
+       }
 }
 
 static void ta_chgdet_cb(struct ss_main_data *ad)
@@ -77,8 +94,10 @@ static void ta_chgdet_cb(struct ss_main_data *ad)
        int val = -1;
        int ret = -1;
        int bat_state = VCONFKEY_SYSMAN_BAT_NORMAL;
+       char params[BUFF_MAX];
 
        if (plugin_intf->OEM_sys_get_jack_charger_online(&val) == 0) {
+               vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS, val);
                if (val == 0) {
                        pm_unlock_state(LCD_OFF, STAY_CUR_STATE);
 
@@ -96,7 +115,10 @@ static void ta_chgdet_cb(struct ss_main_data *ad)
                        }
                } else {
                        pm_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
-       }
+                       snprintf(params, sizeof(params), "%d", CB_NOTI_BATT_CHARGE);
+                       ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
+                       PRT_TRACE("ta device notification");
+               }
        }
        else
                PRT_TRACE_ERR("failed to get ta status\n");
@@ -126,12 +148,13 @@ static void tvout_chgdet_cb(struct ss_main_data *ad)
 static void hdmi_chgdet_cb(struct ss_main_data *ad)
 {
        PRT_TRACE("jack - hdmi changed\n");
+       int val;
        pm_change_state(LCD_NORMAL);
-}
-
-static void cradle_chgdet_cb(struct ss_main_data *ad)
-{
-       PRT_TRACE("jack - cradle changed\n");
+       if (plugin_intf->OEM_sys_get_jack_hdmi_online(&val) == 0)
+               if(val == 1)
+                       pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
+               else
+                       pm_unlock_state(LCD_NORMAL, PM_SLEEP_MARGIN);
 }
 
 static void keyboard_chgdet_cb(struct ss_main_data *ad)
@@ -150,6 +173,187 @@ static void keyboard_chgdet_cb(struct ss_main_data *ad)
        }
 }
 
+static int show_tickernoti(char* msg)
+{
+       PRT_TRACE("show tickernoti : %s\n", msg);
+       int ret = -1;
+
+       bundle *b = NULL;
+
+       b = bundle_create();
+       if (!b) {
+               PRT_TRACE_ERR("FAIL: bundle_create()\n");
+               return -1;
+       }
+
+       ret = bundle_add(b, "0", "info");   /* "0" means tickernoti style */
+       if (ret != 0) {
+               PRT_TRACE_ERR("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b))
+                       PRT_TRACE_ERR("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = bundle_add(b, "1", dgettext("system-server", msg)); /* "1" means popup text */
+       if (ret != 0) {
+               PRT_TRACE_ERR("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b))
+                       PRT_TRACE_ERR("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = bundle_add(b, "2", "0");  /* "2" means orientation of tickernoti */
+       if (ret != 0) {
+               PRT_TRACE_ERR("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b))
+                       PRT_TRACE_ERR("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = bundle_add(b, "3", "3");  /* "3" means timeout(second) of tickernoti */
+       if (ret != 0) {
+               PRT_TRACE_ERR("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b))
+                       PRT_TRACE_ERR("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = syspopup_launch("tickernoti-syspopup", b);
+       if (ret != 0)
+               PRT_TRACE_ERR("FAIL: syspopup_launch()\n");
+
+       if (0 != bundle_free(b))
+               PRT_TRACE_ERR("FAIL: bundle_free()\n");
+
+       return 0;
+}
+
+// TO DO - multi language
+static void keyboard_add_cb(struct ss_main_data *ad)
+{
+       pm_change_state(LCD_NORMAL);
+       show_tickernoti("Keyboard connected");
+       input_device_number++;
+       PRT_TRACE("keyboard added (total input device : %d)",input_device_number);
+}
+
+static void keyboard_remove_cb(struct ss_main_data *ad)
+{
+       pm_change_state(LCD_NORMAL);
+       show_tickernoti("Keyboard removed safely");
+       if (input_device_number > 0)
+               input_device_number--;
+       PRT_TRACE("keyboard removed (total input device : %d)",input_device_number);
+}
+
+static void mouse_add_cb(struct ss_main_data *ad)
+{
+       pm_change_state(LCD_NORMAL);
+       show_tickernoti("Mouse connected");
+       input_device_number++;
+       PRT_TRACE("mouse added (total input device : %d)",input_device_number);
+}
+
+static void mouse_remove_cb(struct ss_main_data *ad)
+{
+       pm_change_state(LCD_NORMAL);
+       show_tickernoti("Mouse removed safely");
+       if (input_device_number > 0)
+               input_device_number--;
+       PRT_TRACE("Mouse removed (total input device : %d)",input_device_number);
+}
+
+static void camera_add_cb(struct ss_main_data *ad)
+{
+       int ret = -1;
+       pm_change_state(LCD_NORMAL);
+       show_tickernoti("Camera connected");
+
+       DIR *dp;
+       struct dirent *dir;
+       struct stat stat;
+       char buf[255] = "unknown_camera";
+
+       if ((dp = opendir("/tmp/camera")) == NULL) {
+               PRT_TRACE_ERR("Can not open directory\n");
+               return -1;
+       }
+       chdir("/tmp/camera");
+
+       while (dir = readdir(dp)) {
+               memset(&stat, 0, sizeof(struct stat));
+               lstat(dir->d_name, &stat);
+               if (S_ISDIR(stat.st_mode) || S_ISLNK(stat.st_mode)) {
+                       if (strncmp(".", dir->d_name, 1) == 0
+                                       || strncmp("..", dir->d_name, 2) == 0)
+                               continue;
+                       snprintf(buf, 255, "%s", dir->d_name);
+               }
+       }
+       closedir(dp);
+
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "camera_add");
+       bundle_add(b, "device_name", buf);
+
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               PRT_TRACE_EM("popup lauch failed\n");
+       }
+       bundle_free(b);
+       PRT_TRACE("Camera cannected");
+}
+
+static void camera_remove_cb(struct ss_main_data *ad)
+{
+       int ret = -1;
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "camera_remove");
+
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               PRT_TRACE_EM("popup lauch failed\n");
+       }
+       bundle_free(b);
+       PRT_TRACE("Camera removed");
+}
+
+
+static void unknown_usb_add_cb(struct ss_main_data *ad)
+{
+       int ret = -1;
+       pm_change_state(LCD_NORMAL);
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "unknown_add");
+
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               PRT_TRACE_EM("popup lauch failed\n");
+       }
+       bundle_free(b);
+       PRT_TRACE("unknown usb device added");
+}
+
+static void unknown_usb_remove_cb(struct ss_main_data *ad)
+{
+       int ret = -1;
+       pm_change_state(LCD_NORMAL);
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "unknown_remove");
+
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               PRT_TRACE_EM("popup lauch failed\n");
+       }
+       bundle_free(b);
+       PRT_TRACE("unknown usb device added");
+}
+
+
 static void mmc_chgdet_cb(void *data)
 {
        if (data == NULL) {
@@ -169,18 +373,33 @@ static void ums_unmount_cb(void *data)
 static void charge_cb(struct ss_main_data *ad)
 {
        int val = -1;
-
+       char params[BUFF_MAX];
+       static int bat_full_noti = 0;
+       ss_lowbat_monitor(NULL);
        if (plugin_intf->OEM_sys_get_battery_health(&val) == 0) {
-               if (val != BATTERY_GOOD) {
+               if (val==BATTERY_OVERHEAT || val==BATTERY_COLD) {
                        PRT_TRACE_ERR("Battery health status is not good (%d)", val);
                        ss_action_entry_call_internal(PREDEF_LOWBAT, 1, CHARGE_ERROR_ACT);
                        return;
                }
        } else {
                PRT_TRACE_ERR("failed to get battery health status");
-}
-
-       ss_action_entry_call_internal(PREDEF_LOWBAT, 1, CHARGE_CHECK_ACT);
+       }
+       plugin_intf->OEM_sys_get_battery_charge_full(&val);
+       if (val==0) {
+               if (bat_full_noti==1) {
+                       snprintf(params, sizeof(params), "%d %d", CB_NOTI_BATT_FULL, CB_NOTI_OFF);
+                       ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
+               }
+               bat_full_noti = 0;
+       } else {
+               if (val==1 && bat_full_noti==0) {
+                       bat_full_noti = 1;
+                       PRT_TRACE("battery full noti");
+                       snprintf(params, sizeof(params), "%d %d", CB_NOTI_BATT_FULL, CB_NOTI_ON);
+                       ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
+               }
+       }
 }
 
 static void __usb_storage_cb(keynode_t *key, void *data)
@@ -189,11 +408,12 @@ static void __usb_storage_cb(keynode_t *key, void *data)
 
        if (data == NULL) {
                PRT_TRACE("USB Storage removed");
-               vconf_value = vconf_get_str(VCONFKEY_INTERNAL_REMOVED_USB_STORAGE);
+               vconf_value = vconf_get_str(VCONFKEY_INTERNAL_REMOVED_USB_STORAGE);
                ss_action_entry_call_internal(PREDEF_USB_STORAGE_REMOVE, 1, vconf_value);
        } else {
                PRT_TRACE("USB Storage added");
-               vconf_value = vconf_get_str(VCONFKEY_INTERNAL_ADDED_USB_STORAGE);
+               show_tickernoti("Mass storage enabled");
+               vconf_value = vconf_get_str(VCONFKEY_INTERNAL_ADDED_USB_STORAGE);
                ss_action_entry_call_internal(PREDEF_USB_STORAGE_ADD, 1, vconf_value);
        }
 }
@@ -207,8 +427,15 @@ int ss_device_change_init(struct ss_main_data *ad)
        ss_noti_add("device_earkey_chgdet", (void *)earkey_chgdet_cb, (void *)ad);
        ss_noti_add("device_tvout_chgdet", (void *)tvout_chgdet_cb, (void *)ad);
        ss_noti_add("device_hdmi_chgdet", (void *)hdmi_chgdet_cb, (void *)ad);
-       ss_noti_add("device_cradle_chgdet", (void *)cradle_chgdet_cb, (void *)ad);
        ss_noti_add("device_keyboard_chgdet", (void *)keyboard_chgdet_cb, (void *)ad);
+       ss_noti_add("device_keyboard_add", (void *)keyboard_add_cb, (void *)ad);
+       ss_noti_add("device_keyboard_remove", (void *)keyboard_remove_cb, (void *)ad);
+       ss_noti_add("device_mouse_add", (void *)mouse_add_cb, (void *)ad);
+       ss_noti_add("device_mouse_remove", (void *)mouse_remove_cb, (void *)ad);
+       ss_noti_add("device_camera_add", (void *)camera_add_cb, (void *)ad);
+       ss_noti_add("device_camera_remove", (void *)camera_remove_cb, (void *)ad);
+       ss_noti_add("device_unknown_usb_add", (void *)unknown_usb_add_cb, (void *)ad);
+       ss_noti_add("device_unknown_usb_remove", (void *)unknown_usb_remove_cb, (void *)ad);
        ss_noti_add("mmcblk_add", (void *)mmc_chgdet_cb, (void *)1);
        ss_noti_add("mmcblk_remove", (void *)mmc_chgdet_cb, NULL);
 
@@ -223,7 +450,10 @@ int ss_device_change_init(struct ss_main_data *ad)
                PRT_TRACE_ERR("Vconf notify key chaneged failed: KEY(%s)", VCONFKEY_SYSMAN_REMOVED_USB_STORAGE);
        }
 
-       cradle_chgdet_cb(NULL);
+       /* set initial state for devices */
+       input_device_number = 0;
+       keyboard_chgdet_cb(NULL);
+       hdmi_chgdet_cb(NULL);
 
        return 0;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 7857472..84f93d8
 #include "ss_device_plugin.h"
 #include "include/ss_data.h"
 
-#define BAT_MON_INTERVAL 30
-#define BAT_MON_INTERVAL_MIN 2
+#define BAT_MON_INTERVAL               30
+#define BAT_MON_INTERVAL_MIN           2
 
-#define BATTERY_CHARGING 65535
-#define BATTERY_UNKNOWN         -1
-#define        BATTERY_NORMAL 100
-#define        BATTERY_WARNING_LOW 15
-#define        BATTERY_CRITICAL_LOW 5
-#define        BATTERY_POWER_OFF 1
-#define        BATTERY_REAL_POWER_OFF 0
+#define BATTERY_CHARGING               65535
+#define BATTERY_UNKNOWN                        -1
+#define        BATTERY_FULL                    100
+#define        BATTERY_NORMAL                  100
+#define        BATTERY_WARNING_LOW             15
+#define        BATTERY_CRITICAL_LOW            5
+#define        BATTERY_POWER_OFF               1
+#define        BATTERY_REAL_POWER_OFF  0
 
-#define MAX_BATTERY_ERROR 10
-#define RESET_RETRY_COUNT 3
+#define MAX_BATTERY_ERROR              10
+#define RESET_RETRY_COUNT              3
 
-#define LOWBAT_EXEC_PATH       PREFIX"/bin/lowbatt-popup"
+#define LOWBAT_EXEC_PATH               PREFIX"/bin/lowbatt-popup"
 
 static int battery_level_table[] = {
        5,                      /* BATTERY_LEVEL0 */
@@ -74,11 +75,11 @@ static int battery_critical_low_act(void *ad);
 static int battery_power_off_act(void *ad);
 
 static struct lowbat_process_entry lpe[] = {
-       {BATTERY_NORMAL,                BATTERY_WARNING_LOW,    battery_warning_low_act},
-       {BATTERY_WARNING_LOW,   BATTERY_CRITICAL_LOW,   battery_critical_low_act},
+       {BATTERY_NORMAL, BATTERY_WARNING_LOW, battery_warning_low_act},
+       {BATTERY_WARNING_LOW, BATTERY_CRITICAL_LOW, battery_critical_low_act},
        {BATTERY_CRITICAL_LOW,  BATTERY_POWER_OFF,              battery_critical_low_act},
        {BATTERY_POWER_OFF,             BATTERY_REAL_POWER_OFF, battery_power_off_act},
-       {BATTERY_NORMAL,                BATTERY_CRITICAL_LOW,   battery_critical_low_act},
+       {BATTERY_NORMAL, BATTERY_CRITICAL_LOW, battery_critical_low_act},
        {BATTERY_WARNING_LOW,   BATTERY_POWER_OFF,              battery_critical_low_act},
        {BATTERY_CRITICAL_LOW,  BATTERY_REAL_POWER_OFF, battery_power_off_act},
        {BATTERY_NORMAL,                BATTERY_POWER_OFF,              battery_critical_low_act},
@@ -146,6 +147,7 @@ static int lowbat_process(int bat_percent, void *ad)
        int new_bat_capacity;
        int new_bat_state;
        int vconf_state = -1;
+       int bat_full = -1;
        int i, ret = 0;
 
        new_bat_capacity = bat_percent;
@@ -162,7 +164,11 @@ static int lowbat_process(int bat_percent, void *ad)
                return -1;
        }
 
-       if (new_bat_capacity <= BATTERY_POWER_OFF) {
+       if (new_bat_capacity <= BATTERY_REAL_POWER_OFF) {
+               new_bat_state = BATTERY_REAL_POWER_OFF;
+               if (vconf_state != VCONFKEY_SYSMAN_BAT_POWER_OFF)
+                       ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_POWER_OFF);
+       } else if (new_bat_capacity <= BATTERY_POWER_OFF) {
                new_bat_state = BATTERY_POWER_OFF;
                if (vconf_state != VCONFKEY_SYSMAN_BAT_POWER_OFF)
                        ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_POWER_OFF);
@@ -176,8 +182,19 @@ static int lowbat_process(int bat_percent, void *ad)
                        ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_WARNING_LOW);
        } else {
                new_bat_state = BATTERY_NORMAL;
-               if (vconf_state != VCONFKEY_SYSMAN_BAT_NORMAL)
-                       ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_NORMAL);
+               if (new_bat_capacity == BATTERY_FULL) {
+                       plugin_intf->OEM_sys_get_battery_charge_full(&bat_full);
+                       if (bat_full == 1) {
+                               if (vconf_state != VCONFKEY_SYSMAN_BAT_FULL)
+                               ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_FULL);
+                       } else {
+                               if (vconf_state != VCONFKEY_SYSMAN_BAT_NORMAL)
+                                       ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_NORMAL);
+                       }
+               } else {
+                       if (vconf_state != VCONFKEY_SYSMAN_BAT_NORMAL)
+                               ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_NORMAL);
+               }
        }
 
        if(ret < 0)
index d650ff5..960190a 100644 (file)
@@ -254,7 +254,7 @@ int ss_lowmem_init(struct ss_main_data *ad)
                return -1;
        }
 
-       oom_timer=NULL;
+       oom_timer = NULL;
        ecore_main_fd_handler_add(lowmem_fd, ECORE_FD_READ, lowmem_cb, ad, NULL,
                                  NULL);
        if (set_threshold() < 0) {
index 7a32da4..373514f 100644 (file)
--- a/ss_main.c
+++ b/ss_main.c
 #include <stdio.h>
 #include <fcntl.h>
 #include <heynoti.h>
-#include <TapiCommon.h>
 
 #include "ss_log.h"
 #include "ss_core.h"
 #include "ss_sig_handler.h"
 #include "ss_device_handler.h"
+#include "ss_pmon_handler.h"
 #include "ss_sysnoti.h"
 #include "ss_noti.h"
 #include "ss_queue.h"
@@ -62,18 +62,6 @@ static void system_server_init(struct ss_main_data *ad)
                exit (-1);
        }
 
-       /* telephony initialize */
-       int ret = 0;
-       ret = tel_init();
-       if (ret != TAPI_API_SUCCESS) {
-               PRT_TRACE_ERR("tapi init error : [0x%x]", ret);
-       }
-       /* Register Telephony Client */
-       ret = tel_register_app_name("slp.system.server");
-       if (ret != TAPI_API_SUCCESS) {
-               PRT_TRACE_ERR("tapi app register error : [0x%x]", ret);
-       }
-
        ad->sysnoti_fd = ss_sysnoti_init();
        if (ss_noti_init() < 0)
                PRT_TRACE_ERR("init noti error");
@@ -90,6 +78,7 @@ static void system_server_init(struct ss_main_data *ad)
        ss_lowbat_init(ad);
        ss_usb_init();
        ss_ta_init();
+       ss_pmon_init(ad);
        ss_device_change_init(ad);
        ss_mmc_init();
        ss_bs_init();
index 9ee6eb3..e8f8c79 100644 (file)
@@ -94,18 +94,6 @@ int get_mmcblk_num()
        return -1;
 }
 
-static int ss_mmc_format_tmp(keynode_t *key_nodes, void *data)
-{
-       PRT_TRACE_ERR("mmc_format called");
-       if (vconf_keynode_get_int(key_nodes) == 1) {
-               PRT_TRACE_ERR("format start");
-               device_set_property(DEVTYPE_MMC, MMC_PROP_FORMAT, 0);
-
-       }
-
-       return 0;
-}
-
 static int ss_mmc_format(keynode_t *key_nodes, void *data)
 {
        PRT_TRACE_ERR("mmc format called");
@@ -148,9 +136,6 @@ int ss_mmc_init()
        /* mmc card mount */
        ss_mmc_inserted();
 
-       vconf_notify_key_changed("memory/mmc/format", (void *)ss_mmc_format_tmp,
-                                NULL);
-
        ss_action_entry_add_internal(PREDEF_MOUNT_MMC, ss_mmc_inserted, NULL,
                                     NULL);
        ss_action_entry_add_internal(PREDEF_UNMOUNT_MMC, ss_mmc_unmounted, NULL,
@@ -192,7 +177,7 @@ int ss_mmc_inserted()
        snprintf(buf, sizeof(buf), "%s%d", MMC_DEV, blk_num);
        if (mount
            (buf, MMC_MOUNT_POINT, "vfat", 0,
-            "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed")
+            "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed,smackfsroot=*,smackfsdef=*")
            == 0) {
                PRT_DBG("Mounted mmc card\n");
                vconf_set_int(VCONFKEY_SYSMAN_MMC_STATUS,
@@ -206,7 +191,7 @@ int ss_mmc_inserted()
                snprintf(buf, sizeof(buf), "%s%dp1", MMC_DEV, blk_num);
                if ((ret =
                     mount(buf, MMC_MOUNT_POINT, "vfat", 0,
-                          "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed"))
+                          "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed,smackfsroot=*,smackfsdef=*"))
                    == 0) {
                        PRT_DBG("Mounted mmc card partition 1(%s)\n", buf);
                        vconf_set_int(VCONFKEY_SYSMAN_MMC_STATUS,
index cdb2122..4989b7a 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-#include "ss_log.h"
-#include "ss_launch.h"
 
-#include <sys/types.h>
-#include <sys/stat.h>
+
+#include <sysman.h>
 #include <fcntl.h>
 #include <assert.h>
 #include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 
-#define PMON_DEV_NODE "/dev/pmon"
-#define PMON_PERMANENT_DIR "/tmp/permanent"
+#include "ss_device_plugin.h"
+#include "ss_log.h"
+#include "ss_launch.h"
+#include "include/ss_data.h"
+
+#define PMON_PERMANENT_DIR     "/tmp/permanent"
 
 static int pmon_fd = -1;
 
@@ -38,8 +42,6 @@ static int replace_char(int size, char *t)
        return 0;
 }
 
-#define PERNAMENT_DIR  "/tmp/permanent"
-
 static char *pmon_get_permanent_pname(int pid)
 {
        int fd;
@@ -47,7 +49,7 @@ static char *pmon_get_permanent_pname(int pid)
        struct stat st;
        char *cmdline = NULL;
 
-       snprintf(buf, sizeof(buf), "%s/%d", PERNAMENT_DIR, pid);
+       snprintf(buf, sizeof(buf), "%s/%d", PMON_PERMANENT_DIR, pid);
        fd = open(buf, O_RDONLY);
        if (fd == -1) {
                PRT_TRACE_ERR("file open error");
@@ -107,14 +109,12 @@ static int pmon_process(unsigned int pid, void *ad)
                                char filepath[PATH_MAX];
                                size_t cnt;
 
-                               if (access("/tmp/permanent", R_OK) < 0) {
-                                       PRT_TRACE
-                                           ("no predefined matrix dir = /tmp/permanent, so created");
-                                       mkdir("/tmp/permanent", 0777);
+                               if (access(PMON_PERMANENT_DIR, R_OK) < 0) {
+                                       PRT_TRACE("no predefined matrix dir = %s, so created", PMON_PERMANENT_DIR);
+                                       mkdir(PMON_PERMANENT_DIR, 0777);
                                }
 
-                               snprintf(filepath, sizeof(filepath),
-                                        "/tmp/permanent/%d", pid);
+                               snprintf(filepath, sizeof(filepath), "%s/%d", PMON_PERMANENT_DIR, pid);
                                fd = open(filepath, O_RDONLY);
                                if (fd == -1) {
                                        PRT_TRACE("Failed to open");
@@ -129,8 +129,7 @@ static int pmon_process(unsigned int pid, void *ad)
                                        return -1;
                                }
 
-                               snprintf(filepath, sizeof(filepath), "%s/%d",
-                                        "/tmp/permanent", new_pid);
+                               snprintf(filepath, sizeof(filepath), "%s/%d", PMON_PERMANENT_DIR, new_pid);
 
                                fd = open(filepath, O_CREAT | O_WRONLY, 0644);
                                if (fd == -1) {
@@ -145,16 +144,9 @@ static int pmon_process(unsigned int pid, void *ad)
                                }
                                close(fd);
 
-                               fd = open("/sys/class/pmon/mp_pnp", O_WRONLY);
-
-                               if (fd == -1) {
-                                       PRT_TRACE("Failed to open");
-                                       return -1;
+                               if (0 > plugin_intf->OEM_sys_set_process_monitor_mp_pnp(new_pid)) {
+                                       PRT_TRACE_ERR("Write new pid failed");
                                }
-
-                               write(fd, &new_pid, sizeof(int));
-
-                               close(fd);
                                PRT_TRACE("[Process MON] %d ", new_pid);
 
                                FILE *fp;
@@ -216,7 +208,14 @@ static int pmon_cb(void *data, Ecore_Fd_Handler * fd_handler)
 
 int ss_pmon_init(struct ss_main_data *ad)
 {
-       pmon_fd = open(PMON_DEV_NODE, O_RDONLY);
+       char pmon_dev_node[PATH_MAX];
+
+       if (0 > plugin_intf->OEM_sys_get_process_monitor_node(pmon_dev_node)) {
+               PRT_TRACE_ERR("ss_pmon_init get dev node path failed");
+               return -1;
+       }
+
+       pmon_fd = open(pmon_dev_node, O_RDONLY);
        if (pmon_fd < 0) {
                PRT_TRACE_ERR("ss_pmon_init fd open failed");
                return -1;
index a1c0fac..aa29c47 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
+#ifndef __SS_PMON_HANDLER_H__
 #define __SS_PMON_HANDLER_H__
 
 #include "include/ss_data.h"
index e5ece31..84899cd 100644 (file)
 #include <sysman.h>
 #include <vconf.h>
 #include <pmapi.h>
-#include <ITapiPower.h>
+#include <ITapiModem.h>
 #include <TelPower.h>
-#include <TapiEvent.h>
-#include <TapiCommon.h>
+#include <tapi_event.h>
+#include <tapi_common.h>
 #include <syspopup_caller.h>
 #include <sys/reboot.h>
 #include <sys/time.h>
 #include "ss_procmgr.h"
 #include "include/ss_data.h"
 
-#define PREDEFINE_SO_DIR       PREFIX"/lib/ss_predefine/"
+#define PREDEFINE_SO_DIR                       PREFIX"/lib/ss_predefine/"
 
-#define CALL_EXEC_PATH         PREFIX"/bin/call"
-#define LOWMEM_EXEC_PATH       PREFIX"/bin/lowmem-popup"
-#define LOWBAT_EXEC_PATH       PREFIX"/bin/lowbatt-popup"
-#define USBCON_EXEC_PATH       PREFIX"/bin/usb_setting"
-#define TVOUT_EXEC_PATH                PREFIX"/bin/tvout-selector"
-#define PWROFF_EXEC_PATH       PREFIX"/bin/poweroff-popup"
-#define MEMPS_EXEC_PATH        PREFIX"/bin/memps"
+#define CALL_EXEC_PATH                         PREFIX"/bin/call"
+#define LOWMEM_EXEC_PATH                       PREFIX"/bin/lowmem-popup"
+#define LOWBAT_EXEC_PATH                       PREFIX"/bin/lowbatt-popup"
+#define USBCON_EXEC_PATH                       PREFIX"/bin/usb_setting"
+#define TVOUT_EXEC_PATH                                PREFIX"/bin/tvout-selector"
+#define PWROFF_EXEC_PATH                       PREFIX"/bin/poweroff-popup"
+#define MEMPS_EXEC_PATH                                PREFIX"/bin/memps"
 
 /* wait for 5 sec as victim process be dead */
-#define WAITING_INTERVAL       5
+#define WAITING_INTERVAL                       5
 
-#define TVOUT_X_BIN            "/usr/bin/xberc"
-#define TVOUT_FLAG             0x00000001
-#define MEMPS_LOG_FILE         "/var/log/memps"
-#define MAX_RETRY              2
+#define TVOUT_X_BIN                            "/usr/bin/xberc"
+#define TVOUT_FLAG                             0x00000001
+#define MEMPS_LOG_FILE                         "/var/log/memps"
+#define MAX_RETRY                              2
 
-#define POWEROFF_DURATION              2
-#define POWEROFF_ANIMATION_PATH                "/usr/bin/boot-animation"
-#define POWEROFF_NOTI_NAME                     "power_off_start"
+#define POWEROFF_DURATION                      2
+#define POWEROFF_ANIMATION_PATH                        "/usr/bin/boot-animation"
+#define POWEROFF_NOTI_NAME                     "power_off_start"
+
+#define WM_READY_PATH                          "/tmp/.wm_ready"
 
-#define VCONFKEY_TESTMODE_LOW_BATT_POPUP       "db/testmode/low_batt_popup"
 #define LOWBAT_OPT_WARNING             1
 #define LOWBAT_OPT_POWEROFF            2
 #define LOWBAT_OPT_CHARGEERR   3
@@ -73,11 +73,12 @@ static Ecore_Timer *lowbat_popup_id = NULL;
 static int lowbat_popup_option = 0;
 
 static struct timeval tv_start_poweroff;
-static void powerdown_ap(TelTapiEvent_t *event, void *data);
+static void powerdown_ap(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
 
 static int ss_flags = 0;
 
-static unsigned int power_subscription_id = 0;
+static Ecore_Timer *poweroff_timer_id = NULL;
+static TapiHandle *tapi_handle = NULL;
 
 static void make_memps_log(char *file, pid_t pid, char *victim_name)
 {
@@ -254,7 +255,7 @@ int earjackcon_def_predefine_action(int argc, char **argv)
 int lowbat_popup(void *data)
 {
        int ret = -1, state = 0;
-       ret = vconf_get_int("memory/boot-animation/finished", &state);
+       ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &state);
        if (state == 1 || ret != 0) {
                bundle *b = NULL;
                b = bundle_create();
@@ -274,7 +275,7 @@ int lowbat_popup(void *data)
                        bundle_free(b);
                        return 1;
                }
-                       lowbat_popup_id = NULL;
+               lowbat_popup_id = NULL;
                lowbat_popup_option = 0;
                bundle_free(b);
        } else {
@@ -315,7 +316,7 @@ int lowbat_def_predefine_action(int argc, char **argv)
                lowbat_popup_option = LOWBAT_OPT_CHECK;
        }
 
-       ret = vconf_get_int("memory/boot-animation/finished", &state);
+       ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &state);
        if (state == 1 || ret != 0) {
                ret = syspopup_launch("lowbat-syspopup", b);
                if (ret < 0) {
@@ -338,6 +339,11 @@ Eina_Bool powerdown_ap_by_force(void *data)
        int poweroff_duration = POWEROFF_DURATION;
        char *buf;
 
+       if(tapi_handle != NULL)
+       {
+               tel_deinit(tapi_handle);
+               tapi_handle = NULL;
+       }
        /* Getting poweroff duration */
        buf = getenv("PWROFF_DUR");
        if (buf != NULL && strlen(buf) < 1024)
@@ -361,15 +367,20 @@ Eina_Bool powerdown_ap_by_force(void *data)
        return EINA_TRUE;
 }
 
-static void powerdown_ap(TelTapiEvent_t *event, void *data)
+static void powerdown_ap(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
 {
        struct timeval now;
        int poweroff_duration = POWEROFF_DURATION;
        char *buf;
 
-       if (power_subscription_id) {
-               tel_deregister_event(power_subscription_id);
-               power_subscription_id = 0;
+       if (poweroff_timer_id) {
+               ecore_timer_del(poweroff_timer_id);
+               poweroff_timer_id = NULL;
+       }
+       if (tapi_handle) {
+               tel_deregister_noti_event(tapi_handle,TAPI_NOTI_MODEM_POWER);
+               tel_deinit(tapi_handle);
+               tapi_handle = NULL;
        }
        PRT_TRACE("Power off \n");
 
@@ -393,7 +404,10 @@ static void powerdown_ap(TelTapiEvent_t *event, void *data)
        sync();
        reboot(RB_POWER_OFF);
 }
-
+static void powerdown_res_cb(TapiHandle *handle, int result, void *data, void *user_data)
+{
+       PRT_TRACE("poweroff command request : %d",result);
+}
 int poweroff_def_predefine_action(int argc, char **argv)
 {
        int ret;
@@ -405,10 +419,8 @@ int poweroff_def_predefine_action(int argc, char **argv)
        sync();
 
        gettimeofday(&tv_start_poweroff, NULL);
-       ret =
-           tel_register_event(TAPI_EVENT_POWER_PHONE_OFF,
-                              &power_subscription_id,
-                              (TelAppCallback) & powerdown_ap, NULL);
+       ret = tel_register_noti_event(tapi_handle, TAPI_NOTI_MODEM_POWER, powerdown_ap, NULL);
+
        if (ret != TAPI_API_SUCCESS) {
                PRT_TRACE_ERR
                    ("tel_register_event is not subscribed. error %d\n", ret);
@@ -416,33 +428,116 @@ int poweroff_def_predefine_action(int argc, char **argv)
                return 0;
        }
 
-       ret = tel_process_power_command(TAPI_PHONE_POWER_OFF);
+       ret = tel_process_power_command(tapi_handle, TAPI_PHONE_POWER_OFF, powerdown_res_cb, NULL);
        if (ret != TAPI_API_SUCCESS) {
                PRT_TRACE_ERR("tel_process_power_command() error %d\n", ret);
                powerdown_ap_by_force(NULL);
                return 0;
        }
 
+       poweroff_timer_id = ecore_timer_add(15, powerdown_ap_by_force, NULL);
+       return 0;
+}
+
+static void enter_flight_mode_cb(TapiHandle *handle, int result, void *data, void *user_data)
+{
+       PRT_TRACE("enter flight mode result : %d",result);
+}
+
+static void leave_flight_mode_cb(TapiHandle *handle, int result, void *data, void *user_data)
+{
+       PRT_TRACE("leave flight mode result : %d",result);
+}
+
+int entersleep_def_predefine_action(int argc, char **argv)
+{
+       int ret;
+
+       pm_change_state(LCD_NORMAL);
+       sync();
+
+       ret = tel_set_flight_mode(tapi_handle, TAPI_POWER_FLIGHT_MODE_ENTER, enter_flight_mode_cb, NULL);
+       PRT_TRACE_ERR("request for changing into flight mode : %d\n", ret);
+
+       system("/etc/rc.d/rc.entersleep");
+       pm_change_state(POWER_OFF);
+
+       return 0;
+}
+
+int leavesleep_def_predefine_action(int argc, char **argv)
+{
+       int ret;
+
+       pm_change_state(LCD_NORMAL);
+       sync();
+
+       ret = tel_set_flight_mode(tapi_handle, TAPI_POWER_FLIGHT_MODE_LEAVE, leave_flight_mode_cb, NULL);
+       PRT_TRACE_ERR("request for changing into flight mode : %d\n", ret);
+
        return 0;
 }
 
-static void restart_ap(TelTapiEvent_t *event, void *data);
+static void restart_ap(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
 
 Eina_Bool restart_ap_ecore(void *data)
 {
-       restart_ap(NULL, (void *)-1);
+       restart_ap(tapi_handle,NULL,(void *)-1,NULL);
        return EINA_TRUE;
 }
 
-static void restart_ap(TelTapiEvent_t *event, void *data)
+static void restart_ap(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
 {
        struct timeval now;
        int poweroff_duration = POWEROFF_DURATION;
        char *buf;
 
-       if (power_subscription_id) {
-               tel_deregister_event(power_subscription_id);
-               power_subscription_id = 0;
+       if (poweroff_timer_id) {
+               ecore_timer_del(poweroff_timer_id);
+               poweroff_timer_id = NULL;
+       }
+
+
+       if(tapi_handle != NULL)
+       {
+               tel_deregister_noti_event(tapi_handle,TAPI_NOTI_MODEM_POWER);
+               tel_deinit(tapi_handle);
+               tapi_handle = NULL;
+       }
+
+       PRT_INFO("Restart\n");
+       sync();
+
+       buf = getenv("PWROFF_DUR");
+       if (buf != NULL && strlen(buf) < 1024)
+               poweroff_duration = atoi(buf);
+       if (poweroff_duration < 0 || poweroff_duration > 60)
+               poweroff_duration = POWEROFF_DURATION;
+       gettimeofday(&now, NULL);
+       while (now.tv_sec - tv_start_poweroff.tv_sec < poweroff_duration) {
+               usleep(100000);
+               gettimeofday(&now, NULL);
+       }
+
+       reboot(RB_AUTOBOOT);
+}
+
+static void restart_ap_by_force(void *data)
+{
+       struct timeval now;
+       int poweroff_duration = POWEROFF_DURATION;
+       char *buf;
+
+       if (poweroff_timer_id) {
+               ecore_timer_del(poweroff_timer_id);
+               poweroff_timer_id = NULL;
+       }
+
+
+       if(tapi_handle != NULL)
+       {
+               tel_deinit(tapi_handle);
+               tapi_handle = NULL;
        }
 
        PRT_INFO("Restart\n");
@@ -473,23 +568,23 @@ int restart_def_predefine_action(int argc, char **argv)
        gettimeofday(&tv_start_poweroff, NULL);
 
        ret =
-           tel_register_event(TAPI_EVENT_POWER_PHONE_OFF,
-                              &power_subscription_id,
-                              (TelAppCallback) & restart_ap, NULL);
+           tel_register_noti_event(tapi_handle, TAPI_NOTI_MODEM_POWER, restart_ap, NULL);
        if (ret != TAPI_API_SUCCESS) {
                PRT_TRACE_ERR
                    ("tel_register_event is not subscribed. error %d\n", ret);
-               restart_ap(NULL, (void *)-1);
+               restart_ap_by_force((void *)-1);
                return 0;
        }
 
-       ret = tel_process_power_command(TAPI_PHONE_POWER_OFF);
+
+       ret = tel_process_power_command(tapi_handle, TAPI_PHONE_POWER_OFF, powerdown_res_cb, NULL);
        if (ret != TAPI_API_SUCCESS) {
                PRT_TRACE_ERR("tel_process_power_command() error %d\n", ret);
-               restart_ap(NULL, (void *)-1);
+               restart_ap_by_force((void *)-1);
                return 0;
        }
 
+       poweroff_timer_id = ecore_timer_add(15, restart_ap_ecore, NULL);
        return 0;
 }
 
@@ -550,6 +645,17 @@ static void ss_action_entry_load_from_sodir()
 
 void ss_predefine_internal_init(void)
 {
+
+       /* telephony initialize */
+       int ret = 0;
+       tapi_handle = tel_init(NULL);
+       if (tapi_handle == NULL) {
+               PRT_TRACE_ERR("tapi init error");
+       }
+#ifdef NOUSE
+       ss_action_entry_add_internal(PREDEF_CALL, call_predefine_action, NULL,
+                                    NULL);
+#endif
        ss_action_entry_add_internal(PREDEF_LOWMEM, lowmem_def_predefine_action,
                                     NULL, NULL);
        ss_action_entry_add_internal(PREDEF_LOWBAT, lowbat_def_predefine_action,
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 03560e8..1a11d5e 100644 (file)
@@ -31,7 +31,9 @@ int ss_ta_init()
 
        PRT_TRACE("check ta connection");
        if (plugin_intf->OEM_sys_get_jack_charger_online(&val) == 0) {
-               if (val==1) {
+               if ( val==1 ) {
+                       vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS,
+                                       VCONFKEY_SYSMAN_CHARGER_CONNECTED);
                        while (i < RETRY
                               && pm_lock_state(LCD_OFF, STAY_CUR_STATE,
                                                0) == -1) {
@@ -40,6 +42,9 @@ int ss_ta_init()
                        }
                        PRT_TRACE("ta is connected");
                }
+               else if ( val==0 )
+                       vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS,
+                                       VCONFKEY_SYSMAN_CHARGER_DISCONNECTED);
        }
        return 0;
 }
index 1cb3b12..3c0be54 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/rtc.h>
 #include <fcntl.h>
 
-#include <ITapiMisc.h>
 
 static const char default_rtc0[] = "/dev/rtc0";
 static const char default_rtc1[] = "/dev/rtc1";
index 94a61af..7515474 100644 (file)
@@ -25,7 +25,7 @@
 #include "include/ss_data.h"
 
 #define USBCON_EXEC_PATH       PREFIX"/bin/usb_setting"
-#define RETRY  3
+#define RETRY                  3
 
 int ss_usb_init()
 {
@@ -33,11 +33,11 @@ int ss_usb_init()
 
        PRT_TRACE("check usb connection");
        if (plugin_intf->OEM_sys_get_jack_usb_online(&val) == 0) {
-               if (val) {
+               if (val==1) {
                        vconf_set_int(VCONFKEY_SYSMAN_USB_STATUS,
-                                     VCONFKEY_SYSMAN_USB_AVAILABLE);
+                                       VCONFKEY_SYSMAN_USB_AVAILABLE);
                        while (i < RETRY
-                              && pm_lock_state(LCD_OFF, STAY_CUR_STATE,
+                                       && pm_lock_state(LCD_OFF, STAY_CUR_STATE,
                                                0) == -1) {
                                i++;
                                sleep(1);
@@ -48,6 +48,8 @@ int ss_usb_init()
                                return -1;
                        }
                }
+               else if (val==0)
+                       vconf_set_int(VCONFKEY_SYSMAN_USB_STATUS,VCONFKEY_SYSMAN_USB_DISCONNECTED);
        }
 
        return 0;
index d7c443c..31f9468 100644 (file)
@@ -27,6 +27,7 @@
 #include <vconf.h>
 #include <mntent.h>
 #include <limits.h>
+#include <syspopup_caller.h>
 #include "ss_device_handler.h"
 #include "ss_log.h"
 
@@ -39,6 +40,7 @@
 
 static int added_noti_value = 0; 
 static int removed_noti_value = 0; 
+static int tempfs_mounted = 0;
 
 static int __ss_mount_device(char *dev)
 {
@@ -72,7 +74,7 @@ static int __ss_mount_device(char *dev)
        }
 
        /* Mount block device on mount point */
-       r = mount(dev, buf_mnt_point, "vfat", 0, "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed");
+       r = mount(dev, buf_mnt_point, "vfat", 0, "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed,smackfsroot=*,smackfsdef=*");
        if (r < 0) {
                r = rmdir(buf_mnt_point);
                PRT_TRACE_ERR("Mount failed: MOUNT PATH(%s", buf_mnt_point);
@@ -90,22 +92,31 @@ static int __ss_unmount_device(char *mnt_point)
                return -1;
        }
 
-       int r = -1;
+       int ret = -1;
 
        /* Umount block device */
-       r = umount2(mnt_point, MNT_DETACH);
-       if (r < 0) {
+       ret = umount2(mnt_point, MNT_DETACH);
+       if (ret < 0) {
                PRT_TRACE_ERR("Unmounting is unabled: MOUNT PATH(%s)", mnt_point);
-               r = rmdir(mnt_point);
-               if (r < 0) {
+               ret = rmdir(mnt_point);
+               if (ret < 0) {
                        PRT_TRACE_ERR("Removing Directory is unabled: PATH(%s)", mnt_point);
                }
                return -1;
        }
 
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "otg_remove");
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               PRT_TRACE_EM("popup lauch failed\n");
+       }
+       bundle_free(b);
+
        /* Clean up unmounted directory */
-       r = rmdir(mnt_point);
-       if (r < 0) {
+       ret = rmdir(mnt_point);
+       if (ret < 0) {
                PRT_TRACE_ERR("Removing Directory is unabled: PATH(%s)", mnt_point);
        }
        PRT_TRACE("Unmount/Remove Complete: MOUNT PATH(%s)", mnt_point);
@@ -120,6 +131,7 @@ static int __ss_usb_storage_added(int argc, char *argv[])
                return -1;
        }
 
+       int ret = -1;
        int fd = -1;
        int part_num = 0;
 
@@ -128,6 +140,9 @@ static int __ss_usb_storage_added(int argc, char *argv[])
        char *disk_path;
        char *mounted_check;
 
+       char *rel_mnt_point;
+       char buf_mnt_point[BUF_MAX];
+
        /* Check whether mount point directory is exist */
        if (access(MOUNT_POINT, F_OK) < 0) {
                if (mkdir(MOUNT_POINT, 0755) < 0) {
@@ -137,29 +152,32 @@ static int __ss_usb_storage_added(int argc, char *argv[])
        }
 
        /* Mount tmpfs for protecting user data */
-       if (mount("tmpfs", MOUNT_POINT, "tmpfs", 0, "") < 0) {
-               if (errno != EBUSY) {
-                       PRT_TRACE_ERR("Failed to mount USB Storage Mount Directory: DIRECTORY(%s)", MOUNT_POINT);
-                       return -1;
+       if (tempfs_mounted != 1) {
+               if (mount("tmpfs", MOUNT_POINT, "tmpfs", 0, "") < 0) {
+                       if (errno != EBUSY) {
+                               PRT_TRACE_ERR("Failed to mount USB Storage Mount Directory: DIRECTORY(%s)", MOUNT_POINT);
+                               return -1;
+                       }
+               } else {
+                       /* Change permission to avoid to write user data on tmpfs */
+                       if (chmod(MOUNT_POINT, 0755) < 0) {
+                               PRT_TRACE_ERR("Failed to change mode: DIRCTORY(%s)", MOUNT_POINT);
+                               umount2(MOUNT_POINT, MNT_DETACH);
+                               return -1;
+                       }
+                       tempfs_mounted = 1;
                }
        }
 
-       /* Change permission to avoid to write user data on tmpfs */
-       if (chmod(MOUNT_POINT, 0755) < 0) {
-               PRT_TRACE_ERR("Failed to change mode: DIRCTORY(%s)", MOUNT_POINT);
+       rel_mnt_point = strrchr(buf_dev, '/');
+       if (rel_mnt_point == NULL) {
+               PRT_TRACE_ERR("Get Relative Mount Path Failed");
                return -1;
        }
+       snprintf(buf_mnt_point, BUF_MAX, "%s%s", MOUNT_POINT, rel_mnt_point);
 
-       /* Mount a single partition storage device */
        if (__ss_mount_device(buf_dev) < 0) {
-               /* Mount a multi partition storage device */
-               for (part_num = 1; part_num < 10; part_num++) {
-                       snprintf(buf_part_dev, BUF_MAX, "%s%d", buf_dev, part_num);
-                       if (__ss_mount_device(buf_part_dev) < 0) {
-                               PRT_TRACE("Mounting partition is unabled: PARTITION(%s)", buf_part_dev);
-                               continue;       
-                       }
-               }
+               PRT_TRACE_ERR("Failed to mount %d", buf_dev);
        }
 
        FILE *file = setmntent(MTAB_FILE, "r");
@@ -182,6 +200,17 @@ static int __ss_usb_storage_added(int argc, char *argv[])
 
                        PRT_TRACE("Setting vconf value: KEY(%s) DEVICE(%s)", VCONFKEY_SYSMAN_ADDED_USB_STORAGE, buf_dev);
                        fclose(file);
+
+                       bundle *b = NULL;
+                       b = bundle_create();
+                       bundle_add(b, "_SYSPOPUP_CONTENT_", "otg_add");
+                       bundle_add(b, "path", buf_mnt_point);
+                       ret = syspopup_launch("usbotg-syspopup", b);
+                       if (ret < 0) {
+                               PRT_TRACE_EM("popup lauch failed\n");
+                       }
+                       bundle_free(b);
+
                        return 0;
                }
        }
@@ -209,7 +238,8 @@ static int __ss_usb_storage_removed(int argc, char *argv[])
        snprintf(buf_mnt_point, BUF_MAX, "%s/%s", MOUNT_POINT, buf_dev_name);
 
        if (__ss_unmount_device(buf_mnt_point) == 0) {
-               umount2(MOUNT_POINT, MNT_DETACH);
+               if(umount2(MOUNT_POINT, MNT_DETACH) == 0)
+                       tempfs_mounted = 1;
 
                if (removed_noti_value < INT_MAX) {
                        ++removed_noti_value;
@@ -225,33 +255,7 @@ static int __ss_usb_storage_removed(int argc, char *argv[])
                return 0;
        }
 
-       FILE *file = setmntent(MTAB_FILE, "r");
-       struct mntent *mnt_entry;
-
-       while (mnt_entry = getmntent(file)) {
-               mounted_check = strstr(mnt_entry->mnt_dir, buf_mnt_point);
-               if (mounted_check != NULL) {
-                       if (__ss_unmount_device(mnt_entry->mnt_dir) < 0) {
-                               PRT_TRACE_ERR("Unmount Failed: MOUNT PATH(%s)", mnt_entry->mnt_dir);
-                       }
-                       PRT_TRACE("Unmount Success: MOUNT PATH(%s)", mnt_entry->mnt_dir);
-               }
-       }
-       fclose(file);
-
-       umount2(MOUNT_POINT, MNT_DETACH);
-
-       if (removed_noti_value < INT_MAX) {
-               ++removed_noti_value;
-       } else {
-               removed_noti_value = 1;
-       }
-       if (vconf_set_int(VCONFKEY_SYSMAN_REMOVED_USB_STORAGE, removed_noti_value) < 0) {
-               PRT_TRACE_ERR("Setting vconf value is failed: KEY(%s)", VCONFKEY_SYSMAN_REMOVED_USB_STORAGE);
-               vconf_set_int(VCONFKEY_SYSMAN_ADDED_USB_STORAGE, -1);
-       }
-
-       PRT_TRACE("Setting vconf value: KEY(%s) DEVICE(%s)", VCONFKEY_SYSMAN_REMOVED_USB_STORAGE, buf_dev_name);
+       PRT_TRACE("Usb storage removed fail");
        return 0;
 }
 
diff --git a/sys_device_noti/CMakeLists.txt b/sys_device_noti/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..2bc220b
--- /dev/null
@@ -0,0 +1,28 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(sys_device_noti C)
+
+SET(SRCS sys_device_noti.c)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} /usr/include/svi /usr/include/notification)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+MESSAGE("FLAGS: ${CMAKE_C_FLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
+IF( $ENV{ARCH} MATCHES "arm" )
+       ADD_DEFINITIONS("-DTARGET")
+ENDIF()
+ADD_DEFINITIONS("-DSLP_DEBUG")
+ADD_DEFINITIONS("-DSLP_PROF")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-lsvi -lnotification")
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/batt_full_icon.png DESTINATION share/system-server/sys_device_noti)
diff --git a/sys_device_noti/data/batt_full_icon.png b/sys_device_noti/data/batt_full_icon.png
new file mode 100755 (executable)
index 0000000..4245ccc
Binary files /dev/null and b/sys_device_noti/data/batt_full_icon.png differ
diff --git a/sys_device_noti/sys_device_noti.c b/sys_device_noti/sys_device_noti.c
new file mode 100755 (executable)
index 0000000..1e47949
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+
+#include <stdio.h>
+#include <svi.h>
+#include <pmapi.h>
+#include <notification.h>
+#include "ss_log.h"
+#include "sys_device_noti.h"
+
+#define BATTERY_FULL_ICON_PATH                 "/usr/share/system-server/sys_device_noti/batt_full_icon.png"
+static int battery_full_noti(int bNoti)
+{
+       int charge_full = bNoti;
+       notification_h noti = NULL;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+       if (charge_full == 1) {
+               noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
+               PRT_TRACE("[BAT_FULL_NOTI] add notification for battery full\n");
+               noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
+               if (noti == NULL) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Errot noti == NULL\n");
+                       return -1;
+               }
+
+               noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "Battery fully charged", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_title : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, "Unplug charger", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_content : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF, "Unplug charger", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_content : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_time(noti, time(NULL));
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_time : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, BATTERY_FULL_ICON_PATH);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_image : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_property(noti, NOTIFICATION_PROP_DISABLE_APP_LAUNCH | NOTIFICATION_PROP_DISABLE_TICKERNOTI | NOTIFICATION_PROP_VOLATILE_DISPLAY);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_property : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_set_display_applist : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_insert(noti, NULL);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_insert : %d\n", noti_err);
+                       noti_err = notification_free(noti);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                               return -1;
+                       }
+                       return -1;
+               }
+
+               noti_err = notification_free(noti);
+               if (noti_err != NOTIFICATION_ERROR_NONE) {
+                       PRT_TRACE("[BAT_FULL_NOTI] Error notification_free : %d\n", noti_err);
+                       return -1;
+               }
+               pm_change_state(LCD_NORMAL);
+       } else {
+               noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
+               PRT_TRACE("[BAT_FULL_NOTI] Leave battery full status\n");
+       }
+
+       return 0;
+}
+int main(int argc, char *argv[])
+{
+       int r = 0;
+       int handle = 0;
+       int bNoti = -1;
+       sound_type snd = -1;
+       vibration_type vib = -1;
+       cb_noti_type cb_type = -1;
+
+       if (argc == 3)
+               bNoti = atoi(argv[2]);
+       cb_type = (cb_noti_type)atoi(argv[1]);
+       switch (cb_type) {
+               case CB_NOTI_BATT_CHARGE:
+                       vib = SVI_VIB_OPERATION_CHARGERCONN;
+                       snd = SVI_SND_OPERATION_CHARGERCONN;
+                       break;
+               case CB_NOTI_BATT_FULL:
+                       battery_full_noti(bNoti);
+                       if (1==bNoti) {
+                               vib = SVI_VIB_OPERATION_FULLCHARGED;
+                               snd = SVI_SND_OPERATION_FULLCHARGED;
+                               break;
+                       } else
+                       return 0;
+               default:
+                       PRT_TRACE("sys_device_noti cb_type error(%d)",cb_type);
+                       break;
+       }
+
+       r = svi_init(&handle); /* Initialize SVI */
+
+       if (r != SVI_SUCCESS) {
+               PRT_TRACE("Cannot initialize SVI.\n");
+       } else {
+               r = svi_play(handle, vib, snd);
+               if (r != SVI_SUCCESS)
+                       PRT_TRACE("Cannot play sound or vibration.\n");
+               r = svi_fini(handle); /* Finalize SVI */
+               if (r != SVI_SUCCESS)
+                       PRT_TRACE("Cannot close SVI.\n");
+       }
+       return 0;
+}
diff --git a/sys_device_noti/sys_device_noti.h b/sys_device_noti/sys_device_noti.h
new file mode 100755 (executable)
index 0000000..3210bf3
--- /dev/null
@@ -0,0 +1,30 @@
+/*\r
+ * Copyright 2012  Samsung Electronics Co., Ltd\r
+ *\r
+ * Licensed under the Flora License, Version 1.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.tizenopensource.org/license\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
+#ifndef __SYS_DEVICE_NOTI_H__\r
+#define __SYS_DEVICE_NOTI_H__\r
+\r
+typedef enum {\r
+       CB_NOTI_BATT_CHARGE,\r
+       CB_NOTI_BATT_LOW,\r
+       CB_NOTI_BATT_FULL,\r
+       CB_NOTI_MAX\r
+}cb_noti_type;\r
+typedef enum {\r
+       CB_NOTI_OFF     = 0,\r
+       CB_NOTI_ON      = 1\r
+}cb_noti_onoff_type;\r
+\r
+#endif /* __SYS_DEVICE__NOTI_H__ */\r
old mode 100755 (executable)
new mode 100644 (file)
index b1e15ea..44a9779 100644 (file)
@@ -6,22 +6,34 @@ ACTION=="remove", KERNEL=="mmcblk[0-9]", SUBSYSTEM=="block", RUN+="@PREFIX@/bin/
 #ACTION=="change" SUBSYSTEM=="pmon", RUN+="@PREFIX@/bin/restart"
 
 #Jack
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="usb" RUN+="@PREFIX@/bin/sys_event device_usb_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="charger" RUN+="@PREFIX@/bin/sys_event device_ta_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="earjack" RUN+="@PREFIX@/bin/sys_event device_earjack_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="earkey" RUN+="@PREFIX@/bin/sys_event device_earkey_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="tvout" RUN+="@PREFIX@/bin/sys_event device_tvout_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="hdmi" RUN+="@PREFIX@/bin/sys_event device_hdmi_chgdet"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="cdrom" RUN+="@PREFIX@/bin/start_composite.sh"
-ACTION=="change" DEVPATH=="/devices/platform/jack", ENV{CHGDET}=="cradle" RUN+="@PREFIX@/bin/sys_event device_cradle_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="usb"              RUN+="@PREFIX@/bin/sys_event device_usb_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="charger"  RUN+="@PREFIX@/bin/sys_event device_ta_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="earjack"  RUN+="@PREFIX@/bin/sys_event device_earjack_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="earkey"   RUN+="@PREFIX@/bin/sys_event device_earkey_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="tvout"    RUN+="@PREFIX@/bin/sys_event device_tvout_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="hdmi"             RUN+="@PREFIX@/bin/sys_event device_hdmi_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="cdrom"    RUN+="@PREFIX@/bin/start_composite.sh"
+ACTION=="change"       DEVPATH=="/devices/platform/jack",      ENV{CHGDET}=="keyboard" RUN+="@PREFIX@/bin/sys_event device_keyboard_chgdet"
 
 #USB Host Device
-ACTION=="add", SUBSYSTEM=="host_notify", RUN+="@PREFIX@/bin/vconftool set -t int memory/Device/usbhost/status 1"
-ACTION=="remove", SUBSYSTEM=="host_notify", RUN+="@PREFIX@/bin/vconftool set -t int memory/Device/usbhost/status 0"
+ACTION=="change",      SUBSYSTEM=="host_notify",       ENV{STATE}=="ADD",                      RUN+="@PREFIX@/bin/vconftool set -t int memory/sysman/usbhost_status 1 -f"
+ACTION=="change",      SUBSYSTEM=="host_notify",       ENV{STATE}=="REMOVE",           RUN+="@PREFIX@/bin/vconftool set -t int memory/sysman/usbhost_status 0 -f"
+ACTION=="change",      SUBSYSTEM=="host_notify",       ENV{STATE}=="OVERCURRENT",      RUN+="@PREFIX@/bin/vconftool set -t int memory/sysman/usbhost_status 2 -f"
 
 #USB Storage
-ACTION=="add", KERNEL=="sd[a-z]", SUBSYSTEM=="block", RUN+="@PREFIX@/bin/vconftool set -t string memory/Device/usbhost/added_storage_uevent %N"
-ACTION=="remove", KERNEL=="sd[a-z]", SUBSYSTEM=="block", RUN+="@PREFIX@/bin/vconftool set -t string memory/Device/usbhost/removed_storage_uevent $name"
+ACTION=="add",         KERNEL=="sd[a-z]",              SUBSYSTEM=="block",     RUN+="@PREFIX@/bin/vconftool set -t string memory/private/sysman/added_storage_uevent %N -f"
+ACTION=="add",         KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block",     RUN+="@PREFIX@/bin/vconftool set -t string memory/private/sysman/added_storage_uevent %N -f"
+ACTION=="remove",      KERNEL=="sd[a-z]",              SUBSYSTEM=="block",     RUN+="@PREFIX@/bin/vconftool set -t string memory/private/sysman/removed_storage_uevent $name -f"
+ACTION=="remove",      KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block",     RUN+="@PREFIX@/bin/vconftool set -t string memory/private/sysman/removed_storage_uevent $name -f"
 
 #charge
-ACTION=="change" DEVPATH=="/devices/platform/charger-manager.0" RUN+="@PREFIX@/bin/sys_event device_charge_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/samsung-battery/power_supply/battery"       RUN+="/usr/bin/sys_event device_charge_chgdet"
+ACTION=="change"       DEVPATH=="/devices/platform/charger-manager.0"                                          RUN+="@PREFIX@/bin/sys_event device_charge_chgdet"
+
+#USB Keyboard
+ACTION=="add"          SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"        ENV{ID_BUS}=="usb"      ENV{ID_INPUT_KEYBOARD}=="?*"    RUN+="/usr/bin/sys_event device_keyboard_add"
+ACTION=="remove"    SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"    ENV{ID_BUS}=="usb"     ENV{ID_INPUT_KEYBOARD}=="?*"    RUN+="/usr/bin/sys_event device_keyboard_remove"
+ACTION=="add"       SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"    ENV{ID_BUS}=="usb"     ENV{ID_INPUT_MOUSE}=="?*"               RUN+="/usr/bin/sys_event device_mouse_add"
+ACTION=="remove"       SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"    ENV{ID_BUS}=="usb"  ENV{ID_INPUT_MOUSE}=="?*"               RUN+="/usr/bin/sys_event device_mouse_remove"
+ACTION=="add"          SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"        ENV{ID_BUS}=="usb"      ENV{ID_INPUT_KEYBOARD}!="?*"    ENV{ID_INPUT_MOUSE}!="?*"       RUN+="/usr/bin/sys_event device_unknown_usb_add"
+ACTION=="remove"       SUBSYSTEM=="input"  DEVPATH=="*/input[1-9]*/event[1-9]*"    ENV{ID_BUS}=="usb"  ENV{ID_INPUT_KEYBOARD}!="?*"    ENV{ID_INPUT_MOUSE}!="?*"               RUN+="/usr/bin/sys_event device_unknown_usb_remove"