summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSehong Na <sehong.na@samsung.com>2014-05-31 13:00:43 +0900
committerSehong Na <sehong.na@samsung.com>2014-05-31 13:00:43 +0900
commit49b40a5d9545c0847889292acf5a8da545e970eb (patch)
treef524af009437a07e766f9bdba1c48a5aa2a58ec0
downloadstarter-49b40a5d9545c0847889292acf5a8da545e970eb.tar.gz
starter-49b40a5d9545c0847889292acf5a8da545e970eb.tar.bz2
starter-49b40a5d9545c0847889292acf5a8da545e970eb.zip
-rw-r--r--.gitattributes4
-rwxr-xr-x.gitignore12
-rwxr-xr-xCMakeLists.txt103
-rw-r--r--LICENSE204
-rw-r--r--NOTICE1
-rwxr-xr-xinclude/hourly_alert.h29
-rwxr-xr-xinclude/hw_key.h25
-rwxr-xr-xinclude/lock-daemon.h28
-rwxr-xr-xinclude/lockd-debug.h90
-rwxr-xr-xinclude/lockd-process-mgr.h51
-rwxr-xr-xinclude/lockd-window-mgr.h57
-rwxr-xr-xinclude/menu_daemon.h49
-rw-r--r--include/pkg_event.h49
-rw-r--r--include/starter-util.h38
-rwxr-xr-xinclude/starter-vconf.h28
-rwxr-xr-xinclude/starter.h38
-rw-r--r--include/util.h117
-rw-r--r--include/virtual_canvas.h34
-rw-r--r--include/x11.h29
-rw-r--r--include/xmonitor.h28
-rw-r--r--mobile/AUTHORS2
-rwxr-xr-xmobile/CMakeLists.txt101
-rw-r--r--mobile/LICENSE.Flora206
-rw-r--r--mobile/NOTICE3
-rwxr-xr-xmobile/include/hw_key.h22
-rwxr-xr-xmobile/include/lock-daemon.h24
-rwxr-xr-xmobile/include/lockd-debug.h64
-rwxr-xr-xmobile/include/lockd-process-mgr.h38
-rwxr-xr-xmobile/include/lockd-window-mgr.h42
-rwxr-xr-xmobile/include/menu_daemon.h36
-rwxr-xr-xmobile/include/pkg_event.h46
-rwxr-xr-xmobile/include/starter-util.h35
-rwxr-xr-xmobile/include/starter-vconf.h24
-rwxr-xr-xmobile/include/starter.h28
-rwxr-xr-xmobile/include/util.h97
-rwxr-xr-xmobile/include/x11.h26
-rwxr-xr-xmobile/include/xmonitor.h25
-rwxr-xr-xmobile/lock-setting/CMakeLists.txt9
-rwxr-xr-xmobile/lock-setting/lockscreen-options/CMakeLists.txt39
-rwxr-xr-xmobile/lock-setting/lockscreen-options/include/lockscreen-options-debug.h48
-rwxr-xr-xmobile/lock-setting/lockscreen-options/include/lockscreen-options-main.h28
-rwxr-xr-xmobile/lock-setting/lockscreen-options/include/lockscreen-options-util.h48
-rwxr-xr-xmobile/lock-setting/lockscreen-options/include/lockscreen-options.h64
-rwxr-xr-xmobile/lock-setting/lockscreen-options/src/lockscreen-options-main.c343
-rwxr-xr-xmobile/lock-setting/lockscreen-options/src/lockscreen-options-util.c148
-rwxr-xr-xmobile/lock-setting/lockscreen-options/src/lockscreen-options.c213
-rwxr-xr-xmobile/lock-setting/po/CMakeLists.txt26
-rw-r--r--mobile/lock-setting/po/ar.po54
-rw-r--r--mobile/lock-setting/po/az.po54
-rw-r--r--mobile/lock-setting/po/bg.po54
-rw-r--r--mobile/lock-setting/po/ca.po54
-rw-r--r--mobile/lock-setting/po/cs.po54
-rw-r--r--mobile/lock-setting/po/da.po54
-rw-r--r--mobile/lock-setting/po/de_DE.po54
-rw-r--r--mobile/lock-setting/po/el_GR.po54
-rw-r--r--mobile/lock-setting/po/en.po54
-rw-r--r--mobile/lock-setting/po/en_PH.po54
-rw-r--r--mobile/lock-setting/po/en_US.po54
-rw-r--r--mobile/lock-setting/po/es_ES.po54
-rw-r--r--mobile/lock-setting/po/es_MX.po54
-rw-r--r--mobile/lock-setting/po/es_US.po51
-rw-r--r--mobile/lock-setting/po/et.po54
-rw-r--r--mobile/lock-setting/po/eu.po54
-rw-r--r--mobile/lock-setting/po/fi.po54
-rw-r--r--mobile/lock-setting/po/fr_CA.po54
-rw-r--r--mobile/lock-setting/po/fr_FR.po54
-rw-r--r--mobile/lock-setting/po/ga.po54
-rw-r--r--mobile/lock-setting/po/gl.po54
-rw-r--r--mobile/lock-setting/po/hi.po54
-rw-r--r--mobile/lock-setting/po/hr.po54
-rw-r--r--mobile/lock-setting/po/hu.po54
-rw-r--r--mobile/lock-setting/po/hy.po54
-rw-r--r--mobile/lock-setting/po/is.po54
-rw-r--r--mobile/lock-setting/po/it_IT.po54
-rw-r--r--mobile/lock-setting/po/ja_JP.po54
-rw-r--r--mobile/lock-setting/po/ka.po54
-rw-r--r--mobile/lock-setting/po/kk.po54
-rw-r--r--mobile/lock-setting/po/ko_KR.po54
-rw-r--r--mobile/lock-setting/po/lt.po54
-rw-r--r--mobile/lock-setting/po/lv.po54
-rw-r--r--mobile/lock-setting/po/mk.po54
-rw-r--r--mobile/lock-setting/po/nb.po54
-rw-r--r--mobile/lock-setting/po/nl_NL.po54
-rw-r--r--mobile/lock-setting/po/pl.po54
-rw-r--r--mobile/lock-setting/po/pt_BR.po54
-rw-r--r--mobile/lock-setting/po/pt_PT.po54
-rw-r--r--mobile/lock-setting/po/ro.po54
-rw-r--r--mobile/lock-setting/po/ru_RU.po54
-rw-r--r--mobile/lock-setting/po/sk.po54
-rw-r--r--mobile/lock-setting/po/sl.po54
-rw-r--r--mobile/lock-setting/po/sr.po54
-rw-r--r--mobile/lock-setting/po/sv.po54
-rw-r--r--mobile/lock-setting/po/tr_TR.po54
-rw-r--r--mobile/lock-setting/po/uk.po54
-rw-r--r--mobile/lock-setting/po/uz.po54
-rw-r--r--mobile/lock-setting/po/zh_CN.po54
-rw-r--r--mobile/lock-setting/po/zh_HK.po54
-rw-r--r--mobile/lock-setting/po/zh_SG.po54
-rw-r--r--mobile/lock-setting/po/zh_TW.po54
-rw-r--r--mobile/packaging/starter.spec110
-rw-r--r--mobile/src/hw_key.c323
-rw-r--r--mobile/src/lock-daemon.c674
-rw-r--r--mobile/src/lockd-debug.c94
-rw-r--r--mobile/src/lockd-process-mgr.c176
-rw-r--r--mobile/src/lockd-window-mgr.c283
-rw-r--r--mobile/src/menu_daemon.c373
-rw-r--r--mobile/src/pkg_event.c301
-rw-r--r--mobile/src/starter.c273
-rw-r--r--mobile/src/x11.c111
-rw-r--r--mobile/src/xmonitor.c296
-rw-r--r--mobile/starter.desktop.in9
-rw-r--r--mobile/starter.manifest17
-rw-r--r--mobile/starter.rule10
-rw-r--r--mobile/systemd/starter.path5
-rw-r--r--mobile/systemd/starter.service12
-rw-r--r--mobile/systemd/starter.socket6
-rwxr-xr-xmobile/test/get_entry.c89
-rwxr-xr-xmobile/test/get_theme.c56
-rwxr-xr-xmobile/test/set_theme.c62
-rw-r--r--packaging/starter.service13
-rwxr-xr-xpackaging/starter.spec185
-rw-r--r--rd3starter27
-rw-r--r--rd4starter14
-rw-r--r--src/hourly_alert.c278
-rw-r--r--src/hw_key.c1145
-rw-r--r--src/lock-daemon.c1763
-rw-r--r--src/lockd-debug.c103
-rw-r--r--src/lockd-process-mgr.c315
-rw-r--r--src/lockd-window-mgr.c781
-rw-r--r--src/menu_daemon.c645
-rw-r--r--src/pkg_event.c313
-rw-r--r--src/starter.c312
-rw-r--r--src/virtual_canvas.c139
-rw-r--r--src/x11.c114
-rw-r--r--src/xmonitor.c332
-rw-r--r--starter15
-rw-r--r--starter.desktop.in9
-rw-r--r--starter.manifest27
-rw-r--r--starter.rule6
-rwxr-xr-xtest/get_entry.c92
-rwxr-xr-xtest/get_theme.c59
-rwxr-xr-xtest/set_theme.c65
142 files changed, 15636 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..64322df
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+.gitattributes export-ignore
+.gitignore export-ignore
+debian export-ignore
+#packaging export-ignore
diff --git a/.gitignore b/.gitignore
new file mode 100755
index 0000000..6c53821
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+build_log
+*.log
+*.pyc
+usr
+opt
+*.o
+*.os
+*.exe
+packages
+binaries
+*.ipk
+*~
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..6005636
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,103 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(starter C)
+
+SET(VENDOR "samsung")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "com.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(DATADIR "${PREFIX}/share")
+SET(LOCALEDIR "${DATADIR}/locale")
+
+IF("${ARCH}" STREQUAL "arm")
+ OPTION(USE_ARM "Use Arm" ON)
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("######################################## add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+MESSAGE("##### ARCH: ${ARCH}")
+
+IF(FEATURE_TIZENW2)
+ ADD_DEFINITIONS("-DFEATURE_TIZENW2")
+ MESSAGE("tizenw2 build")
+ELSE(FEATURE_TIZENW2)
+ MESSAGE("tizenw build")
+ENDIF(FEATURE_TIZENW2)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ ail
+ aul
+ capi-system-media-key
+ db-util
+ dlog
+ ecore
+ ecore-evas
+ ecore-input
+ ecore-x
+ edbus
+ eet
+ eina
+ elementary
+ evas
+ utilX
+ vconf
+ x11
+ xcomposite
+ xext
+ appcore-efl
+ glib-2.0
+ bundle
+ capi-appfw-application
+ pkgmgr-info
+ alarm-service
+ feedback
+ syspopup-caller
+ deviced
+)
+
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+FOREACH(flag ${pkgs_added_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
+
+#IND_PROGRAM(UNAME NAMES uname)
+#EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-D_GNU_SOURCE")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME}
+ src/starter.c
+ src/hw_key.c
+ src/hourly_alert.c
+)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_added_LDFLAGS})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+#INSTALL to /etc/init.d
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..a06208b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,204 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ 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.
+
+ 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,
+ 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 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 in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) 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
+
+ (d) 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 Apache License to your work.
+
+ To apply the Apache 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 Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..ded3804
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. \ No newline at end of file
diff --git a/include/hourly_alert.h b/include/hourly_alert.h
new file mode 100755
index 0000000..162d600
--- /dev/null
+++ b/include/hourly_alert.h
@@ -0,0 +1,29 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __HOURLY_ALERT_H__
+#define __HOURLY_ALERT_H__
+
+
+void init_hourly_alert(void *data);
+void fini_hourly_alert(void *data);
+
+#endif /* __HOURLY_ALERT_H__ */
diff --git a/include/hw_key.h b/include/hw_key.h
new file mode 100755
index 0000000..1442b3e
--- /dev/null
+++ b/include/hw_key.h
@@ -0,0 +1,25 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+extern void destroy_key_window(void);
+extern void create_key_window(void);
+
+// End of a file
diff --git a/include/lock-daemon.h b/include/lock-daemon.h
new file mode 100755
index 0000000..5a7cc7b
--- /dev/null
+++ b/include/lock-daemon.h
@@ -0,0 +1,28 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __LOCK_DAEMON_H__
+#define __LOCK_DAEMON_H__
+
+int start_lock_daemon(int launch_lock, int is_first_boot);
+int lockd_get_lock_type(void);
+
+#endif /* __LOCK_DAEMON_H__ */
diff --git a/include/lockd-debug.h b/include/lockd-debug.h
new file mode 100755
index 0000000..a8ee916
--- /dev/null
+++ b/include/lockd-debug.h
@@ -0,0 +1,90 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __LOCKD_DEBUG_H__
+#define __LOCKD_DEBUG_H__
+
+#include <stdio.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "STARTER"
+
+#define ENABLE_LOG_SYSTEM
+
+#ifdef ENABLE_LOG_SYSTEM
+#define STARTER_ERR(fmt, arg...) LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_DBG(fmt, arg...) LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_WARN(fmt, arg...) LOGW("["LOG_TAG"%s:%d:W] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_SECURE_ERR(fmt, arg...) SECURE_LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_SECURE_DBG(fmt, arg...) SECURE_LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_SECURE_WARN(fmt, arg...) SECURE_LOGW("["LOG_TAG"%s:%d:W] "fmt, __FILE__, __LINE__, ##arg)
+#else
+#define STARTER_ERR(fmt, arg...)
+#define STARTER_DBG(fmt, arg...)
+#define STARTER_WARN(fmt, arg...)
+#define STARTER_SECURE_ERR(fmt, arg...)
+#define STARTER_SECURE_DBG(fmt, arg...)
+#define STARTER_SECURE_WARN(fmt, arg...)
+#endif
+
+#ifdef ENABLE_LOG_SYSTEM
+#define _ERR(fmt, arg...) do { STARTER_ERR(fmt, ##arg); } while (0)
+#define _DBG(fmt, arg...) do { STARTER_DBG(fmt, ##arg); } while (0)
+#define _WARN(fmt, arg...) do { STARTER_WARN(fmt, ##arg); } while (0)
+
+#define _SECURE_ERR(fmt, arg...) do { STARTER_SECURE_ERR(fmt, ##arg); } while (0)
+#define _SECURE_DBG(fmt, arg...) do { STARTER_SECURE_DBG(fmt, ##arg); } while (0)
+#define _SECURE_WARN(fmt, arg...) do { STARTER_SECURE_WARN(fmt, ##arg); } while (0)
+
+#define LOCKD_ERR(fmt, arg...) _ERR(fmt, ##arg)
+#define LOCKD_DBG(fmt, arg...) _DBG(fmt, ##arg)
+#define LOCKD_WARN(fmt, arg...) _WARN(fmt, ##arg)
+#define LOCKD_SECURE_ERR(fmt, arg...) _SECURE_ERR(fmt, ##arg)
+#define LOCKD_SECURE_DBG(fmt, arg...) _SECURE_DBG(fmt, ##arg)
+#define LOCKD_SECURE_WARN(fmt, arg...) _SECURE_WARN(fmt, ##arg)
+#else
+#define _ERR(...)
+#define _DBG(...)
+#define _WARN(...)
+#define _SECURE_ERR(...)
+#define _SECURE_DBG(...)
+#define _SECURE_WARN(...)
+
+#define LOCKD_ERR(...)
+#define LOCKD_DBG(...)
+#define LOCKD_WARN(...)
+#define LOCKD_SECURE_ERR(...)
+#define LOCKD_SECURE_DBG(...)
+#define LOCKD_SECURE_WARN(...)
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#endif /* __LOCKD_DEBUG_H__ */
diff --git a/include/lockd-process-mgr.h b/include/lockd-process-mgr.h
new file mode 100755
index 0000000..3806754
--- /dev/null
+++ b/include/lockd-process-mgr.h
@@ -0,0 +1,51 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __LOCKD_PROCESS_MGR_H__
+#define __LOCKD_PROCESS_MGR_H__
+
+void lockd_process_mgr_init(void);
+
+int lockd_process_mgr_start_lock(void *data, int (*dead_cb) (int, void *),
+ int lock_type);
+
+int lockd_process_mgr_restart_lock(int lock_type);
+
+int lockd_process_mgr_start_recovery_lock(void);
+
+int lockd_process_mgr_start_back_to_app_lock(void);
+
+int lockd_process_mgr_start_phone_lock(void);
+
+int lockd_process_mgr_start_normal_lock(void *data, int (*dead_cb) (int, void *));
+
+void lockd_process_mgr_terminate_lock_app(int lock_app_pid,
+ int state);
+
+void lockd_process_mgr_terminate_phone_lock(int phone_lock_pid);
+
+void lockd_process_mgr_kill_lock_app(int lock_app_pid);
+
+int lockd_process_mgr_check_lock(int pid);
+
+int lockd_process_mgr_check_call(int pid);
+
+#endif /* __LOCKD_PROCESS_MGR_H__ */
diff --git a/include/lockd-window-mgr.h b/include/lockd-window-mgr.h
new file mode 100755
index 0000000..21e42e4
--- /dev/null
+++ b/include/lockd-window-mgr.h
@@ -0,0 +1,57 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __LOCKD_WINDOW_MGR_H__
+#define __LOCKD_WINDOW_MGR_H__
+
+typedef struct _lockw_data lockw_data;
+
+int
+lockd_window_mgr_get_focus_win_pid(void);
+
+Eina_Bool
+lockd_window_set_window_property(lockw_data * data, int lock_app_pid,
+ void *event);
+
+Eina_Bool
+lockd_window_set_window_effect(lockw_data * data, int lock_app_pid,
+ void *event);
+
+void
+lockd_window_set_scroll_property(lockw_data * data, int lock_type);
+
+void lockd_window_set_phonelock_pid(lockw_data * data, int phone_lock_pid);
+
+void
+lockd_window_mgr_ready_lock(void *data, lockw_data * lockw,
+ Eina_Bool(*create_cb) (void *, int, void *),
+ Eina_Bool(*show_cb) (void *, int, void *));
+
+void lockd_window_mgr_finish_lock(lockw_data * lockw);
+
+lockw_data *lockd_window_init(void);
+
+void lockd_create_ug_window(void *data);
+
+void lockd_destroy_ug_window(void *data);
+
+void lockd_show_phonelock_alpha_ug(void *data);
+#endif /* __LOCKD_WINDOW_MGR_H__ */
diff --git a/include/menu_daemon.h b/include/menu_daemon.h
new file mode 100755
index 0000000..6a22045
--- /dev/null
+++ b/include/menu_daemon.h
@@ -0,0 +1,49 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <bundle.h>
+#include <sys/types.h>
+#include <stdbool.h>
+
+extern void menu_daemon_init(void *data);
+extern void menu_daemon_fini(void);
+
+extern int menu_daemon_open_app(const char *pkgname);
+extern int menu_daemon_launch_app(const char *pkgname, bundle *b);
+extern void menu_daemon_launch_app_tray(void);
+
+extern bool menu_daemon_is_homescreen(pid_t pid);
+extern int menu_daemon_is_safe_mode(void);
+extern int menu_daemon_get_cradle_status(void);
+extern const char *menu_daemon_get_svoice_pkg_name(void);
+
+extern int menu_daemon_check_dead_signal(int pid);
+
+extern char *menu_daemon_get_selected_pkgname(void);
+extern void menu_daemon_open_homescreen(const char *pkgname);
+
+extern int menu_daemon_get_pm_key_ignore(int ignore_key);
+extern void menu_daemon_set_pm_key_ignore(int ignore_key, int value);
+
+extern int menu_daemon_get_volume_pid(void);
+
+
+// End of a file
diff --git a/include/pkg_event.h b/include/pkg_event.h
new file mode 100644
index 0000000..117c488
--- /dev/null
+++ b/include/pkg_event.h
@@ -0,0 +1,49 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __NOTIFIER_H__
+#define __NOTIFIER_H__
+#include <stdbool.h>
+
+#if !defined(PUBLIC)
+#define PUBLIC __attribute__((visibility("default"))) /**<All other from outside modules can access this typed API */
+#endif
+
+#if !defined(PROTECTED)
+#define PROTECTED __attribute__((visibility("hidden"))) /**<All other from outside modules can not access this directly */
+#endif
+
+#if !defined(PRIVATE)
+#define PRIVATE __attribute__((visibility("internal"))) /**<Does not export APIs to the other. only can be accessed in this module */
+#endif
+
+
+struct desktop_notifier {
+ int number;
+ int ifd;
+ Ecore_Fd_Handler *handler;
+};
+
+
+PRIVATE void pkg_event_init(void);
+PRIVATE void pkg_event_fini(void);
+
+#endif
diff --git a/include/starter-util.h b/include/starter-util.h
new file mode 100644
index 0000000..a1e2305
--- /dev/null
+++ b/include/starter-util.h
@@ -0,0 +1,38 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __STARTER_UTIL_H__
+#define __STARTER_UTIL_H__
+
+#include <stdio.h>
+#include <sys/time.h>
+
+#define WRITE_FILE_LOG(fmt, arg...) do { \
+ FILE *fp;\
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fp = fopen("/var/log/boottime", "a+");\
+ if (NULL == fp) break;\
+ fprintf(fp, "%u%09u : "fmt"\n", (int) tv.tv_sec, (int) tv.tv_usec, ##arg); \
+ fclose(fp);\
+} while (0)
+
+#endif /* __STARTER_UTIL_H__ */
diff --git a/include/starter-vconf.h b/include/starter-vconf.h
new file mode 100755
index 0000000..71c9699
--- /dev/null
+++ b/include/starter-vconf.h
@@ -0,0 +1,28 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __STARTER_VCONF_H__
+#define __STARTER_VCONF_H__
+
+#define VCONF_PRIVATE_LOCKSCREEN_PKGNAME "file/private/lockscreen/pkgname"
+#define VCONF_PRIVATE_LOCKSCREEN_DEFAULT_PKGNAME "file/private/lockscreen/default_pkgname"
+
+#endif /* __STARTER_VCONF_H__ */
diff --git a/include/starter.h b/include/starter.h
new file mode 100755
index 0000000..017bc83
--- /dev/null
+++ b/include/starter.h
@@ -0,0 +1,38 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __STARTER_H__
+#define __STARTER_H__
+
+#include <sys/time.h>
+#include <aul.h>
+#include <alarm.h>
+
+struct appdata {
+ struct timeval tv_start; /* start time */
+ int launcher_pid;
+ alarm_id_t alarm_id; /* -1 : None, others : set alarm */
+ bool wms_connected;
+};
+
+int w_launch_app(char *pkgname, bundle *b);
+
+#endif /* __STARTER_H__ */
diff --git a/include/util.h b/include/util.h
new file mode 100644
index 0000000..89573b8
--- /dev/null
+++ b/include/util.h
@@ -0,0 +1,117 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_DAEMON_UTIL_H__
+#define __MENU_DAEMON_UTIL_H__
+#include <dlog.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#define APP_TRAY_PKG_NAME "org.tizen.app-tray"
+#define MENU_SCREEN_PKG_NAME "org.tizen.menu-screen"
+#define PROVIDER_PKG_NAME "org.tizen.data-provider-master"
+#define SVOICE_PKG_NAME "org.tizen.svoice"
+#define CLUSTER_HOME_PKG_NAME "org.tizen.cluster-home"
+#define EASY_HOME_PKG_NAME "org.tizen.easy-home"
+#define CONF_PATH_NUMBER 1024
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#define LOG_TAG "STARTER"
+#endif
+
+/* Log */
+#if !defined(_W)
+#define _W(fmt, arg...) LOGW("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_D)
+#define _D(fmt, arg...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_E)
+#define _E(fmt, arg...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_SECURE_W)
+#define _SECURE_W(fmt, arg...) SECURE_LOGW("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_SECURE_D)
+#define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_SECURE_E)
+#define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#define retv_if(expr, val) do { \
+ if(expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+} while (0)
+
+#define ret_if(expr) do { \
+ if(expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+} while (0)
+
+#define goto_if(expr, val) do { \
+ if(expr) { \
+ _E("(%s) -> goto", #expr); \
+ goto val; \
+ } \
+} while (0)
+
+#define break_if(expr) { \
+ if(expr) { \
+ _E("(%s) -> break", #expr); \
+ break; \
+ } \
+}
+
+#define continue_if(expr) { \
+ if(expr) { \
+ _E("(%s) -> continue", #expr); \
+ continue; \
+ } \
+}
+
+#define PRINT_TIME(str) do { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ _D("[%s:%d] %s TIME=%u.%u", __func__, __LINE__, str, (int)tv.tv_sec, (int)tv.tv_usec); \
+} while (0)
+
+#define _F(fmt, arg...) do { \
+ FILE *fp;\
+ fp = fopen("/var/log/starter.log", "a+");\
+ if (NULL == fp) break;\
+ fprintf(fp, "[%s:%d] "fmt"\n", __func__, __LINE__, ##arg); \
+ fclose(fp);\
+} while (0)
+
+
+
+#endif /* __MENU_DAEMON_UTIL_H__ */
diff --git a/include/virtual_canvas.h b/include/virtual_canvas.h
new file mode 100644
index 0000000..2d523f8
--- /dev/null
+++ b/include/virtual_canvas.h
@@ -0,0 +1,34 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __STARTER_VIRTUAL_CANVAS_H__
+#define __STARTER_VIRTUAL_CANVAS_H__
+
+#include <Evas.h>
+#include <stdbool.h>
+
+extern Evas *virtual_canvas_create(int w, int h);
+extern bool virtual_canvas_flush_to_file(Evas *e, const char *filename, int w, int h);
+extern bool virtual_canvas_destroy(Evas *e);
+
+#endif //__STARTER_VIRTUAL_CANVAS_H__
+
+// End of a file
diff --git a/include/x11.h b/include/x11.h
new file mode 100644
index 0000000..dca365b
--- /dev/null
+++ b/include/x11.h
@@ -0,0 +1,29 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __STARTER_X11_H__
+#define __STARTER_X11_H__
+
+void prop_string_set(const char *name, const char *value);
+void prop_int_set(const char *name, unsigned int val);
+void set_window_scale(void);
+
+#endif /* __STARTER_X11_H__ */
diff --git a/include/xmonitor.h b/include/xmonitor.h
new file mode 100644
index 0000000..a5e7507
--- /dev/null
+++ b/include/xmonitor.h
@@ -0,0 +1,28 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_DAEMON_XMONITOR_H__
+#define __MENU_DAEMON_XMONITOR_H__
+
+extern int xmonitor_init(void);
+extern void xmonitor_fini(void);
+
+#endif /* __MENU_DAEMON_XMONITOR_H__ */
diff --git a/mobile/AUTHORS b/mobile/AUTHORS
new file mode 100644
index 0000000..b7f374a
--- /dev/null
+++ b/mobile/AUTHORS
@@ -0,0 +1,2 @@
+jin yoon <jinny.yoon at samsung dot com>
+seungtaek chung <seungtaek.chung at samsung dot com>
diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt
new file mode 100755
index 0000000..7d0cd55
--- /dev/null
+++ b/mobile/CMakeLists.txt
@@ -0,0 +1,101 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(starter C)
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(DATADIR "${PREFIX}/share")
+SET(LOCALEDIR "${DATADIR}/locale")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ ail
+ aul
+ capi-system-media-key
+ db-util
+ dlog
+ ecore
+ ecore-evas
+ ecore-input
+ ecore-x
+ eet
+ eina
+ elementary
+ evas
+ heynoti
+ sysman
+ syspopup-caller
+ utilX
+ vconf
+ x11
+ xcomposite
+ xext
+ appcore-efl
+ glib-2.0
+ ui-gadget-1
+ bundle
+ capi-appfw-application
+ capi-system-info
+ pkgmgr-info
+ libsystemd-daemon
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-D_GNU_SOURCE")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME}
+ src/hw_key.c
+ src/pkg_event.c
+ src/menu_daemon.c
+ src/starter.c
+ src/x11.c
+ src/xmonitor.c
+ src/lock-daemon.c
+ src/lockd-debug.c
+ src/lockd-process-mgr.c
+ src/lockd-window-mgr.c
+)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+SET(LOCK_SETTING lock-setting)
+
+ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${LOCK_SETTING})
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/starter.rule DESTINATION /opt/etc/smack/accesses.d)
+
+# install desktop file & icon
+#CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PROJECT_NAME}.desktop)
+#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION share/applications)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.service DESTINATION /usr/lib/systemd/user)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.socket DESTINATION /usr/lib/systemd/user)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.path DESTINATION /usr/lib/systemd/user)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE.Flora DESTINATION /usr/share/license/starter)
diff --git a/mobile/LICENSE.Flora b/mobile/LICENSE.Flora
new file mode 100644
index 0000000..571fe79
--- /dev/null
+++ b/mobile/LICENSE.Flora
@@ -0,0 +1,206 @@
+Flora License
+
+Version 1.1, April, 2013
+
+http://floralicense.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 Tizen Compliance Specification
+and passes the Tizen Compliance Tests 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
+ and your own copyright statement or terms and conditions do not conflict
+ the conditions stated in the License including section 3.
+
+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.1 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://floralicense.org/license/
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/mobile/NOTICE b/mobile/NOTICE
new file mode 100644
index 0000000..db64ab0
--- /dev/null
+++ b/mobile/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Flora License, Version 1.1
+Please, see the LICENSE file for Flora License, Version 1.1 terms and conditions.
diff --git a/mobile/include/hw_key.h b/mobile/include/hw_key.h
new file mode 100755
index 0000000..42d891d
--- /dev/null
+++ b/mobile/include/hw_key.h
@@ -0,0 +1,22 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+extern void destroy_key_window(void);
+extern void create_key_window(void);
+
+// End of a file
diff --git a/mobile/include/lock-daemon.h b/mobile/include/lock-daemon.h
new file mode 100755
index 0000000..268d945
--- /dev/null
+++ b/mobile/include/lock-daemon.h
@@ -0,0 +1,24 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCK_DAEMON_H__
+#define __LOCK_DAEMON_H__
+
+int start_lock_daemon(int launch_lock);
+
+#endif
diff --git a/mobile/include/lockd-debug.h b/mobile/include/lockd-debug.h
new file mode 100755
index 0000000..07a3835
--- /dev/null
+++ b/mobile/include/lockd-debug.h
@@ -0,0 +1,64 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKD_DEBUG_H__
+#define __LOCKD_DEBUG_H__
+
+#include <stdio.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "starter"
+
+#define ENABLE_LOG_SYSTEM
+
+void lockd_log_t(char *fmt, ...);
+
+#ifdef ENABLE_LOG_SYSTEM
+#define STARTER_ERR(fmt, arg...) LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
+#define STARTER_DBG(fmt, arg...) LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
+#else
+#define STARTER_ERR(fmt, arg...)
+#define STARTER_DBG(fmt, arg...)
+#endif
+
+#ifdef ENABLE_LOG_SYSTEM
+#define _ERR(fmt, arg...) do { STARTER_ERR(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:E] "fmt, __LINE__, ##arg); } while (0)
+#define _DBG(fmt, arg...) do { STARTER_DBG(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:D] "fmt, __LINE__, ##arg); } while (0)
+
+#define LOCKD_ERR(fmt, arg...) _ERR(fmt, ##arg)
+#define LOCKD_DBG(fmt, arg...) _DBG(fmt, ##arg)
+#else
+#define _ERR(...)
+#define _DBG(...)
+
+#define LOCKD_ERR(...)
+#define LOCKD_ERR(...)
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#endif
diff --git a/mobile/include/lockd-process-mgr.h b/mobile/include/lockd-process-mgr.h
new file mode 100755
index 0000000..195f73f
--- /dev/null
+++ b/mobile/include/lockd-process-mgr.h
@@ -0,0 +1,38 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKD_PROCESS_MGR_H__
+#define __LOCKD_PROCESS_MGR_H__
+
+int lockd_process_mgr_start_lock(void *data, int (*dead_cb) (int, void *),
+ int phone_lock_state);
+
+int lockd_process_mgr_restart_lock(int phone_lock_state);
+
+int lockd_process_mgr_start_phone_lock(void);
+
+int lockd_process_mgr_start_normal_lock(void *data, int (*dead_cb) (int, void *));
+
+void lockd_process_mgr_terminate_lock_app(int lock_app_pid,
+ int state);
+
+void lockd_process_mgr_terminate_phone_lock(int phone_lock_pid);
+
+int lockd_process_mgr_check_lock(int pid);
+
+#endif
diff --git a/mobile/include/lockd-window-mgr.h b/mobile/include/lockd-window-mgr.h
new file mode 100755
index 0000000..d30ab31
--- /dev/null
+++ b/mobile/include/lockd-window-mgr.h
@@ -0,0 +1,42 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKD_WINDOW_MGR_H__
+#define __LOCKD_WINDOW_MGR_H__
+
+typedef struct _lockw_data lockw_data;
+
+Eina_Bool
+lockd_window_set_window_property(lockw_data * data, int lock_app_pid,
+ void *event);
+
+Eina_Bool
+lockd_window_set_window_effect(lockw_data * data, int lock_app_pid,
+ void *event);
+
+void lockd_window_set_phonelock_pid(lockw_data * data, int phone_lock_pid);
+
+void
+lockd_window_mgr_ready_lock(void *data, lockw_data * lockw,
+ Eina_Bool(*create_cb) (void *, int, void *),
+ Eina_Bool(*show_cb) (void *, int, void *));
+
+void lockd_window_mgr_finish_lock(lockw_data * lockw);
+
+lockw_data *lockd_window_init(void);
+#endif
diff --git a/mobile/include/menu_daemon.h b/mobile/include/menu_daemon.h
new file mode 100755
index 0000000..de3e843
--- /dev/null
+++ b/mobile/include/menu_daemon.h
@@ -0,0 +1,36 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <bundle.h>
+#include <sys/types.h>
+#include <stdbool.h>
+
+extern void menu_daemon_init(void *data);
+extern void menu_daemon_fini(void);
+
+extern int menu_daemon_open_app(const char *pkgname);
+extern int menu_daemon_launch_app(const char *pkgname, bundle *b);
+
+extern bool menu_daemon_is_homescreen(pid_t pid);
+
+extern int menu_daemon_check_dead_signal(int pid);
+
+extern char *menu_daemon_get_selected_pkgname(void);
+extern void menu_daemon_open_homescreen(const char *pkgname);
+
+// End of a file
diff --git a/mobile/include/pkg_event.h b/mobile/include/pkg_event.h
new file mode 100755
index 0000000..a9fb2cd
--- /dev/null
+++ b/mobile/include/pkg_event.h
@@ -0,0 +1,46 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __NOTIFIER_H__
+#define __NOTIFIER_H__
+#include <stdbool.h>
+
+#if !defined(PUBLIC)
+#define PUBLIC __attribute__((visibility("default")))
+#endif
+
+#if !defined(PROTECTED)
+#define PROTECTED __attribute__((visibility("hidden")))
+#endif
+
+#if !defined(PRIVATE)
+#define PRIVATE __attribute__((visibility("internal")))
+#endif
+
+
+struct desktop_notifier {
+ int number;
+ int ifd;
+ Ecore_Fd_Handler *handler;
+};
+
+
+PRIVATE void pkg_event_init(void);
+PRIVATE void pkg_event_fini(void);
+
+#endif
diff --git a/mobile/include/starter-util.h b/mobile/include/starter-util.h
new file mode 100755
index 0000000..117c9a4
--- /dev/null
+++ b/mobile/include/starter-util.h
@@ -0,0 +1,35 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __STARTER_UTIL_H__
+#define __STARTER_UTIL_H__
+
+#include <stdio.h>
+#include <sys/time.h>
+
+#define WRITE_FILE_LOG(fmt, arg...) do { \
+ FILE *fp;\
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fp = fopen("/var/log/boottime", "a+");\
+ if (NULL == fp) break;\
+ fprintf(fp, "%u%09u : "fmt"\n", (int) tv.tv_sec, (int) tv.tv_usec, ##arg); \
+ fclose(fp);\
+} while (0)
+
+#endif
diff --git a/mobile/include/starter-vconf.h b/mobile/include/starter-vconf.h
new file mode 100755
index 0000000..f75bb77
--- /dev/null
+++ b/mobile/include/starter-vconf.h
@@ -0,0 +1,24 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __STARTER_VCONF_H__
+#define __STARTER_VCONF_H__
+
+#define VCONF_PRIVATE_LOCKSCREEN_PKGNAME "file/private/lockscreen/pkgname"
+
+#endif
diff --git a/mobile/include/starter.h b/mobile/include/starter.h
new file mode 100755
index 0000000..00ee1e6
--- /dev/null
+++ b/mobile/include/starter.h
@@ -0,0 +1,28 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __STARTER_H__
+#define __STARTER_H__
+
+#include <sys/time.h>
+
+struct appdata {
+ struct timeval tv_start;
+};
+
+#endif
diff --git a/mobile/include/util.h b/mobile/include/util.h
new file mode 100755
index 0000000..b59d2dc
--- /dev/null
+++ b/mobile/include/util.h
@@ -0,0 +1,97 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __MENU_DAEMON_UTIL_H__
+#define __MENU_DAEMON_UTIL_H__
+#include <dlog.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#define HOME_SCREEN_PKG_NAME "org.tizen.menu-screen"
+#define CONF_PATH_NUMBER 1024
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#define LOG_TAG "starter"
+#endif
+
+/* Log */
+#if !defined(_W)
+#define _W(fmt, arg...) LOGW("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_D)
+#define _D(fmt, arg...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_E)
+#define _E(fmt, arg...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#endif
+
+#define retv_if(expr, val) do { \
+ if(expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+} while (0)
+
+#define ret_if(expr) do { \
+ if(expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+} while (0)
+
+#define goto_if(expr, val) do { \
+ if(expr) { \
+ _E("(%s) -> goto", #expr); \
+ goto val; \
+ } \
+} while (0)
+
+#define break_if(expr) { \
+ if(expr) { \
+ _E("(%s) -> break", #expr); \
+ break; \
+ } \
+}
+
+#define continue_if(expr) { \
+ if(expr) { \
+ _E("(%s) -> continue", #expr); \
+ continue; \
+ } \
+}
+
+#define PRINT_TIME(str) do { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ _D("[%s:%d] %s TIME=%u.%u", __func__, __LINE__, str, (int)tv.tv_sec, (int)tv.tv_usec); \
+} while (0)
+
+#define _F(fmt, arg...) do { \
+ FILE *fp;\
+ fp = fopen("/var/log/starter.log", "a+");\
+ if (NULL == fp) break;\
+ fprintf(fp, "[%s:%d] "fmt"\n", __func__, __LINE__, ##arg); \
+ fclose(fp);\
+} while (0)
+
+
+
+#endif /* __MENU_DAEMON_UTIL_H__ */
diff --git a/mobile/include/x11.h b/mobile/include/x11.h
new file mode 100755
index 0000000..bad90a4
--- /dev/null
+++ b/mobile/include/x11.h
@@ -0,0 +1,26 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __STARTER_X11_H__
+#define __STARTER_X11_H__
+
+void prop_string_set(const char *name, const char *value);
+void prop_int_set(const char *name, unsigned int val);
+void set_window_scale(void);
+
+#endif
diff --git a/mobile/include/xmonitor.h b/mobile/include/xmonitor.h
new file mode 100755
index 0000000..097e613
--- /dev/null
+++ b/mobile/include/xmonitor.h
@@ -0,0 +1,25 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __MENU_DAEMON_XMONITOR_H__
+#define __MENU_DAEMON_XMONITOR_H__
+
+extern int xmonitor_init(void);
+extern void xmonitor_fini(void);
+
+#endif /* __MENU_DAEMON_XMONITOR_H__ */
diff --git a/mobile/lock-setting/CMakeLists.txt b/mobile/lock-setting/CMakeLists.txt
new file mode 100755
index 0000000..7745b83
--- /dev/null
+++ b/mobile/lock-setting/CMakeLists.txt
@@ -0,0 +1,9 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(lock-setting C)
+
+ADD_SUBDIRECTORY(lockscreen-options)
+
+# i18n
+ADD_SUBDIRECTORY(po)
+
+# End of a file
diff --git a/mobile/lock-setting/lockscreen-options/CMakeLists.txt b/mobile/lock-setting/lockscreen-options/CMakeLists.txt
new file mode 100755
index 0000000..719f98e
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/CMakeLists.txt
@@ -0,0 +1,39 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(ug-lockscreen-options C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX}/ug)
+SET(LIBDIR "${PREFIX}/lib")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(IMAGEDIR "${RESDIR}/images")
+SET(EDJEDIR "${RESDIR}/edje")
+SET(ETCDIR "${RESDIR}/etc")
+SET(VERSION 0.1.0)
+
+SET(SRCS
+ ./src/lockscreen-options.c
+ ./src/lockscreen-options-util.c
+ ./src/lockscreen-options-main.c
+)
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs_lock-screen-options REQUIRED elementary ui-gadget-1 edje evas ail capi-appfw-application)
+
+FOREACH(flag ${pkgs_lock-screen-options_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_lock-screen-options_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
diff --git a/mobile/lock-setting/lockscreen-options/include/lockscreen-options-debug.h b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-debug.h
new file mode 100755
index 0000000..ef9799b
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-debug.h
@@ -0,0 +1,48 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKSCREEN_OPTIONS_DEBUG_H__
+#define __LOCKSCREEN_OPTIONS_DEBUG_H__
+
+#include <stdio.h>
+
+#define OPENLOCK_USING_PLATFORM_DEBUG
+
+#ifdef OPENLOCK_USING_PLATFORM_DEBUG
+#ifndef LOG_TAG
+#define LOG_TAG "lockscreen-options"
+#endif
+#include <dlog.h>
+
+#define LOCKOPTIONS_DBG(fmt, args...) LOGD("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##args)
+#define LOCKOPTIONS_WARN(fmt, args...) LOGW("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##args)
+#define LOCKOPTIONS_ERR(fmt, args...) LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##args)
+#else
+#define LOCKOPTIONS_DBG(fmt, args...) do{printf("[LOCKOPTIONS_DBG][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
+#define LOCKOPTIONS_WARN(fmt, args...) do{printf("[LOCKOPTIONS_WARN][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
+#define LOCKOPTIONS_ERR(fmt, args...) do{printf("[LOCKOPTIONS_ERR][%s(%d)] "fmt " \n", __FILE__, __LINE__, ##args);}while(0);
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#endif
diff --git a/mobile/lock-setting/lockscreen-options/include/lockscreen-options-main.h b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-main.h
new file mode 100755
index 0000000..d4c05ec
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-main.h
@@ -0,0 +1,28 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKSCREEN_OPTIONS_MAIN_H__
+#define __LOCKSCREEN_OPTIONS_MAIN_H__
+
+#include <Elementary.h>
+#include "lockscreen-options.h"
+
+void lockscreen_options_main_create_view(lockscreen_options_ug_data * ug_data);
+void lockscreen_options_main_update_view();
+
+#endif
diff --git a/mobile/lock-setting/lockscreen-options/include/lockscreen-options-util.h b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-util.h
new file mode 100755
index 0000000..b0ad283
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/include/lockscreen-options-util.h
@@ -0,0 +1,48 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKSCREEN_OPTIONS_UTIL_H__
+#define __LOCKSCREEN_OPTIONS_UTIL_H__
+
+#include <Elementary.h>
+
+enum {
+ IDS_COM_SK_OK = 0,
+ IDS_COM_SK_CANCEL,
+ IDS_LOCKSCREEN_OPTIONS_SYSTEM_STRING_MAX,
+};
+
+enum {
+ IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS =
+ IDS_LOCKSCREEN_OPTIONS_SYSTEM_STRING_MAX,
+ IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS_HELP,
+ IDS_LOCKSCREEN_OPTIONS_CLOCK,
+ IDS_LOCKSCREEN_OPTIONS_HELPTEXT,
+ IDS_LOCKSCREEN_OPTIONS_HELPTEXT_HELP,
+ IDS_LOCKSCREEN_OPTIONS_APP_STRING_MAX,
+};
+
+Evas_Object *lockscreen_options_util_create_navigation(Evas_Object * parent);
+Evas_Object *lockscreen_options_util_create_layout(Evas_Object * parent,
+ const char *file,
+ const char *group);
+void lockscreen_options_util_create_seperator(Evas_Object * genlist);
+void lockscreen_options_util_create_underline(Evas_Object * genlist);
+char *lockscreen_optoins_get_string(int id);
+
+#endif
diff --git a/mobile/lock-setting/lockscreen-options/include/lockscreen-options.h b/mobile/lock-setting/lockscreen-options/include/lockscreen-options.h
new file mode 100755
index 0000000..37c478d
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/include/lockscreen-options.h
@@ -0,0 +1,64 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef __LOCKSCREEN_OPTIONS_H__
+#define __LOCKSCREEN_OPTIONS_H__
+
+#include <Elementary.h>
+#include <libintl.h>
+#include <ui-gadget.h>
+
+#define PKGNAME "ug-lockscreen-options"
+
+#define _EDJ(o) elm_layout_edje_get(o)
+#define _S(str) dgettext("sys_string", str)
+#define _(s) dgettext(PKGNAME, s)
+#define dgettext_noop(s) (s)
+#define N_(s) dgettext_noop(s)
+
+enum{
+ ENUM_LOCKSCREEN_GENLIST_STYLE_SEPERATOR = 0,
+ ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON,
+ ENUM_LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON,
+ ENUM_LOCKSCREEN_GENLIST_STYLE_HELP,
+ ENUM_LOCKSCREEN_GENLIST_STYLE_UNDERLINE
+};
+
+#define LOCKSCREEN_GENLIST_STYLE_SEPERATOR "dialogue/separator/21/with_line"
+#define LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON "dialogue/1text.1icon"
+#define LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON "dialogue/2text.1icon.6"
+#define LOCKSCREEN_GENLIST_STYLE_HELP "multiline/1text"
+#define LOCKSCREEN_GENLIST_STYLE_UNDERLINE "dialogue/separator/1/with_line"
+
+
+typedef struct _lockscreen_options_ug_data {
+ int index;
+
+ Evas_Object *win_main;
+ Evas_Object *base;
+ ui_gadget_h ug;
+
+ Evas_Object *navi_bar;
+
+ Elm_Gen_Item_Class itc_separator;
+ Elm_Gen_Item_Class itc_menu_1text1icon;
+ Elm_Gen_Item_Class itc_help_1text;
+
+} lockscreen_options_ug_data;
+
+#endif
diff --git a/mobile/lock-setting/lockscreen-options/src/lockscreen-options-main.c b/mobile/lock-setting/lockscreen-options/src/lockscreen-options-main.c
new file mode 100755
index 0000000..2ede565
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/src/lockscreen-options-main.c
@@ -0,0 +1,343 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <ui-gadget.h>
+#include <ui-gadget-module.h>
+#include <ail.h>
+
+#include "lockscreen-options.h"
+#include "lockscreen-options-debug.h"
+#include "lockscreen-options-main.h"
+#include "lockscreen-options-util.h"
+
+#include "starter-vconf.h"
+
+#define LOCKSCREEN_OPTOINS_GENLIST_ITEM_CNT 5
+
+typedef struct {
+ int glStyle;
+ int stringId;
+ Evas_Object *check;
+ void (*func) (void *data, Evas_Object * obj, void *event_info);
+} lockscreen_menu_item_info;
+
+static lockscreen_menu_item_info lockscreen_options_menu_item[] = {
+ {ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON, IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS, NULL, NULL},
+ {ENUM_LOCKSCREEN_GENLIST_STYLE_HELP, IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS_HELP, NULL, NULL},
+ {ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON, IDS_LOCKSCREEN_OPTIONS_CLOCK, NULL, NULL},
+ {ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON, IDS_LOCKSCREEN_OPTIONS_HELPTEXT, NULL, NULL},
+ {ENUM_LOCKSCREEN_GENLIST_STYLE_HELP, IDS_LOCKSCREEN_OPTIONS_HELPTEXT_HELP, NULL, NULL}
+};
+
+static Elm_Gen_Item_Class itc_menu_1text1icon;
+static Elm_Gen_Item_Class itc_menu_2text1icon;
+static Elm_Gen_Item_Class itc_help_1text;
+
+static void _lockscreen_options_main_back_cb(void *data, Evas_Object * obj,
+ void *event_info)
+{
+ lockscreen_options_ug_data *ug_data =
+ (lockscreen_options_ug_data *) data;
+
+ if (ug_data == NULL)
+ return;
+
+ ug_destroy_me(ug_data->ug);
+}
+
+static char *_lockscreen_options_main_gl_label_get(void *data,
+ Evas_Object * obj,
+ const char *part)
+{
+ if (data == NULL || part == NULL)
+ return NULL;
+
+ lockscreen_menu_item_info *lockoption_data =
+ (lockscreen_menu_item_info *) data;
+
+ if ((strcmp(part, "elm.text") == 0) ||
+ (strcmp(part, "elm.text.1") == 0)) {
+ return
+ strdup(lockscreen_optoins_get_string
+ (lockoption_data->stringId));
+ }
+
+ return NULL;
+
+}
+
+static void _lockscreen_options_set_menu_status(int stringId, int value)
+{
+ int ret = 0;
+ switch (stringId) {
+ case IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS:
+ ret = vconf_set_bool(VCONFKEY_LOCKSCREEN_EVENT_NOTIFICATION_DISPLAY, value);
+ break;
+ case IDS_LOCKSCREEN_OPTIONS_CLOCK:
+ ret = vconf_set_bool(VCONFKEY_LOCKSCREEN_CLOCK_DISPLAY, value);
+ break;
+ case IDS_LOCKSCREEN_OPTIONS_HELPTEXT:
+ ret = vconf_set_bool(VCONFKEY_LOCKSCREEN_HELP_TEXT_DISPLAY, value);
+ break;
+ default:
+ LOCKOPTIONS_DBG("NO VALID STRINGID %d", stringId);
+ break;
+ }
+}
+
+static bool _lockscreen_options_get_menu_status(int stringId)
+{
+ int status = 0;
+ int ret = 0;
+
+ switch (stringId) {
+ case IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS:
+ ret = vconf_get_bool(VCONFKEY_LOCKSCREEN_EVENT_NOTIFICATION_DISPLAY, &status);
+ break;
+ case IDS_LOCKSCREEN_OPTIONS_CLOCK:
+ ret = vconf_get_bool(VCONFKEY_LOCKSCREEN_CLOCK_DISPLAY, &status);
+ break;
+ case IDS_LOCKSCREEN_OPTIONS_HELPTEXT:
+ ret = vconf_get_bool(VCONFKEY_LOCKSCREEN_HELP_TEXT_DISPLAY, &status);
+ break;
+ default:
+ LOCKOPTIONS_DBG("NO VALID INDEX %d", stringId);
+ break;
+ }
+
+ if (ret == -1) {
+ LOCKOPTIONS_ERR("Failed to get vconfkey %d!", stringId);
+ return 0;
+ }
+
+ LOCKOPTIONS_DBG
+ ("_lockscreen_options_get_menu_status index %d Status %d", stringId,
+ status);
+
+ return status;
+}
+
+static void _lockscreen_options_check_changed_cb(void *data, Evas_Object * obj,
+ void *event_info)
+{
+ if (data == NULL || obj == NULL)
+ return;
+
+ lockscreen_menu_item_info *lockoption_data =
+ (lockscreen_menu_item_info *) data;
+
+ Eina_Bool ret;
+ int value = 0;
+
+ ret = elm_check_state_get(obj);
+
+ LOCKOPTIONS_DBG("_lockscreen_options_check_changed_cb : %s",
+ ret == EINA_TRUE ? "ON" : "OFF");
+
+ if (ret == EINA_TRUE) {
+ value = 1;
+ } else {
+ value = 0;
+ }
+
+ _lockscreen_options_set_menu_status(lockoption_data->stringId, value);
+}
+
+static Evas_Object *_lockscreen_options_main_gl_icon_get(void *data,
+ Evas_Object * obj,
+ const char *part)
+{
+ if (data == NULL || obj == NULL)
+ return NULL;
+
+ lockscreen_menu_item_info *lockoption_data =
+ (lockscreen_menu_item_info *) data;
+
+ LOCKOPTIONS_DBG("icon get stringId : %d", lockoption_data->stringId);
+
+ Evas_Object *check;
+ int value = 0;
+
+ check = elm_check_add(obj);
+ elm_object_style_set(check, "on&off");
+ evas_object_show(check);
+
+ value = _lockscreen_options_get_menu_status(lockoption_data->stringId);
+ elm_check_state_set(check, value);
+
+ evas_object_pass_events_set(check, 1);
+ evas_object_propagate_events_set(check, 0);
+
+ evas_object_smart_callback_add(check, "changed",
+ _lockscreen_options_check_changed_cb,
+ lockoption_data);
+
+ lockoption_data->check = check;
+
+ return check;
+}
+
+static void _lockscreen_options_main_gl_del(void *data, Evas_Object * obj)
+{
+ LOCKOPTIONS_DBG("_lockscreen_options_main_gl_del");
+}
+
+static void _lockscreen_options_main_gl_sel(void *data, Evas_Object * obj,
+ void *event_info)
+{
+ if (data == NULL)
+ return;
+
+ lockscreen_menu_item_info *lockoption_data = NULL;
+
+ elm_genlist_item_selected_set((Elm_Object_Item *) event_info,
+ EINA_FALSE);
+
+ Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+ lockoption_data =
+ (lockscreen_menu_item_info *) elm_object_item_data_get(item);
+ if (lockoption_data == NULL) {
+ return;
+ }
+
+ if (lockoption_data->stringId ==
+ IDS_LOCKSCREEN_OPTIONS_EVENT_NOTIFICATIONS
+ || lockoption_data->stringId == IDS_LOCKSCREEN_OPTIONS_CLOCK
+ || lockoption_data->stringId == IDS_LOCKSCREEN_OPTIONS_HELPTEXT) {
+ Eina_Bool check_state =
+ elm_check_state_get(lockoption_data->check);
+ _lockscreen_options_set_menu_status(lockoption_data->stringId,
+ !check_state);
+ elm_genlist_item_update(item);
+ }
+
+ if (lockoption_data->func != NULL) {
+ lockoption_data->func(data, obj, event_info);
+ }
+}
+
+static void _lockscreen_options_create_gl_item(Elm_Gen_Item_Class * item,
+ int glStyle)
+{
+ if (glStyle == ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON) {
+ item->item_style = LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON;
+ item->func.text_get = _lockscreen_options_main_gl_label_get;
+ item->func.content_get = _lockscreen_options_main_gl_icon_get;
+ item->func.state_get = NULL;
+ item->func.del = _lockscreen_options_main_gl_del;
+ } else if (glStyle == ENUM_LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON) {
+ item->item_style = LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON;
+ item->func.text_get = _lockscreen_options_main_gl_label_get;
+ item->func.content_get = _lockscreen_options_main_gl_icon_get;
+ item->func.state_get = NULL;
+ item->func.del = NULL;
+ } else if (glStyle == ENUM_LOCKSCREEN_GENLIST_STYLE_HELP) {
+ item->item_style = LOCKSCREEN_GENLIST_STYLE_HELP;
+ item->func.text_get = _lockscreen_options_main_gl_label_get;
+ item->func.content_get = NULL;
+ item->func.state_get = NULL;
+ item->func.del = _lockscreen_options_main_gl_del;
+ } else {
+ LOCKOPTIONS_DBG("_lockscreen_options_create_gl_item FAIL\n");
+ }
+}
+
+void lockscreen_options_main_create_view(lockscreen_options_ug_data * ug_data)
+{
+ LOCKOPTIONS_DBG("lockscreen_options_main_create_view begin\n");
+
+ Evas_Object *navi_bar = ug_data->navi_bar;
+ Evas_Object *back_button = NULL;
+ Evas_Object *genlist = NULL;
+ Elm_Object_Item *item = NULL;
+ int i = 0;
+
+ if (navi_bar == NULL) {
+ LOCKOPTIONS_WARN("navi_bar is null.");
+ return;
+ }
+
+ _lockscreen_options_create_gl_item(&(itc_menu_1text1icon),
+ ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON);
+ _lockscreen_options_create_gl_item(&(itc_menu_2text1icon),
+ ENUM_LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON);
+ _lockscreen_options_create_gl_item(&(itc_help_1text),
+ ENUM_LOCKSCREEN_GENLIST_STYLE_HELP);
+
+ genlist = elm_genlist_add(navi_bar);
+
+ elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
+ elm_object_style_set(genlist, "dialogue");
+
+ lockscreen_options_util_create_seperator(genlist);
+
+ for (i = 0; i < LOCKSCREEN_OPTOINS_GENLIST_ITEM_CNT; i++) {
+ Elm_Gen_Item_Class *itc = NULL;
+ if (lockscreen_options_menu_item[i].glStyle ==
+ ENUM_LOCKSCREEN_GENLIST_STYLE_1TEXT1ICON) {
+ itc = &(itc_menu_1text1icon);
+ elm_genlist_item_append(genlist,
+ itc,
+ &
+ (lockscreen_options_menu_item
+ [i]), NULL,
+ ELM_GENLIST_ITEM_NONE,
+ _lockscreen_options_main_gl_sel,
+ ug_data);
+ } else if(lockscreen_options_menu_item[i].glStyle ==
+ ENUM_LOCKSCREEN_GENLIST_STYLE_2TEXT1ICON) {
+ itc = &(itc_menu_2text1icon);
+ elm_genlist_item_append(genlist,
+ itc,
+ &
+ (lockscreen_options_menu_item
+ [i]), NULL,
+ ELM_GENLIST_ITEM_NONE,
+ _lockscreen_options_main_gl_sel,
+ ug_data);
+ } else if (lockscreen_options_menu_item[i].glStyle ==
+ ENUM_LOCKSCREEN_GENLIST_STYLE_HELP) {
+ itc = &(itc_help_1text);
+ item = elm_genlist_item_append(genlist,
+ itc,
+ &
+ (lockscreen_options_menu_item
+ [i]), NULL,
+ ELM_GENLIST_ITEM_NONE,
+ NULL, NULL);
+ elm_genlist_item_select_mode_set(item,
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ if(i != (LOCKSCREEN_OPTOINS_GENLIST_ITEM_CNT - 1)){
+ lockscreen_options_util_create_underline(genlist);
+ }
+ } else {
+ LOCKOPTIONS_WARN("lockscreen option has no such type.");
+ return;
+ }
+ }
+
+ back_button = elm_button_add(navi_bar);
+ elm_object_style_set(back_button, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(back_button, "clicked",
+ _lockscreen_options_main_back_cb,
+ ug_data);
+
+ elm_naviframe_item_push(navi_bar, _("IDS_ST_BODY_LOCK_SCREEN") , back_button, NULL, genlist, NULL);
+}
diff --git a/mobile/lock-setting/lockscreen-options/src/lockscreen-options-util.c b/mobile/lock-setting/lockscreen-options/src/lockscreen-options-util.c
new file mode 100755
index 0000000..6f0b84c
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/src/lockscreen-options-util.c
@@ -0,0 +1,148 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include "lockscreen-options-debug.h"
+#include "lockscreen-options.h"
+#include "lockscreen-options-util.h"
+
+const char *sys_str_table[] = {
+ "IDS_COM_SK_OK",
+ "IDS_COM_SK_CANCEL",
+};
+
+const char *app_str_table[] = {
+ "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS",
+ "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN",
+ "IDS_ST_BODY_CLOCK",
+ "IDS_IM_BODY_HELP_TEXT",
+ "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+};
+
+static Elm_Gen_Item_Class itc_underline;
+static Elm_Gen_Item_Class itc_separator;
+
+Evas_Object *lockscreen_options_util_create_navigation(Evas_Object * parent)
+{
+ Evas_Object *navi_bar = NULL;
+
+ if (parent == NULL) {
+ LOCKOPTIONS_WARN("Parent is null.");
+ return NULL;
+ }
+
+ navi_bar = elm_naviframe_add(parent);
+ if (navi_bar == NULL) {
+ LOCKOPTIONS_ERR("Cannot add naviagtionbar.");
+ return NULL;
+ }
+
+ elm_object_part_content_set(parent, "elm.swallow.content", navi_bar);
+
+ evas_object_show(navi_bar);
+
+ return navi_bar;
+}
+
+Evas_Object *lockscreen_options_util_create_layout(Evas_Object * parent,
+ const char *file,
+ const char *group)
+{
+ Evas_Object *layout = NULL;
+
+ if (parent == NULL) {
+ LOCKOPTIONS_WARN("Parent is null.");
+ return NULL;
+ }
+
+ layout = elm_layout_add(parent);
+ if (layout == NULL) {
+ LOCKOPTIONS_ERR("Cannot add layout.");
+ return NULL;
+ }
+
+ if ((file != NULL) && (group != NULL)) {
+ elm_layout_file_set(layout, file, group);
+ }
+
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ evas_object_show(layout);
+
+ return layout;
+}
+
+void lockscreen_options_util_create_seperator(Evas_Object * genlist)
+{
+ if (NULL == genlist)
+ return;
+
+ Elm_Object_Item *item = NULL;
+
+ itc_separator.item_style = LOCKSCREEN_GENLIST_STYLE_SEPERATOR;
+ itc_separator.func.text_get = NULL;
+ itc_separator.func.content_get = NULL;
+ itc_separator.func.state_get = NULL;
+ itc_separator.func.del = NULL;
+
+ item =
+ elm_genlist_item_append(genlist, &(itc_separator), NULL, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(item,
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+}
+
+void lockscreen_options_util_create_underline(Evas_Object * genlist)
+{
+ if (NULL == genlist)
+ return;
+
+ Elm_Object_Item *item = NULL;
+
+ itc_underline.item_style = LOCKSCREEN_GENLIST_STYLE_UNDERLINE;
+ itc_underline.func.text_get = NULL;
+ itc_underline.func.content_get = NULL;
+ itc_underline.func.state_get = NULL;
+ itc_underline.func.del = NULL;
+
+ item =
+ elm_genlist_item_append(genlist, &(itc_underline), NULL, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(item,
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+}
+
+char *lockscreen_optoins_get_string(int id)
+{
+ LOCKOPTIONS_DBG("get string id : %d\n", id);
+
+ char *str = NULL;
+
+ if (id < IDS_LOCKSCREEN_OPTIONS_SYSTEM_STRING_MAX) {
+ str = dgettext("sys_string", sys_str_table[id]);
+ } else {
+ str =
+ dgettext(PKGNAME,
+ app_str_table[id -
+ IDS_LOCKSCREEN_OPTIONS_SYSTEM_STRING_MAX]);
+ }
+
+ LOCKOPTIONS_DBG("get string : %s\n", str);
+
+ return str;
+}
diff --git a/mobile/lock-setting/lockscreen-options/src/lockscreen-options.c b/mobile/lock-setting/lockscreen-options/src/lockscreen-options.c
new file mode 100755
index 0000000..de5eb00
--- /dev/null
+++ b/mobile/lock-setting/lockscreen-options/src/lockscreen-options.c
@@ -0,0 +1,213 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#ifndef UG_MODULE_API
+#define UG_MODULE_API __attribute__ ((visibility("default")))
+#endif
+
+#include <Elementary.h>
+#include <ui-gadget-module.h>
+
+#include "lockscreen-options.h"
+#include "lockscreen-options-util.h"
+#include "lockscreen-options-main.h"
+
+static Evas_Object *create_bg(Evas_Object * parent)
+{
+ Evas_Object *bg = elm_bg_add(parent);
+
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_object_style_set(bg, "group_list");
+
+ elm_object_part_content_set(parent, "elm.swallow.bg", bg);
+ evas_object_show(bg);
+
+ return bg;
+}
+
+static Evas_Object *create_fullview(Evas_Object * parent,
+ lockscreen_options_ug_data * ug_data)
+{
+ Evas_Object *base = NULL;
+ Evas_Object *navi_bar = NULL;
+
+ base = lockscreen_options_util_create_layout(parent, NULL, NULL);
+
+ elm_layout_theme_set(base, "layout", "application", "default");
+ elm_win_resize_object_add(parent, base);
+
+ elm_win_indicator_mode_set(parent, ELM_WIN_INDICATOR_SHOW);
+
+ create_bg(base);
+
+ navi_bar = lockscreen_options_util_create_navigation(base);
+ ug_data->navi_bar = navi_bar;
+
+ lockscreen_options_main_create_view(ug_data);
+
+ return base;
+}
+
+static Evas_Object *create_frameview(Evas_Object * parent,
+ lockscreen_options_ug_data * ug_data)
+{
+ Evas_Object *base = NULL;
+
+ return base;
+}
+
+static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service,
+ void *priv)
+{
+ Evas_Object *parent = NULL;
+ Evas_Object *win_main = NULL;
+ lockscreen_options_ug_data *ug_data = NULL;
+
+ if (!ug || !priv)
+ return NULL;
+
+ bindtextdomain(PKGNAME, "/usr/ug/res/locale");
+
+ ug_data = priv;
+ ug_data->ug = ug;
+
+ parent = ug_get_parent_layout(ug);
+ if (!parent)
+ return NULL;
+
+ win_main = ug_get_window();
+ if (!win_main) {
+ return NULL;
+ }
+
+ ug_data->win_main = win_main;
+
+ if (mode == UG_MODE_FULLVIEW)
+ ug_data->base = create_fullview(parent, ug_data);
+ else
+ ug_data->base = create_frameview(parent, ug_data);
+
+ return ug_data->base;
+}
+
+static void on_start(ui_gadget_h ug, service_h service, void *priv)
+{
+}
+
+static void on_pause(ui_gadget_h ug, service_h service, void *priv)
+{
+
+}
+
+static void on_resume(ui_gadget_h ug, service_h service, void *priv)
+{
+
+}
+
+static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
+{
+ lockscreen_options_ug_data *ug_data;
+
+ if (!ug || !priv)
+ return;
+
+ ug_data = priv;
+ evas_object_del(ug_data->base);
+ ug_data->base = NULL;
+}
+
+static void on_message(ui_gadget_h ug, service_h msg, service_h service,
+ void *priv)
+{
+}
+
+static void on_event(ui_gadget_h ug, enum ug_event event, service_h service,
+ void *priv)
+{
+ switch (event) {
+ case UG_EVENT_LOW_MEMORY:
+ break;
+ case UG_EVENT_LOW_BATTERY:
+ break;
+ case UG_EVENT_LANG_CHANGE:
+ break;
+ case UG_EVENT_ROTATE_PORTRAIT:
+ break;
+ case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
+ break;
+ case UG_EVENT_ROTATE_LANDSCAPE:
+ break;
+ case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
+ break;
+ default:
+ break;
+ }
+}
+
+static void on_key_event(ui_gadget_h ug, enum ug_key_event event,
+ service_h service, void *priv)
+{
+ if (!ug)
+ return;
+
+ switch (event) {
+ case UG_KEY_EVENT_END:
+ ug_destroy_me(ug);
+ break;
+ default:
+ break;
+ }
+}
+
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+ lockscreen_options_ug_data *ug_data;
+
+ if (!ops)
+ return -1;
+
+ ug_data = calloc(1, sizeof(lockscreen_options_ug_data));
+ if (!ug_data)
+ return -1;
+
+ ops->create = on_create;
+ ops->start = on_start;
+ ops->pause = on_pause;
+ ops->resume = on_resume;
+ ops->destroy = on_destroy;
+ ops->message = on_message;
+ ops->event = on_event;
+ ops->key_event = on_key_event;
+ ops->priv = ug_data;
+ ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+ return 0;
+}
+
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+ lockscreen_options_ug_data *ug_data;
+
+ if (!ops)
+ return;
+
+ ug_data = ops->priv;
+ if (ug_data)
+ free(ug_data);
+}
diff --git a/mobile/lock-setting/po/CMakeLists.txt b/mobile/lock-setting/po/CMakeLists.txt
new file mode 100755
index 0000000..647202a
--- /dev/null
+++ b/mobile/lock-setting/po/CMakeLists.txt
@@ -0,0 +1,26 @@
+# for i18n
+
+SET(LOCKPONAME "ug-lockscreen-options")
+
+SET(POFILES ar.po az.po bg.po ca.po cs.po da.po de_DE.po el_GR.po en.po en_PH.po en_US.po es_ES.po es_US.po fi.po fr_CA.po fr_FR.po ga.po gl.po hi.po hr.po hu.po hy.po is.po it_IT.po ja_JP.po ka.po kk.po ko_KR.po lt.po lv.po mk.po nb.po nl_NL.po pl.po pt_BR.po pt_PT.po ro.po ru_RU.po sk.po sl.po sr.po sv.po tr_TR.po uk.po uz.po zh_CN.po zh_HK.po zh_SG.po zh_TW.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+
+INSTALL(FILES ${moFile} DESTINATION /usr/ug/res/locale/${lang}/LC_MESSAGES RENAME ${LOCKPONAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/mobile/lock-setting/po/ar.po b/mobile/lock-setting/po/ar.po
new file mode 100644
index 0000000..7c0e6a6
--- /dev/null
+++ b/mobile/lock-setting/po/ar.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "قفل الشاشة"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "عرض إخطارات الحدث على شاشة القفل"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "إشعارات الحدث"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "الساعة"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "الطقس"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "تعيين اختصارات على شاشة القفل"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "الاختصارات"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "ساعة ثنائية"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "عرض نص التعليمات على شاشة القفل"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "عرض ‏‫ساعة مزدوجة على شاشة القفل أثناء التجوال"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "انقر مع الاستمرار فوق الشاشة مع تدوير الجهاز لفتح الكاميرا"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "وصول سريع إلى الكاميرا"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "تعيين اختصارات"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "قم بالسحب والإسقاط لتغيير الترتيب"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "اختر تطبيق"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "‏‫انقر فوق الاختصار لتخصيص تطبيق"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "تعديل الاختصارات"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "نص المساعدة"
+
diff --git a/mobile/lock-setting/po/az.po b/mobile/lock-setting/po/az.po
new file mode 100644
index 0000000..305092a
--- /dev/null
+++ b/mobile/lock-setting/po/az.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Ekranı kilidləyin"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Kilid ekranında tədbir bildirişlərinə bax"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Tədbir bildirişləri"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Saat"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Hava"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Kilid ekranına qısayol qur"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Çevik düymələr"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "İkili saat"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Kilid ekranında kömək mətnini göstər"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Rouminq zamanı kilid ekranında ikili saat göstər"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Kameranı açmaq üçün ekrana vurun saxlayaraq cihazı fırladın"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kamera çevik girişi"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Qısayolları qur"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Sıranı dəyişmək üçün dartıb buraxın"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Proqramı seç"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Proqrama təyin etmək üçün qısayola vur"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Qısayolları redaktə edin"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Yardımçı mətn"
+
diff --git a/mobile/lock-setting/po/bg.po b/mobile/lock-setting/po/bg.po
new file mode 100644
index 0000000..1033cf8
--- /dev/null
+++ b/mobile/lock-setting/po/bg.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Заключен екран"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Преглед на известията за събития на заключения екран"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Уведомявания за събития"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Часовник"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Време"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Задайте бързите клавиши на заключения екран"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Бърз достъп"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Двоен часовник"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Показвай текста на помощта на заключения екран"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Покажи двоен часовник на заключения екран в роуминг"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Чукнете и задръжте екрана, докато въртите устройството, за да отворите Камера"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Бърз достъп с камера"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Задаване на бързи команди"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Плъзнете и пуснете, за да промените реда"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Избор на приложение"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Чукнете върху бърза команда, за да зададете приложение"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Редактиране на бързи клавиши"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Помощен текст"
+
diff --git a/mobile/lock-setting/po/ca.po b/mobile/lock-setting/po/ca.po
new file mode 100644
index 0000000..e6a6351
--- /dev/null
+++ b/mobile/lock-setting/po/ca.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Bloquejar pantalla"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Veure notificacions d'esdeveniments a pantalla de bloqueig"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Avisos d'esdeveniments"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Rellotge"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Temps"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir accessos directes a la pantalla de bloqueig"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Accessos directes"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Rellotge dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostrar text d'ajuda a la pantalla de bloqueig"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar rellotge dual a la pantalla de bloqueig en itinerància"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Mantingui tocada la pantalla mentre gira el dispositiu per obrir la Càmera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Accés ràpid a càmera"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Definir editar accessos directes"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrossegui i deixi anar per canviar l'ordre"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicació"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Toqui l'accés directe per assignar l'aplicació"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar accessos directes"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Text ajuda"
+
diff --git a/mobile/lock-setting/po/cs.po b/mobile/lock-setting/po/cs.po
new file mode 100644
index 0000000..5a6e267
--- /dev/null
+++ b/mobile/lock-setting/po/cs.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Zamknout displej"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Zobrazení upozorňování na události na zamknutém displeji"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Upozorňování na události"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Hodiny"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Počasí"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Nastavit zástupce na zamknutém displeji"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Zkratky"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Duál. hodiny"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Zobrazit text nápovědy na zamknutém displeji"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Zobrazit duální hodiny na zamknutém displeji během roamingu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Klepnutím na displej a podržením při otáčení zařízení otevřete Fotoaparát"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Rychlý přístup k fotoap."
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Nastavit zástupce"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Přetažením změníte pořadí"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Vyberte aplikaci"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Chcete-li přiřadit aplikaci, klepněte na zástupce"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Upravit zástupce"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Nápověda"
+
diff --git a/mobile/lock-setting/po/da.po b/mobile/lock-setting/po/da.po
new file mode 100644
index 0000000..d9a26bb
--- /dev/null
+++ b/mobile/lock-setting/po/da.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Låseskærm"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Vis begivenhedsbeskeder på den låste skærm"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Begivenhedsbeskeder"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ur"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Vejr"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Indstil genveje på låseskærm"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Genveje"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dobbelt-ur"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Vis hjælpetekst på låst skærm"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Vis dobbelt ur på låseskærm under roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tryk og hold på skærmen, mens du roterer enheden, for at åbne Kamera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Hurtig adgang til kamera"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Angiv genveje"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Træk og slip for at skifte rækkefølge"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Vælg program"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tryk på genvej for at tildele program"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Redigér genveje"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Hjælpetekst"
+
diff --git a/mobile/lock-setting/po/de_DE.po b/mobile/lock-setting/po/de_DE.po
new file mode 100644
index 0000000..70a4592
--- /dev/null
+++ b/mobile/lock-setting/po/de_DE.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Sperrbildschirm"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ereignisbenachrichtigungen auf Sperrbildschirm anzeigen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Ereignisbenachrichtig."
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Uhr"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Wetter"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Schnellzugriffe auf gesperrtem Bildschirm festlegen"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Schnellzugriffe"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dual-Uhr"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Hilfetext auf gesperrtem Bildschirm anzeigen"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Dual-Uhr beim Roaming auf gesperrtem Bildschirm anzeigen"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tippen Sie auf den Bildschirm und halten Sie ihn, während Sie das Gerät drehen, um die Kamera zu öffnen."
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kamera-Schnellzugriff"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Schnellzugriffe festlegen"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Ziehen und ablegen, um die Reihenfolge zu ändern."
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Anwendung auswählen"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Auf Shortcut tippen, um Anwendung zuzuweisen."
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Schnellzugriffe bearbeiten"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Hilfetext"
+
diff --git a/mobile/lock-setting/po/el_GR.po b/mobile/lock-setting/po/el_GR.po
new file mode 100644
index 0000000..151b419
--- /dev/null
+++ b/mobile/lock-setting/po/el_GR.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Οθόνη κλειδώματος"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Προβολή ειδοποιήσεων συμβάντων στην οθόνη κλειδώματος"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Ειδοποιήσεις συμβάντων"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ρολόι"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Καιρός"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Ρύθμιση συντομεύσεων στην οθόνη κλειδώματος"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Συντομεύσεις"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Διπλό ρολόι"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Εμφάνιση κειμένου βοήθειας στην οθόνη κλειδώματος"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Εμφάνιση διπλού ρολογιού στην οθόνη κλειδώματος κατά την περιαγωγή"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Πατήστε παρατεταμένα στην οθόνη και κατά την περιστροφή της συσκευής για να ανοίξετε την Κάμερα"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Γρήγορη πρόσβαση κάμερας"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Ρύθμιση συντομεύσεων"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Μεταφέρετε και αποθέστε για να αλλάξετε τη σειρά"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Επιλογή εφαρμογής"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Πατήστε τη συντόμευση για αντιστοίχιση εφαρμογής"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Επεξεργασία συντομεύσεων"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Κείμενο βοήθειας"
+
diff --git a/mobile/lock-setting/po/en.po b/mobile/lock-setting/po/en.po
new file mode 100644
index 0000000..5c14712
--- /dev/null
+++ b/mobile/lock-setting/po/en.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Lock screen"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "View event notifications on the lock screen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Event notifications"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Clock"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Weather"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Set shortcuts on lock screen"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Shortcuts"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dual clock"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Show help text on lock screen"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Show dual clock on lock screen when roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tap and hold the screen while rotating the device to open Camera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Camera quick access"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Set shortcuts"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Drag and drop to change order"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Select application"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tap shortcut to assign application"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Edit shortcuts"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Help text"
+
diff --git a/mobile/lock-setting/po/en_PH.po b/mobile/lock-setting/po/en_PH.po
new file mode 100644
index 0000000..5c14712
--- /dev/null
+++ b/mobile/lock-setting/po/en_PH.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Lock screen"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "View event notifications on the lock screen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Event notifications"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Clock"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Weather"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Set shortcuts on lock screen"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Shortcuts"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dual clock"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Show help text on lock screen"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Show dual clock on lock screen when roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tap and hold the screen while rotating the device to open Camera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Camera quick access"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Set shortcuts"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Drag and drop to change order"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Select application"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tap shortcut to assign application"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Edit shortcuts"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Help text"
+
diff --git a/mobile/lock-setting/po/en_US.po b/mobile/lock-setting/po/en_US.po
new file mode 100644
index 0000000..a1db6bc
--- /dev/null
+++ b/mobile/lock-setting/po/en_US.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Lock screen"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "View event notifications on the lock screen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Event notifications"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Clock"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Weather"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Set shortcuts on lock screen."
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Shortcuts"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dual clock"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Show help text on lock screen."
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Show dual clock on lock screen when roaming."
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tap and hold the screen while rotating the device to open Camera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Camera quick access"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Set shortcuts"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Drag and drop to change order"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Select application"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tap shortcut to assign application"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Edit shortcuts"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Help text"
+
diff --git a/mobile/lock-setting/po/es_ES.po b/mobile/lock-setting/po/es_ES.po
new file mode 100644
index 0000000..407f8d7
--- /dev/null
+++ b/mobile/lock-setting/po/es_ES.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Pantalla de bloqueo"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ver notificaciones de eventos en la pantalla de bloqueo"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificaciones de evento"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Reloj"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Clima"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir accesos directos en pantalla de bloqueo"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Accesos directos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Reloj dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostrar texto de ayuda en pantalla de bloqueo"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar reloj dual en pantalla de bloqueo en itinerancia"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Mantenga pulsada la pantalla mientras gira el dispositivo para abrir la Cámara"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acceso rápido a Cámara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Definir accesos directos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastrar y soltar para cambiar el orden"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicación"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Toque el acceso directo para asignar la aplicación"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar accesos directos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de ayuda"
+
diff --git a/mobile/lock-setting/po/es_MX.po b/mobile/lock-setting/po/es_MX.po
new file mode 100644
index 0000000..a3ce4bd
--- /dev/null
+++ b/mobile/lock-setting/po/es_MX.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Bloqueo de pantalla"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ver las notificaciones de eventos en la pantalla de bloqueo"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificaciones de eventos"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Reloj"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Clima"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir atajos en pantalla bloqueada"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Atajos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Reloj dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostrar texto de ayuda en pantalla bloqueada"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar el reloj dual en la pantalla bloqueada durante el roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Mantenga pulsada la pantalla mientras gira el dispositivo para abrir la Cámara"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acceso rápido a cámara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Configurar atajos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastre y coloque para cambiar el orden"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicación"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Pulse el atajo para asignar la aplicación"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar atajos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de ayuda"
+
diff --git a/mobile/lock-setting/po/es_US.po b/mobile/lock-setting/po/es_US.po
new file mode 100644
index 0000000..43a19d9
--- /dev/null
+++ b/mobile/lock-setting/po/es_US.po
@@ -0,0 +1,51 @@
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ver las notificaciones de eventos en la pantalla de bloqueo"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificaciones de eventos"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Reloj"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Clima"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir atajos en pantalla bloqueada"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Atajos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Reloj dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostrar texto de ayuda en pantalla bloqueada"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar el reloj dual en la pantalla bloqueada durante el roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Mantenga pulsada la pantalla mientras gira el dispositivo para abrir la Cámara"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acceso rápido a cámara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Configurar atajos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastre y coloque para cambiar el orden"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicación"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Pulse el atajo para asignar la aplicación"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar atajos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de ayuda"
+
diff --git a/mobile/lock-setting/po/et.po b/mobile/lock-setting/po/et.po
new file mode 100644
index 0000000..073973f
--- /dev/null
+++ b/mobile/lock-setting/po/et.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Lukusta ekraan"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Vaadake sündmuste teavitusi lukustatud ekraanil"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Sündmuse teavitused"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Kell"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Ilm"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Määra otseteed lukustusekraanil"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Otseteed"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Kaksikkell"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Näita spikrit lukustusekraanil"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Kuva rändluse ajal lukustusekraanil kaksikkell"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Kaamera avamiseks toksake ja hoidke sõrme ekraanil ning samal ajal pöörake seadet"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kiirjuurdepääs kaamerale"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Määra otseteed"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Lohistage, et muuta järjestust"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Vali rakendus"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Toksake otseteed, et määrata rakendust"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Muuda otseteid"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Spikker"
+
diff --git a/mobile/lock-setting/po/eu.po b/mobile/lock-setting/po/eu.po
new file mode 100644
index 0000000..8ba1000
--- /dev/null
+++ b/mobile/lock-setting/po/eu.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Blokeatu pantaila"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ikusi gertaeren jakinarazpenak blokeo pantailan"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Gertaeren jakinarazpenak"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ordularia"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Eguraldia"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Ezarri lasterbideak blokeo pantailan"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Sarrera zuzenak"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Erloju duala"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Erakutsi laguntza testua blokeo pantailan"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Erakutsi erloju duala blokeo pantailan ibiltaritzan"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Ukitu eta eutsi pantaila gailua biratu bitartean Kamera irekitzeko"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kameraren sarbide azkarra"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Ezarri lasterbideak"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastatu eta jaregin ordena aldatzeko"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Hautatu aplikazioa"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Ukitu lasterbidea aplikazioa esleitzeko"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editatu lasterbideak"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Laguntza testua"
+
diff --git a/mobile/lock-setting/po/fi.po b/mobile/lock-setting/po/fi.po
new file mode 100644
index 0000000..856e0a0
--- /dev/null
+++ b/mobile/lock-setting/po/fi.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Lukitusnäyttö"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Näytä tapahtumailmoitukset lukitusnäytössä"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Tapahtumailmoitukset"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Kello"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Sää"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Määritä pikanäppäimet lukitusnäytössä"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Pikanäppäimet"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Kaksoiskello"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Ohjetekstin näyttäminen lukitusnäytössä"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Näytä kaksoiskello lukitusnäytössä verkkovierailun aikana"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Avaa kamera painamalla näyttöä jonkin aikaa ja kiertämällä samalla laitetta"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kameran pikakäyttö"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Määritä pikavalinnat"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Muuta järjestystä vetämällä ja pudottamalla"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Valitse sovellus"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Määritä sovellus napauttamalla pikakuvaketta"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Muokkaa pikavalintoja"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Ohjeteksti"
+
diff --git a/mobile/lock-setting/po/fr_CA.po b/mobile/lock-setting/po/fr_CA.po
new file mode 100644
index 0000000..6982f65
--- /dev/null
+++ b/mobile/lock-setting/po/fr_CA.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Écran verrouillé"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Voir les notifications d'évènements sur l'écran de verrouillage"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notifications évènements"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Horloge"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Météo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Sélectionner les raccourcis sur l'écran de verrouillage"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Raccourcis"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Deux horloges"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Afficher texte d'aide sur l'écran de verrouillage"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Afficher double horloge sur l'écran de verrouillage en itinérance"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Touchez longuement l'écran et faites pivoter l'appareil pour lancer l'appareil photo"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Accès rapide app. photo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Définir des raccourcis"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Glisser et déposer pour modifier l'ordre"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Sélectionnez une application"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Touchez le raccourci pour l'affecter à l'application"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Modifier les raccourcis"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texte d'aide"
+
diff --git a/mobile/lock-setting/po/fr_FR.po b/mobile/lock-setting/po/fr_FR.po
new file mode 100644
index 0000000..0ffb78b
--- /dev/null
+++ b/mobile/lock-setting/po/fr_FR.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Écran de verrouillage"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Voir les notifications d'événements sur l'écran de verrouillage"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notifications événements"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Horloge"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Météo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Définir les raccourcis à afficher sur l'écran de verrouillage"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Raccourcis"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Double horloge"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Afficher le texte d'aide au déverrouillage sur l'écran"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Afficher la double horloge sur l'écran de verrouillage en itinérance"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Maintenez votre doigt appuyé sur l'écran et faites pivoter l'appareil pour ouvrir l'appareil photo"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Accès rapide app. photo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Définir des raccourcis"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Glisser et déposer pour modifier l'ordre"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Sélectionnez une application"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Appuyez sur le raccourci pour l'affecter à l'application"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Modifier les raccourcis"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texte d'aide"
+
diff --git a/mobile/lock-setting/po/ga.po b/mobile/lock-setting/po/ga.po
new file mode 100644
index 0000000..54b0785
--- /dev/null
+++ b/mobile/lock-setting/po/ga.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Glasáil an scáileán"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Amharc ar fhógraí imeachta ar an scáileán glasála"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Fógra faoi imeachtaí"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Clog"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Aimsir"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Socraigh aicearraí ar an scáileán glasála"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Aicearraí"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Déchlog"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Taispeáin téacs cabhrach ar an scáileán glasála"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Taispeáin déchlog ar an scáileáin glasála le linn fánaíocht"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tapáil agus coinnigh an scáileán agus an gléas á rothlú le Ceamara a oscailt"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Mear-rochtain ar cheamara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Socraigh aicearraí"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Tarraing agus scaoil leis an ord a athrú"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Roghnaigh feidhmchlár"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tapáil aicearra le feidhmchlár a shannadh"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Cuir aicearraí in eagar"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Téacs cabhrach"
+
diff --git a/mobile/lock-setting/po/gl.po b/mobile/lock-setting/po/gl.po
new file mode 100644
index 0000000..d1f01aa
--- /dev/null
+++ b/mobile/lock-setting/po/gl.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Bloquear pantalla"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ver notificacións de eventos na pantalla de bloqueo"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificacións de eventos"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Reloxo"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Tempo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir os atallos na pantalla de bloqueo"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Atallos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Reloxo dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Amosa texto de axuda na pantalla de bloqueo"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Amosa o reloxo dual na pantalla de bloqueo durante a itinerancia"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Mantén tocada a pantalla mentres xiras o dispositivo para abrir a cámara"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acceso rápido á cámara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Definir atallos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastra e solta para cambiar a orde"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicación"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Toca o atallo ao que desexas asignar a aplicación"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar atallos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de axuda"
+
diff --git a/mobile/lock-setting/po/hi.po b/mobile/lock-setting/po/hi.po
new file mode 100644
index 0000000..1dc2c7e
--- /dev/null
+++ b/mobile/lock-setting/po/hi.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "स्क्रीन लॉक करें"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "लॉक स्क्रीन पर प्रसंग अधिसूचनाएँ देखें"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "प्रसंग अधिसूचनाएँ"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "घड़ी"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "मौसम"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "लॉक स्‍क्रीन पर शॉर्टकट्स सेट करें"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "शार्टकट्स"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "दोहरी घड़ी"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "लॉक स्क्रीन पर मदद टेक्स्ट दिखाता है"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "जब रोमिंग में हों तब लॉक स्‍क्रीन पर डुअल क्लॉक दिखाएँ"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "कैमरा खोलनें के लिए डिवाइस को घुमाते समय स्क्रीन को टैप और होल्ड करें"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "कैमरा क्विक ऍक्सेस"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "शॉर्टकट्स सेट करें"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "क्रम बदलने के लिए ड्रैग और ड्रॉप करें"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "एप्लीकेशन चुनें"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "एप्लीकेशन असाइन करने के लिए शॉर्टकट टैप करें"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "शॉर्टकट्स संपादित करें"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "सहायता टेक्स्ट"
+
diff --git a/mobile/lock-setting/po/hr.po b/mobile/lock-setting/po/hr.po
new file mode 100644
index 0000000..86c6896
--- /dev/null
+++ b/mobile/lock-setting/po/hr.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Zaslon zaključavanja"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Vidi obavijesti o događaju na zaslonu zaključavanja"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Obavijesti o događaju"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Sat"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Prognoza"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Postavi prečace na zaslonu zaključavanja"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Prečaci"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dvostruki sat"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Prikaži tekst pomoći na zaslonu zaključavanja"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Prikaži dvostruki sat na zaslonu zaključavanja u roamingu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Dodirnite i držite zaslon dok okrećete uređaj da biste uključili fotoaparat"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Brzi pristup fotoaparatu"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Postavi prečace"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Dovucite i ispustite za promjenu redoslijeda"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Odaberi aplikaciju"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Dodaj prečac za dodjeljivanje aplikacije"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Uredi prečace"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Upute"
+
diff --git a/mobile/lock-setting/po/hu.po b/mobile/lock-setting/po/hu.po
new file mode 100644
index 0000000..7028c02
--- /dev/null
+++ b/mobile/lock-setting/po/hu.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Képernyő lezárása"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Eseményértesítések megjelenítése a zárolt képernyőn"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Eseményértesítések"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Óra"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Időjárás"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Zárolt képernyő parancsikonjainak beállítása"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Gyorsgombok"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Kettős óra"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Súgó megjelenítése a zárolt képernyőn"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Második óra megjelenítése a zárolt képernyőn roaming esetén"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "A Fényképező megnyitásához érintse meg a képernyőt, és forgassa el az eszközt"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Gyors fényképezés"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Parancsikonok beállítása"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Az elemek áthúzásával megváltoztathatja a sorrendet"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Alkalmazás kiválasztása"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Alkalmazás hozzárendeléséhez érintse meg a parancsikont"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Ikonok szerkesztése"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Súgószöveg"
+
diff --git a/mobile/lock-setting/po/hy.po b/mobile/lock-setting/po/hy.po
new file mode 100644
index 0000000..6916644
--- /dev/null
+++ b/mobile/lock-setting/po/hy.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Կողպել էկրանը"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Դիտել իրադարձության ծանուցումները կողպված էկրանին"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Իրադարձութ. ծանուցումներ"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ժամացույց"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Եղանակ"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Դնել դյուրանցումներ կողպված էկրանին"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Արագ անցումներ"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Երկակի ժամացույց"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Ցույց տալ օգնության տեքստը կողպված էկրանի վրա"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Ռոումինգի ժամանակ ցույց տալ կրկնակի ժամացույցը կողպված էկրանին"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Թակեք և պահեք էկրանը սարքը պտտելու ընթացքում՝ Խցիկը բացելու համար"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Խցիկի արագ մուտք"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Դնել դյուրանցումներ"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Քարշել և թողնել՝ կարգը փոխելու համար"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Ընտրել ծրագիր"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Թակել դյուրանցումը՝ ծրագիր վերագրելու համար"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Խմբագրել դյուրանցումները"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Օգնության տեքստ"
+
diff --git a/mobile/lock-setting/po/is.po b/mobile/lock-setting/po/is.po
new file mode 100644
index 0000000..5693eed
--- /dev/null
+++ b/mobile/lock-setting/po/is.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Læsa skjá"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Skoða viðburðatilkynningar á lásskjá"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Viðburðatilkynningar"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Klukka"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Veður"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Stilla flýtileiðir á læstum skjá"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Flýtileiðir"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Tvöföld klukka"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Sýna hjálpartexta á lásskjá"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Sýna tvöfalda klukku á lásskjá í reiki"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Pikkaðu á og haltu fingrinum á skjánum á meðan þú snýrð tækinu til að opna Myndavélina"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Flýtiaðgangur myndavélar"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Stilla flýtileiðir"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Dragðu og slepptu til að breyta röð"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Velja forrit"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Pikkaðu á flýtileið til að úthluta forriti"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Breyta flýtileiðum"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Hjálpartexti"
+
diff --git a/mobile/lock-setting/po/it_IT.po b/mobile/lock-setting/po/it_IT.po
new file mode 100644
index 0000000..d39fd3c
--- /dev/null
+++ b/mobile/lock-setting/po/it_IT.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Schermata di blocco"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Visualizza le notifiche eventi sulla schermata di blocco"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notifiche eventi"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Orologio"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Meteo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Imposta collegamenti nella schermata di blocco"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Collegamenti"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Doppio orologio"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostra testo guida nella schermata di blocco"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostra orologio doppio nella schermata di blocco durante il roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tenere premuto lo schermo mentre si ruota il dispositivo per aprire la fotocamera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Sblocco fotocamera"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Imposta collegamenti"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Trascina per modificare ordine"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleziona applicazione"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tocca collegamento per assegnare un'applicazione"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Modifica collegamenti"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Testo guida"
+
diff --git a/mobile/lock-setting/po/ja_JP.po b/mobile/lock-setting/po/ja_JP.po
new file mode 100644
index 0000000..19c083d
--- /dev/null
+++ b/mobile/lock-setting/po/ja_JP.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "ロック画面"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "ロック画面にイベント通知を表示"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "イベント通知"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "時計"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "天気予報"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "ロック画面に表示するショートカットを設定"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "ショートカット"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "デュアル時計"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "ロック画面にヘルプテキストを表示"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "ローミング時、ロック画面にデュアル時計を表示"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "画面を押しながら端末を回転させてカメラを起動"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "カメラクイック起動"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "ショートカットを設定"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "ドラッグして順番を並べ替えます。"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "アプリケーションを選択"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "ショートカットをタップしてアプリケーションを割り当てます。"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "ショートカットを編集"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "ヘルプ"
+
diff --git a/mobile/lock-setting/po/ka.po b/mobile/lock-setting/po/ka.po
new file mode 100644
index 0000000..b6b045e
--- /dev/null
+++ b/mobile/lock-setting/po/ka.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "ეკრანის დაბლოკვა"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "მოვლენის შეტყობინებების ნახვა დაბლოკილ ეკრანზე"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "მოვლენის შეტყობინებები"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "საათი"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "ამინდი"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "სწრაფი ღილაკების დაყენება დაბლოკილ ეკრანზე"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "სწრაფი ღილაკები"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "ორმაგი საათი"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "დახმარების ტექსტის ჩვენება დაბლოკილ ეკრანზე"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "ორმაგი საათის ჩვენება დაბლოკილ ეკრანზე როუმინგის დროს"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "კამერის გასახსნელად, ხანგრძლივად შეეხეთ ეკრანს და მოაბრუნეთ აპარატი"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "კამერის სწრაფი გახსნა"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "ღილაკების დაყენება"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "აიღეთ და გადაიტანეთ, თუ გსურთ შეცვალოთ მიმდევრობა"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "აირჩიეთ პროგრამა"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "დააკაკუნეთ სწრაფ ღილაკზე, რომ მიანიჭოთ პროგრამის გახსნის ფუნქცია"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "სწრაფი ღილაკების შესწორება"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "დამხმარე ტექსტი"
+
diff --git a/mobile/lock-setting/po/kk.po b/mobile/lock-setting/po/kk.po
new file mode 100644
index 0000000..5f30631
--- /dev/null
+++ b/mobile/lock-setting/po/kk.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Экранды құлыптау"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Құлыптау экранында оқиғалар туралы хабарландыруларды қарап шығу"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Оқиғалар туралы хабарлау"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Сағат"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Ауа райы"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Құлып экранында белгішелерді белгілеу"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Тез кіру"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Қос сағат"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Құлыптаулы экранында көмек мәтінді көрсетіңіз"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Роумингте қос сағатты құлып экранынан көрсетіңіз"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Камераны ашу үшін құрылғыны бұрғанда экранды басып тұрыңыз"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Камераға жылдам өту"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Белгішелер орнату"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Ретін өзгерту үшін сүйреп алып барыңыз"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Бағдарлама таңдау"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Бағдарламаны тағайындау үшін белгішені түртіңіз"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Тез кіру ретін өзгерту"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Анықтама мәтіні"
+
diff --git a/mobile/lock-setting/po/ko_KR.po b/mobile/lock-setting/po/ko_KR.po
new file mode 100644
index 0000000..aca7f74
--- /dev/null
+++ b/mobile/lock-setting/po/ko_KR.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "잠금화면"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "잠금화면에서 일정 알림 보기"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "일정 알림"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "시계"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "날씨"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "잠금화면에 바로가기를 설정합니다"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "바로가기"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "듀얼 시계"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "잠금화면에 도움말을 표시합니다"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "로밍 시 잠금화면에 듀얼 시계를 표시합니다"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "화면을 길게 누른 채 디바이스를 회전하면 카메라가 실행됩니다"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "빠른 카메라 실행"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "바로가기 설정"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "순서를 바꾸려면 드래그하세요"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "애플리케이션 선택"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "애플리케이션을 지정하려면 바로가기를 누르세요"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "바로가기 편집"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "도움말"
+
diff --git a/mobile/lock-setting/po/lt.po b/mobile/lock-setting/po/lt.po
new file mode 100644
index 0000000..7067c08
--- /dev/null
+++ b/mobile/lock-setting/po/lt.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Užrakinimo ekranas"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Peržiūrėti pranešimus apie įvykius užrakintame ekrane"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Pranešimai apie įvykius"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Laikrodis"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Oras"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Nustatyti sparčiuosius mygtukus užrakinimo ekrane"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Sparčiosios prieigos mygtukai"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dvigubas laikrodis"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Rodyti pagalbos tekstą užrakintame ekrane"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Rodyti dvigubą laikrodį užrakinimo ekrane, kai naudojamasi tarptinkliniu ryšiu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Jei norite atidaryti fotoaparatą, bakstelėkite ir laikykite ekraną sukdami įrenginį"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Gr. prieiga prie fotoap."
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Nustatyti trumpinius"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Vilkdami pakeiskite išdėstymą"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Pasirinkti programą"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Bakstelėkite spartųjį mygtuką, kad priskirtumėte programą"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Redaguoti nuorodas"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Pagalbos tekstas"
+
diff --git a/mobile/lock-setting/po/lv.po b/mobile/lock-setting/po/lv.po
new file mode 100644
index 0000000..af7d248
--- /dev/null
+++ b/mobile/lock-setting/po/lv.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Bloķēšanas ekrāns"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Skatīt notikumu paziņojumus bloķētā ekrānā"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notikumu paziņojumi"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Pulkstenis"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Laiks"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Iestatīt īsceļus bloķētajā ekrānā"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Īsceļi"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Duālais pulkstenis"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Rādīt palīdzības tekstu bloķēšanas ekrānā"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Viesabonēšanas laikā bloķēšanas ekrānā rādīt duālo pulksteni"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Lai atvērtu kameru, pieskarieties un turiet ekrānu, un vienlaicīgi pagrieziet ierīci"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Ātra piekļuve kamerai"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Iestatīt īsceļus"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Velciet un nometiet, lai mainītu kārtību"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Izvēlēties programmu"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Pieskarieties īsceļam, lai piešķirtu programmu"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Rediģēt īsceļus"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Palīdzības teksts"
+
diff --git a/mobile/lock-setting/po/mk.po b/mobile/lock-setting/po/mk.po
new file mode 100644
index 0000000..2cc2c03
--- /dev/null
+++ b/mobile/lock-setting/po/mk.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Заклучување на екранот"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Гледај известувања за настани на екранот за заклучување"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Известувања за настани"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Часовник"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Време"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Постави кратенки на екранот за заклучување"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Кратенки"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Двоен часовник"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Прикажи текст за помош на екранот за заклучување"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Прикажи двоен часовник на екранот за заклучување при роаминг"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Допрете и држете го екранот додека го вртите уредот за да го отворите фотоапаратот"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Брз пристап до камерата"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Одреди кратенки"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Повлечете и пуштете за да го смените редоследот"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Избери апликација"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Допрете кратенка за да доделите апликација"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Измени кратенки"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Текст за помош"
+
diff --git a/mobile/lock-setting/po/nb.po b/mobile/lock-setting/po/nb.po
new file mode 100644
index 0000000..167c148
--- /dev/null
+++ b/mobile/lock-setting/po/nb.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Skjermlås"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Vis hendelsesvarsler på skjermlåsen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Hendelsesvarsler"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Klokke"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Vær"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Angi snarveier på skjermlås"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Snarveier"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dobbel klokke"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Vis hjelpetekst på skjermlås"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Vis dobbel klokke på skjermlås under roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Trykk på og hold skjermen mens du roterer enheten for å åpne Kamera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Hurtigtilgang til kamera"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Angi snarveier"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Dra og slipp for å endre rekkefølgen"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Velg program"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Trykk på snarvei for å tilordne program"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Rediger snarveier"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Hjelpetekst"
+
diff --git a/mobile/lock-setting/po/nl_NL.po b/mobile/lock-setting/po/nl_NL.po
new file mode 100644
index 0000000..9289e1b
--- /dev/null
+++ b/mobile/lock-setting/po/nl_NL.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Vergrendelscherm"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Meldingen van agenda-items weergeven op het vergrendelscherm"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Meldingen agenda-items"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Klok"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Weer"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Sneltoetsen instellen op vergrendeld scherm"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Sneltoetsen"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Twee klokken"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Help-tekst op vergrendeld scherm weergeven"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Dubbele klok weergeven op vergrendeld scherm bij roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tik en houd uw vinger op het scherm terwijl u het apparaat draait om de camera te openen"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Camera ontgrendelen"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Snelkoppelingen instellen"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Sleep en zet neer om volgorde te wijzigen"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Applicatie selecteren"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tik op sneltoets om applicatie toe te wijzen"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Sneltoetsen wijzigen"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Help-tekst"
+
diff --git a/mobile/lock-setting/po/pl.po b/mobile/lock-setting/po/pl.po
new file mode 100644
index 0000000..3d8cbae
--- /dev/null
+++ b/mobile/lock-setting/po/pl.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Ekran blokady"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Wyświetlaj powiadomienia o wydarzeniach na ekranie blokady"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Powiadomienia o wydarzen."
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Zegar"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Pogoda"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Ustaw skróty na ekranie blokady"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Skróty klawiszowe"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Zegar podwójny"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Pokaż tekst pomocy na ekranie blokady"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Wyświetlanie zegara podwójnego na ekranie blokady podczas roamingu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Obracając urządzenie, dotknij i przytrzymaj ekran, aby otworzyć aparat"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Skrót aparatu"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Ustawianie skrótów"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Przeciągnij i upuść, aby zmienić kolejność"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Wybierz aplikację"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Dotknij skrótu, aby przypisać aplikację"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Edytuj skróty"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Tekst pomocy"
+
diff --git a/mobile/lock-setting/po/pt_BR.po b/mobile/lock-setting/po/pt_BR.po
new file mode 100644
index 0000000..8072ea6
--- /dev/null
+++ b/mobile/lock-setting/po/pt_BR.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Tela de bloqueio"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Exibir notificações de eventos na tela de bloqueio"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificações de evento"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Relógio"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Clima"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir atalhos na tela de bloqueio"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Atalhos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Relógio duplo"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Exibir texto de ajuda na tela bloqueada"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar relógio duplo na tela de bloqueio quando em roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Toque e segure a tela enquanto gira o dispositivo para abrir a Câmera"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acesso rápido à Câmera"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Configurar atalhos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arraste e solte para alterar a ordem"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Selecionar aplicação"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Toque no atalho para atribuir aplicativo"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar atalhos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de ajuda"
+
diff --git a/mobile/lock-setting/po/pt_PT.po b/mobile/lock-setting/po/pt_PT.po
new file mode 100644
index 0000000..5005ee3
--- /dev/null
+++ b/mobile/lock-setting/po/pt_PT.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Ecrã bloqueado"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Ver notificações de eventos no ecrã bloqueado"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificações de eventos"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Relógio"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Tempo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Definir atalhos no ecrã bloqueado"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Atalhos"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Rel. duplo"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Mostrar texto de ajuda no ecrã bloqueado"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Mostrar relógio duplo no ecrã bloqueado em roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Toque sem soltar no ecrã ao rodar o dispositivo para abrir a Câmara"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acesso rápido à câmara"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Definir atalhos"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Arrastar e largar para alterar a ordem"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Seleccionar aplicação"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tocar no atalho para atribuir aplicação"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editar atalhos"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Texto de ajuda"
+
diff --git a/mobile/lock-setting/po/ro.po b/mobile/lock-setting/po/ro.po
new file mode 100644
index 0000000..d0a832f
--- /dev/null
+++ b/mobile/lock-setting/po/ro.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Blocare ecran"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Vizualizaţi pe ecranul blocat notificările privind evenimentul"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Notificări eveniment"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ceas"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Vreme"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Setare comenzi rapide în ecranul de blocare"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Comenzi rapide"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Ceas dual"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Afişare text asistenţă pe ecranul de blocare"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Afişare ceas dual pe ecranul de blocare în roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Ţineţi apăsat pe ecran şi rotiţi dispozitivul pentru a deschide Camera foto"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Acc. rapid la camera foto"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Setare comenzi rapide"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Glisaţi şi fixaţi pentru schimbarea ordinii"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Selectare aplicaţie"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Atingeţi comanda rapidă pentru a atribui aplicaţia"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Editare comenzi rapide"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Text asistenţă"
+
diff --git a/mobile/lock-setting/po/ru_RU.po b/mobile/lock-setting/po/ru_RU.po
new file mode 100644
index 0000000..fb29213
--- /dev/null
+++ b/mobile/lock-setting/po/ru_RU.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Экран блокировки"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Просмотр уведомлений о событиях на экране блокировки"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Уведомления о событиях"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Часы"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Погода"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Настроить ярлыки на экране блокировки"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Горячие клавиши"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Двойные часы"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Показывать текст справки на экране блокировки"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Показывать двойные часы на экране блокировки в роуминге"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Чтобы открыть камеру, прикоснитесь к экрану и, удерживая палец, поверните устройство"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Быстрый доступ к камере"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Задать ярлыки"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Используйте перетаскивание, чтобы изменить порядок"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Выбор приложения"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Нажмите ярлык, чтобы назначить приложение"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Изменить ссылки"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Текст справки"
+
diff --git a/mobile/lock-setting/po/sk.po b/mobile/lock-setting/po/sk.po
new file mode 100644
index 0000000..5c28e7d
--- /dev/null
+++ b/mobile/lock-setting/po/sk.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Uzamknúť obrazovku"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Zobraziť oznámenia udalostí na zamknutej obrazovke"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Oznámenia udalostí"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Hodiny"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Počasie"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Nastaviť odkazy na zamknutej obrazovke"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Skratky"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Duálne hod."
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Zobraziť text pomocníka na zamknutej obrazovke"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Pri roamingu zobraziť na zamknutej obrazovke duálne hodiny"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Ťuknutím na obrazovku a jej podržaním počas otáčania zariadenia môžete otvoriť aplikáciu Fotoaparát"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Rýchly príst. cez fotoap."
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Nastaviť skratky"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Presunutím môžete zmeniť poradie"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Vyberte aplikáciu"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Ťuknutím na odkaz priraďte aplikáciu"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Upraviť odkazy"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Text pomocníka"
+
diff --git a/mobile/lock-setting/po/sl.po b/mobile/lock-setting/po/sl.po
new file mode 100644
index 0000000..805afbc
--- /dev/null
+++ b/mobile/lock-setting/po/sl.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Zaklepanje zaslona"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Prikaz obvestil o dogodkih na zaklenjenem zaslonu"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Obvestila o dogodkih"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Ura"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Vreme"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Nastavi bližnjice na zaklenjenem zaslonu"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Bližnjice"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dvojna ura"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Pokaži besedilo za pomoč na zaklenjenem zaslonu"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Med gostovanjem pokaži dvojno uro na zaklenjenem zaslonu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Pritisnite in pridržite prst na zaslonu in hkrati zavrtite napravo, da odprete kamero"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Hitri dostop do kamere"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Nastavi bližnjice"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Povlecite in spustite, če želite spremeniti vrstni red"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Izberite program"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Pritisnite bližnjico, da jo dodelite programu"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Uredi bližnjice"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Besedilo s pomočjo"
+
diff --git a/mobile/lock-setting/po/sr.po b/mobile/lock-setting/po/sr.po
new file mode 100644
index 0000000..c74520f
--- /dev/null
+++ b/mobile/lock-setting/po/sr.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Zaključavanje ekrana"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Prikaži obaveštenja o događajima na zaključanom ekranu"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Obaveštenja o događaju"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Sat"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Vreme"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Postavi prečice na zaključanom ekranu"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Prečice"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dvostruki sat"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Prikaži tekst pomoći na zaključanom ekranu"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Prikaži dvostruki sat na zaključanom ekranu u romingu"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Kucni i zadrži ekran tokom rotiranja uređaja da bi otvorio/la kameru"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Brzi pristup na kameri"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Podesi prečice"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Prevuci i otpusti za promenu redosleda"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Izaberi aplikaciju"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Kucni prečicu za dodelu aplikacije"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Izmeni prečice"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Tekst pomoći"
+
diff --git a/mobile/lock-setting/po/sv.po b/mobile/lock-setting/po/sv.po
new file mode 100644
index 0000000..ea54af4
--- /dev/null
+++ b/mobile/lock-setting/po/sv.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Låsskärm"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Visa händelsemeddelanden på låsskärmen"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Händelsemeddelanden"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Klocka"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Väder"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Ställ in genvägar på låsskärmen"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Genvägar"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Dubbel klocka"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Visa hjälptexten på låsskärmen"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Visa dubbla klockor på låsskärmen vid roaming"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Tryck på och håll kvar på skärmen och rotera samtidigt enheten för att öppna Kameran"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Snabbåtkomst till kameran"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Ställ in genvägar"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Dra och släpp för att ändra ordning"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Välj program"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Tryck på genväg för att tilldela program"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Redigera genvägar"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Hjälptext"
+
diff --git a/mobile/lock-setting/po/tr_TR.po b/mobile/lock-setting/po/tr_TR.po
new file mode 100644
index 0000000..8c5ab33
--- /dev/null
+++ b/mobile/lock-setting/po/tr_TR.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Kilit ekranı"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Kilit ekranında etkinlik bildirimlerini gör"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Etkinlik bildirimleri"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Saat"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Hava"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Kısayolları kilit ekranında ayarla"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Kısayollar"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "İkili saat"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Yardım metnini kilit ekranında göster"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Dolaşımdayken kilit ekranında çift saat göster"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Kamerayı açmak için cihazı döndürürken ekrana dokunun ve basılı tutun"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kameraya hızlı erişim"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Kısayol ayarla"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Sırayı değiştirmek için sürükle ve bırak"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Uygulama seç"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Uygulama atamak için kısayola dokun"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Kısayolları düzenle"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Yardım metni"
+
diff --git a/mobile/lock-setting/po/uk.po b/mobile/lock-setting/po/uk.po
new file mode 100644
index 0000000..67ef257
--- /dev/null
+++ b/mobile/lock-setting/po/uk.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Екран блокування"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Перегляд сповіщень про події на екрані блокування"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Сповіщення про події"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Годинник"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Погода"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Встановлення клавіш швидкого доступу на екрані блокування"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Швидкий доступ"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Подвійний годинник"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Відображення тексту довідки на екрані блокування"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Відображення подвійного годинника на екрані блокування під час перебування в роумінгу"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Натисніть і утримуйте екран, одночасно обертаючи пристрій, щоб відкрити камеру"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Швидкий доступ до камери"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Встановлення клавіш швидкого доступу"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Перетягніть, щоб змінити порядок"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Виберіть програму"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Натисніть клавішу швидкого доступу, щоб призначити програму"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Редагувати клавіші шв. доступу"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Текст довідки"
+
diff --git a/mobile/lock-setting/po/uz.po b/mobile/lock-setting/po/uz.po
new file mode 100644
index 0000000..280ac1b
--- /dev/null
+++ b/mobile/lock-setting/po/uz.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "Bloklash ekrani"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "Bloklash ekranida hodisa bildirshnomalarini ko‘rib chiqish"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "Hodisa bildirishnomalari"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "Soat"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "Ob-havo"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "Bloklash ekranida yorliqlarni o‘rnatish"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "Yorliqlar"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "Ikkitali soat"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "Bloklash ekranida yordam matnini ko‘rsatish"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "Rouming vaqtida bloklash ekarnida ikkitali soatni ko‘rsat"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "Kamerani ochish uchun, aylantirish vaqtida ekranni bosib turing"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "Kameraga tezkor kirish"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "Yorliqlarni o‘rnatish"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "Tartibni o‘zgartirish uchun tortib o‘tkazing"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "Ilova tanlash"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "Ilovani tayinlash uchun yorliqni tanlang"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "Yorliqlarni tahrirlash"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "Yordam matni"
+
diff --git a/mobile/lock-setting/po/zh_CN.po b/mobile/lock-setting/po/zh_CN.po
new file mode 100644
index 0000000..776d32c
--- /dev/null
+++ b/mobile/lock-setting/po/zh_CN.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "锁定屏幕"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "在锁屏上查看事件通知"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "事件通知"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "时钟"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "天气"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "设置屏幕锁定时的快捷键"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "快捷键"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "双时钟"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "在锁定屏幕时显示帮助文本"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "漫游时在锁屏上显示双时钟"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "点击并按住屏幕同时旋转手机以打开摄像头"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "照相机快速访问"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "设置快捷方式"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "用拖放的方式调整顺序"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "选择应用程序"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "点击快捷方式分配应用程序"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "编辑快捷方式"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "帮助文本"
+
diff --git a/mobile/lock-setting/po/zh_HK.po b/mobile/lock-setting/po/zh_HK.po
new file mode 100644
index 0000000..53b912e
--- /dev/null
+++ b/mobile/lock-setting/po/zh_HK.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "鎖定螢幕"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "於鎖定螢幕上檢視事件通知"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "事件通知"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "時鐘"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "天氣"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "在鎖定螢幕上設定捷徑"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "捷徑"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "雙時鐘"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "於鎖定螢幕顯示說明文字"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "當漫遊時在鎖定螢幕上顯示雙時鐘"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "輕觸並按住螢幕同時旋轉裝置以開啟相機"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "相機快速捷徑"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "設定捷徑"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "拖放以更改順序"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "選擇應用程式"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "輕觸捷徑以指定應用程式"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "編輯捷徑"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "說明文字"
+
diff --git a/mobile/lock-setting/po/zh_SG.po b/mobile/lock-setting/po/zh_SG.po
new file mode 100644
index 0000000..c78be58
--- /dev/null
+++ b/mobile/lock-setting/po/zh_SG.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "锁定屏幕"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "在锁屏上查看事件通知"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "事件通知"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "时钟"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "天气"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "设置锁屏快捷方式"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "快捷键"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "双时钟"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "在锁定屏幕上显示帮助文本"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "漫游时在锁屏上显示双时钟"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "轻敲并按住屏幕同时旋转设备以打开摄像头"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "摄像头快速访问"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "设置快捷方式"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "用拖放的方式调整顺序"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "选择应用程序"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "轻敲快捷方式分配应用程序"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "编辑快捷键"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "帮助文本"
+
diff --git a/mobile/lock-setting/po/zh_TW.po b/mobile/lock-setting/po/zh_TW.po
new file mode 100644
index 0000000..5859f7f
--- /dev/null
+++ b/mobile/lock-setting/po/zh_TW.po
@@ -0,0 +1,54 @@
+msgid "IDS_ST_BODY_LOCK_SCREEN"
+msgstr "鎖定螢幕"
+
+msgid "IDS_IDLE_BODY_VIEW_EVENT_NOTIFICATIONS_ON_THE_LOCK_SCREEN"
+msgstr "於鎖定螢幕上檢視活動通知"
+
+msgid "IDS_IDLE_MBODY_EVENT_NOTIFICATIONS"
+msgstr "活動通知"
+
+msgid "IDS_ST_BODY_CLOCK"
+msgstr "時鐘"
+
+msgid "IDS_ST_BODY_WEATHER"
+msgstr "氣象"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS_ON_LOCK_SCREEN"
+msgstr "在鎖定螢幕上設定捷徑"
+
+msgid "IDS_ST_BODY_SHORTCUTS"
+msgstr "捷徑"
+
+msgid "IDS_ST_BODY_DUAL_CLOCK"
+msgstr "雙時鐘"
+
+msgid "IDS_ST_BODY_SHOW_HELP_TEXT_ON_LOCK_SCREEN"
+msgstr "於鎖定螢幕顯示說明文字"
+
+msgid "IDS_ST_BODY_SHOW_DUAL_CLOCK_ON_LOCK_SCREEN_WHEN_ROAMING"
+msgstr "漫遊時在鎖定螢幕上顯示雙時鐘"
+
+msgid "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_WHILE_ROTATING_THE_DEVICE_TO_OPEN_CAMERA"
+msgstr "輕觸並按住螢幕同時旋轉裝置以開啟相機"
+
+msgid "IDS_ST_MBODY_CAMERA_QUICK_ACCESS"
+msgstr "相機快速捷徑"
+
+msgid "IDS_ST_BODY_SET_SHORTCUTS"
+msgstr "設定捷徑"
+
+msgid "IDS_ST_BODY_DRAG_AND_DROP_TO_CHANGE_ORDER"
+msgstr "拖放以變更順序"
+
+msgid "IDS_ST_BODY_SELECT_APPLICATION"
+msgstr "選擇應用程式"
+
+msgid "IDS_ST_BODY_TAP_SHORTCUT_TO_ASSIGN_APPLICATION"
+msgstr "輕觸捷徑以指定應用程式"
+
+msgid "IDS_ST_OPT_EDIT_SHORTCUTS"
+msgstr "編輯快捷鍵"
+
+msgid "IDS_IM_BODY_HELP_TEXT"
+msgstr "說明文字"
+
diff --git a/mobile/packaging/starter.spec b/mobile/packaging/starter.spec
new file mode 100644
index 0000000..965f4d9
--- /dev/null
+++ b/mobile/packaging/starter.spec
@@ -0,0 +1,110 @@
+Name: starter
+Summary: starter
+Version: 0.4.62
+Release: 3
+Group: TO_BE/FILLED_IN
+License: TO_BE/FILLED_IN
+Source0: starter-%{version}.tar.gz
+Requires(post): /usr/bin/vconftool
+BuildRequires: cmake
+BuildRequires: pkgconfig(ail)
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-media-key)
+BuildRequires: pkgconfig(db-util)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(eet)
+BuildRequires: pkgconfig(eina)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(sysman)
+BuildRequires: pkgconfig(syspopup-caller)
+BuildRequires: pkgconfig(tapi)
+BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xcomposite)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(libsystemd-daemon)
+
+BuildRequires: cmake
+BuildRequires: edje-bin
+BuildRequires: gettext-tools
+
+Requires(post): /usr/bin/vconftool
+
+%description
+Description: Starter
+
+
+%prep
+%setup -q
+
+%cmake .
+
+%build
+
+make -j1
+%install
+rm -rf %{buildroot}
+%make_install
+
+mkdir -p %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants
+mkdir -p %{buildroot}%{_libdir}/systemd/user/sockets.target.wants
+ln -s ../starter.path %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants/starter.path
+ln -s ../starter.service %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants/starter.service
+ln -s ../starter.socket %{buildroot}%{_libdir}/systemd/user/sockets.target.wants/starter.socket
+mkdir -p %{buildroot}/usr/share/license
+mkdir -p %{buildroot}/opt/data/home-daemon
+
+cp LICENSE.Flora %{buildroot}/usr/share/license/%{name}
+
+%post
+change_file_executable()
+{
+ chmod +x $@ 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed to change the perms of $@"
+ fi
+}
+
+GOPTION="-u 5000 -f"
+
+vconftool set -t int "memory/starter/sequence" 0 -i $GOPTION
+vconftool set -t int "memory/starter/use_volume_key" 0 -i $GOPTION
+vconftool set -t string file/private/lockscreen/pkgname "org.tizen.lockscreen" -u 5000 -g 5000 -f
+vconftool set -t int memory/idle_lock/state "0" -i $GOPTION
+vconftool set -t bool memory/lockscreen/phone_lock_verification 0 -i $GOPTION
+
+vconftool set -t bool db/lockscreen/event_notification_display 1 $GOPTION
+vconftool set -t bool db/lockscreen/clock_display 1 $GOPTION
+vconftool set -t bool db/lockscreen/help_text_display 0 $GOPTION
+
+vconftool set -t int memory/idle-screen/is_idle_screen_launched "0" -i -u 5000 -f
+vconftool set -t int memory/idle-screen/top "0" -i -f
+vconftool set -t int memory/idle-screen/safemode "0" -i -f
+
+%files
+%manifest starter.manifest
+%defattr(-,root,root,-)
+%{_bindir}/starter
+/usr/ug/lib/libug-lockscreen-options.so
+/usr/ug/lib/libug-lockscreen-options.so.0.1.0
+/usr/ug/res/locale/*/LC_MESSAGES/*
+%{_libdir}/systemd/user/starter.path
+%{_libdir}/systemd/user/starter.service
+%{_libdir}/systemd/user/starter.socket
+%{_libdir}/systemd/user/core-efl.target.wants/starter.path
+%{_libdir}/systemd/user/core-efl.target.wants/starter.service
+%{_libdir}/systemd/user/sockets.target.wants/starter.socket
+/usr/share/license/%{name}
+/opt/data/home-daemon
+/opt/etc/smack/accesses.d/starter.rule
diff --git a/mobile/src/hw_key.c b/mobile/src/hw_key.c
new file mode 100644
index 0000000..14361bf
--- /dev/null
+++ b/mobile/src/hw_key.c
@@ -0,0 +1,323 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <ail.h>
+#include <bundle.h>
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <Ecore_Input.h>
+#include <sysman.h>
+#include <syspopup_caller.h>
+#include <utilX.h>
+#include <vconf.h>
+#include <system/media_key.h>
+
+#include "hw_key.h"
+#include "menu_daemon.h"
+#include "util.h"
+
+#define TASKMGR_PKG_NAME "org.tizen.taskmgr"
+#define CAMERA_PKG_NAME "org.tizen.camera-app"
+#define CALLLOG_PKG_NAME "org.tizen.calllog"
+#define MUSIC_PLAYER_PKG_NAME "org.tizen.music-player"
+
+
+
+static struct {
+ Ecore_X_Window win;
+ Ecore_Event_Handler *key_up;
+ Ecore_Event_Handler *key_down;
+ Ecore_Timer *long_press;
+ Ecore_Timer *single_timer;
+ Ecore_Timer *volume_up_long_press;
+ Ecore_Timer *volume_down_long_press;
+ Eina_Bool cancel;
+} key_info = {
+ .win = 0x0,
+ .key_up = NULL,
+ .key_down = NULL,
+ .long_press = NULL,
+ .single_timer = NULL,
+ .volume_up_long_press = NULL,
+ .volume_down_long_press = NULL,
+ .cancel = EINA_FALSE,
+};
+
+
+
+static Eina_Bool _launch_taskmgr_cb(void* data)
+{
+ int val1 = -1;
+ int val2 = -1;
+ _D("Launch TASKMGR");
+
+ key_info.long_press = NULL;
+
+ if (vconf_get_int(VCONFKEY_PM_STATE, &val1) < 0) {
+ _E("Cannot get VCONFKEY_PM_STATE");
+ return ECORE_CALLBACK_CANCEL;
+ }
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val2) < 0) {
+ _E("Cannot get VCONFKEY_IDLE_LOCK_STATE");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if ((val1 == VCONFKEY_PM_STATE_NORMAL) && (val2 == VCONFKEY_IDLE_UNLOCK)) {
+ _D("LCD ON, UNLOCK state => launch taskmgr");
+ syspopup_destroy_all();
+ if (menu_daemon_open_app(TASKMGR_PKG_NAME) < 0)
+ _E("Failed to launch the taskmgr");
+ } else {
+ _D("Can't launch TASKMGR pm state : %d lock state : %d", val1, val2);
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+static Eina_Bool _launch_by_home_key(void *data)
+{
+ key_info.single_timer = NULL;
+ syspopup_destroy_all();
+ menu_daemon_open_homescreen(NULL);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+inline static int _release_home_key(void)
+{
+ syspopup_destroy_all();
+ retv_if(NULL == key_info.long_press, EXIT_SUCCESS);
+ ecore_timer_del(key_info.long_press);
+ key_info.long_press = NULL;
+
+ if (NULL == key_info.single_timer) {
+ key_info.single_timer = ecore_timer_add(0.3, _launch_by_home_key, NULL);
+ return EXIT_SUCCESS;
+ }
+ ecore_timer_del(key_info.single_timer);
+ key_info.single_timer = NULL;
+
+ return EXIT_SUCCESS;
+}
+
+
+
+inline static void _release_multimedia_key(const char *value)
+{
+ ret_if(NULL == value);
+
+ _D("Multimedia key is released with %s", value);
+
+ bundle *b;
+ b = bundle_create();
+ if (!b) {
+ _E("Cannot create bundle");
+ return;
+ }
+ bundle_add(b, "multimedia_key", value);
+
+ int ret;
+ ret = menu_daemon_launch_app(MUSIC_PLAYER_PKG_NAME, b);
+ if (ret < 0)
+ _E("Failed to launch the running apps, ret : %d", ret);
+
+ bundle_free(b);
+}
+
+
+
+static Eina_Bool _key_release_cb(void *data, int type, void *event)
+{
+ Evas_Event_Key_Up *ev = event;
+ int val = -1;
+
+ _D("Released");
+
+ if (!ev) {
+ _D("Invalid event object");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!strcmp(ev->keyname, KEY_END)) {
+ } else if (!strcmp(ev->keyname, KEY_CONFIG)) {
+ } else if (!strcmp(ev->keyname, KEY_SEND)) {
+ } else if (!strcmp(ev->keyname, KEY_HOME)) {
+
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ _D("Cannot get VCONFKEY_IDLE_LOCK_STATE");
+ }
+ if (val == VCONFKEY_IDLE_LOCK) {
+ _D("lock state, ignore home key..!!");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (EINA_TRUE == key_info.cancel) {
+ _D("Cancel key is activated");
+ if (key_info.long_press) {
+ ecore_timer_del(key_info.long_press);
+ key_info.long_press = NULL;
+ }
+
+ if (key_info.single_timer) {
+ ecore_timer_del(key_info.single_timer);
+ key_info.single_timer = NULL;
+ }
+
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ _release_home_key();
+ } else if (!strcmp(ev->keyname, KEY_PAUSE)) {
+ } else if (!strcmp(ev->keyname, KEY_CANCEL)) {
+ _D("CANCEL Key is released");
+ key_info.cancel = EINA_FALSE;
+ } else if (!strcmp(ev->keyname, KEY_MEDIA)) {
+ _release_multimedia_key("KEY_PLAYCD");
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+static Eina_Bool _key_press_cb(void *data, int type, void *event)
+{
+ Evas_Event_Key_Down *ev = event;
+ int val = -1;
+
+ _D("Pressed");
+
+ if (!ev) {
+ _D("Invalid event object");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!strcmp(ev->keyname, KEY_SEND)) {
+ _D("Launch calllog");
+ if (menu_daemon_open_app(CALLLOG_PKG_NAME) < 0)
+ _E("Failed to launch %s", CALLLOG_PKG_NAME);
+ } else if(!strcmp(ev->keyname, KEY_CONFIG)) {
+ _D("Launch camera");
+ if (menu_daemon_open_app(CAMERA_PKG_NAME) < 0)
+ _E("Failed to launch %s", CAMERA_PKG_NAME);
+ } else if (!strcmp(ev->keyname, KEY_HOME)) {
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ _D("Cannot get VCONFKEY_IDLE_LOCK_STATE");
+ }
+ if (val == VCONFKEY_IDLE_LOCK) {
+ _D("lock state, ignore home key..!!");
+ return ECORE_CALLBACK_RENEW;
+ }
+ if (key_info.long_press) {
+ ecore_timer_del(key_info.long_press);
+ key_info.long_press = NULL;
+ }
+
+ syspopup_destroy_all();
+
+ key_info.long_press = ecore_timer_add(0.5, _launch_taskmgr_cb, NULL);
+ if (!key_info.long_press)
+ _E("Failed to add timer for long press detection");
+ } else if (!strcmp(ev->keyname, KEY_CANCEL)) {
+ _D("Cancel button is pressed");
+ key_info.cancel = EINA_TRUE;
+ } else if (!strcmp(ev->keyname, KEY_MEDIA)) {
+ _D("Media key is pressed");
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+void _media_key_event_cb(media_key_e key, media_key_event_e status, void *user_data)
+{
+ _D("MEDIA KEY EVENT");
+ if (MEDIA_KEY_STATUS_PRESSED == status) return;
+
+ if (MEDIA_KEY_PAUSE == key) {
+ _release_multimedia_key("KEY_PAUSECD");
+ } else if (MEDIA_KEY_PLAY == key) {
+ _release_multimedia_key("KEY_PLAYCD");
+ }
+}
+
+
+
+void create_key_window(void)
+{
+ key_info.win = ecore_x_window_input_new(0, -10000, -10000, 1, 1);
+ if (!key_info.win) {
+ _D("Failed to create hidden window");
+ return;
+ }
+ //ecore_x_event_mask_unset(key_info.win, ECORE_X_EVENT_MASK_NONE);
+ ecore_x_icccm_title_set(key_info.win, "menudaemon,key,receiver");
+ ecore_x_netwm_name_set(key_info.win, "menudaemon,key,receiver");
+ ecore_x_netwm_pid_set(key_info.win, getpid());
+ ecore_x_flush();
+
+ utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_HOME, SHARED_GRAB);
+ utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_VOLUMEDOWN, SHARED_GRAB);
+ utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_VOLUMEUP, SHARED_GRAB);
+ utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_CONFIG, SHARED_GRAB);
+ utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_MEDIA, SHARED_GRAB);
+
+ key_info.key_up = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, NULL);
+ if (!key_info.key_up)
+ _D("Failed to register a key up event handler");
+
+ key_info.key_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, NULL);
+ if (!key_info.key_down)
+ _D("Failed to register a key down event handler");
+
+ media_key_reserve(_media_key_event_cb, NULL);
+}
+
+
+
+void destroy_key_window(void)
+{
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_HOME);
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_VOLUMEDOWN);
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_VOLUMEUP);
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_CONFIG);
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_MEDIA);
+
+ if (key_info.key_up) {
+ ecore_event_handler_del(key_info.key_up);
+ key_info.key_up = NULL;
+ }
+
+ if (key_info.key_down) {
+ ecore_event_handler_del(key_info.key_down);
+ key_info.key_down = NULL;
+ }
+
+ ecore_x_window_delete_request_send(key_info.win);
+ key_info.win = 0x0;
+
+ media_key_release();
+}
+
+
+
+// End of a file
diff --git a/mobile/src/lock-daemon.c b/mobile/src/lock-daemon.c
new file mode 100644
index 0000000..d3908a5
--- /dev/null
+++ b/mobile/src/lock-daemon.c
@@ -0,0 +1,674 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <Elementary.h>
+
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <systemd/sd-daemon.h>
+#include <glib.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <errno.h>
+
+#include "lockd-debug.h"
+#include "lock-daemon.h"
+#include "lockd-process-mgr.h"
+#include "lockd-window-mgr.h"
+#include "starter-util.h"
+#include "menu_daemon.h"
+
+static int phone_lock_pid;
+
+struct lockd_data {
+ int lock_app_pid;
+ int phone_lock_app_pid;
+ int lock_type;
+ Eina_Bool request_recovery;
+ lockw_data *lockw;
+ GPollFD *gpollfd;
+};
+
+#define PHLOCK_SOCK_PREFIX "/tmp/phlock"
+#define PHLOCK_SOCK_MAXBUFF 65535
+#define PHLOCK_APP_CMDLINE "/usr/apps/org.tizen.lockscreen/bin/lockscreen"
+#define PHLOCK_UNLOCK_CMD "unlock"
+#define PHLOCK_LAUNCH_CMD "launch_phone_lock"
+#define LAUNCH_INTERVAL 100*1000
+
+static int lockd_launch_app_lockscreen(struct lockd_data *lockd);
+
+static void lockd_unlock_lockscreen(struct lockd_data *lockd);
+
+static int _lockd_get_lock_type(void)
+{
+ int lock_type = 0;
+ int ret = 0;
+
+ vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
+
+ if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD ||
+ lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
+ ret = 1;
+ } else if (lock_type == SETTING_SCREEN_LOCK_TYPE_SWIPE ||
+ lock_type == SETTING_SCREEN_LOCK_TYPE_MOTION) {
+ ret = 0;
+ } else {
+ ret = 2;
+ }
+
+ LOCKD_DBG("_lockd_get_lock_type ret(%d), lock_type (%d)", ret, lock_type);
+
+ return ret;
+}
+
+static void _lockd_notify_pm_state_cb(keynode_t * node, void *data)
+{
+ LOCKD_DBG("PM state Notification!!");
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_int(VCONFKEY_PM_STATE, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY_PM_STATE");
+ return;
+ }
+
+ if (val == VCONFKEY_PM_STATE_LCDOFF) {
+ lockd->lock_type = _lockd_get_lock_type();
+ lockd_launch_app_lockscreen(lockd);
+ }
+}
+
+static void
+_lockd_notify_lock_state_cb(keynode_t * node, void *data)
+{
+ LOCKD_DBG("lock state changed!!");
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY_IDLE_LOCK_STATE");
+ return;
+ }
+
+ if (val == VCONFKEY_IDLE_UNLOCK) {
+ LOCKD_DBG("unlocked..!!");
+ if (lockd->lock_app_pid != 0) {
+ LOCKD_DBG("terminate lock app..!!");
+ lockd_process_mgr_terminate_lock_app(lockd->lock_app_pid, 1);
+ }
+ }
+}
+
+static Eina_Bool lockd_set_lock_state_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_LOCK);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_lockd_notify_phone_lock_verification_cb(keynode_t * node, void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, &val) < 0) {
+ LOCKD_ERR("Cannot get %s", VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION);
+ return;
+ }
+
+ if (val == TRUE) {
+ lockd_window_mgr_finish_lock(lockd->lockw);
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ }
+}
+
+static int lockd_app_dead_cb(int pid, void *data)
+{
+ LOCKD_DBG("app dead cb call! (pid : %d)", pid);
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (pid == lockd->lock_app_pid) {
+ LOCKD_DBG("lock app(pid:%d) is destroyed.", pid);
+
+ lockd_unlock_lockscreen(lockd);
+ }
+
+ menu_daemon_check_dead_signal(pid);
+
+ return 0;
+
+}
+
+static Eina_Bool lockd_app_create_cb(void *data, int type, void *event)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (lockd == NULL) {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ if (lockd_window_set_window_effect(lockd->lockw, lockd->lock_app_pid,
+ event) == EINA_TRUE) {
+ if(lockd_window_set_window_property(lockd->lockw, lockd->lock_app_pid,
+ event) == EINA_FALSE) {
+ LOCKD_ERR("window is not matched..!!");
+ }
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool lockd_app_show_cb(void *data, int type, void *event)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (lockd == NULL) {
+ return EINA_TRUE;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ if (lockd_window_set_window_property(lockd->lockw, lockd->lock_app_pid,
+ event)) {
+ ecore_idler_add(lockd_set_lock_state_cb, NULL);
+ }
+ return EINA_FALSE;
+}
+
+static int lockd_launch_app_lockscreen(struct lockd_data *lockd)
+{
+ LOCKD_DBG("launch app lock screen");
+
+ int call_state = -1, phlock_state = -1, factory_mode = -1, test_mode = -1;
+ int r = 0;
+
+ WRITE_FILE_LOG("%s", "Launch lockscreen in starter");
+
+ if (lockd_process_mgr_check_lock(lockd->lock_app_pid) == TRUE) {
+ LOCKD_DBG("Lock Screen App is already running.");
+ r = lockd_process_mgr_restart_lock(lockd->lock_type);
+ if (r < 0) {
+ LOCKD_DBG("Restarting Lock Screen App is fail [%d].", r);
+ usleep(LAUNCH_INTERVAL);
+ } else {
+ LOCKD_DBG("Restarting Lock Screen App, pid[%d].", r);
+ return 1;
+ }
+ }
+
+ vconf_get_int(VCONFKEY_CALL_STATE, &call_state);
+ if (call_state != VCONFKEY_CALL_OFF) {
+ LOCKD_DBG
+ ("Current call state(%d) does not allow to launch lock screen.",
+ call_state);
+ return 0;
+ }
+
+ lockd->lock_app_pid =
+ lockd_process_mgr_start_lock(lockd, lockd_app_dead_cb,
+ lockd->lock_type);
+ if (lockd->lock_app_pid < 0)
+ return 0;
+ lockd_window_mgr_finish_lock(lockd->lockw);
+ lockd_window_mgr_ready_lock(lockd, lockd->lockw, lockd_app_create_cb,
+ lockd_app_show_cb);
+
+ return 1;
+}
+
+static void lockd_unlock_lockscreen(struct lockd_data *lockd)
+{
+ LOCKD_DBG("unlock lock screen");
+ lockd->lock_app_pid = 0;
+
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ lockd_window_mgr_finish_lock(lockd->lockw);
+}
+
+inline static void lockd_set_sock_option(int fd, int cli)
+{
+ int size;
+ int ret;
+ struct timeval tv = { 1, 200 * 1000 };
+
+ size = PHLOCK_SOCK_MAXBUFF;
+ ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
+ if(ret != 0)
+ return;
+ ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
+ if(ret != 0)
+ return;
+ if (cli) {
+ ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+ if(ret != 0)
+ return;
+ }
+}
+
+static int lockd_create_sock(void)
+{
+ struct sockaddr_un saddr;
+ int fd;
+
+ int n = sd_listen_fds(1);
+ if (n > 1) {
+ LOCKD_DBG("too many file descriptors received");
+ return -1;
+ } else if (n == 1) {
+ int r;
+ if ((r = sd_is_socket_unix(SD_LISTEN_FDS_START, SOCK_STREAM, 1, PHLOCK_SOCK_PREFIX, 0)) <= 0) {
+ LOCKD_DBG("passed systemd file descriptor is of wrong type");
+ return -1;
+ }
+ fd = SD_LISTEN_FDS_START + 0;
+ } else {
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ if (errno == EINVAL) {
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ LOCKD_DBG("second chance - socket create error");
+ return -1;
+ }
+ } else {
+ LOCKD_DBG("socket error");
+ return -1;
+ }
+ }
+
+ bzero(&saddr, sizeof(saddr));
+ saddr.sun_family = AF_UNIX;
+
+ strncpy(saddr.sun_path, PHLOCK_SOCK_PREFIX, strlen(PHLOCK_SOCK_PREFIX));
+ saddr.sun_path[strlen(PHLOCK_SOCK_PREFIX)] = 0;
+
+ unlink(saddr.sun_path);
+
+ if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
+ LOCKD_DBG("bind error");
+ close(fd);
+ return -1;
+ }
+
+ if (chmod(saddr.sun_path, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0) {
+ LOCKD_DBG("failed to change the socket permission");
+ close(fd);
+ return -1;
+ }
+
+ lockd_set_sock_option(fd, 0);
+
+ if (listen(fd, 10) == -1) {
+ LOCKD_DBG("listen error");
+ close(fd);
+ return -1;
+ }
+ }
+ return fd;
+}
+
+static gboolean lockd_glib_check(GSource * src)
+{
+ GSList *fd_list;
+ GPollFD *tmp;
+
+ fd_list = src->poll_fds;
+ do {
+ tmp = (GPollFD *) fd_list->data;
+ if ((tmp->revents & (POLLIN | POLLPRI)))
+ return TRUE;
+ fd_list = fd_list->next;
+ } while (fd_list);
+
+ return FALSE;
+}
+
+static char *lockd_read_cmdline_from_proc(int pid)
+{
+ int memsize = 32;
+ char path[32];
+ char *cmdline = NULL, *tempptr = NULL;
+ FILE *fp = NULL;
+
+ snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
+
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ LOCKD_DBG("Cannot open cmdline on pid[%d]", pid);
+ return NULL;
+ }
+
+ cmdline = malloc(32);
+ if (cmdline == NULL) {
+ LOCKD_DBG("%s", "Out of memory");
+ fclose(fp);
+ return NULL;
+ }
+
+ bzero(cmdline, memsize);
+ if (fgets(cmdline, 32, fp) == NULL) {
+ LOCKD_DBG("%s", "Cannot read cmdline");
+ free(cmdline);
+ fclose(fp);
+ return NULL;
+ }
+
+ while (cmdline[memsize - 2] != 0) {
+ cmdline[memsize - 1] = (char)fgetc(fp);
+ tempptr = realloc(cmdline, memsize + 32);
+ if (tempptr == NULL) {
+ fclose(fp);
+ LOCKD_DBG("%s", "Out of memory");
+ return NULL;
+ }
+ cmdline = tempptr;
+ bzero(cmdline + memsize, 32);
+ fgets(cmdline + memsize, 32, fp);
+ memsize += 32;
+ }
+
+ if (fp != NULL)
+ fclose(fp);
+ return cmdline;
+}
+
+static int lockd_sock_handler(void *data)
+{
+ int cl;
+ int len;
+ int sun_size;
+ int clifd = -1;
+ char cmd[PHLOCK_SOCK_MAXBUFF];
+ char *cmdline = NULL;
+ int val = -1;
+ int fd = -1;
+ int recovery_state = -1;
+ GPollFD *gpollfd;
+
+ struct ucred cr;
+ struct sockaddr_un lockd_addr;
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if ((lockd == NULL) || (lockd->gpollfd == NULL)) {
+ LOCKD_DBG("lockd->gpollfd is NULL");
+ return -1;
+ }
+ gpollfd = (GPollFD *)lockd->gpollfd;
+ fd = gpollfd->fd;
+
+ cl = sizeof(cr);
+ sun_size = sizeof(struct sockaddr_un);
+
+ if ((clifd =
+ accept(fd, (struct sockaddr *)&lockd_addr,
+ (socklen_t *) & sun_size)) == -1) {
+ if (errno != EINTR)
+ LOCKD_DBG("accept error");
+ return -1;
+ }
+
+ if (getsockopt(clifd, SOL_SOCKET, SO_PEERCRED, &cr, (socklen_t *) & cl)
+ < 0) {
+ LOCKD_DBG("peer information error");
+ close(clifd);
+ return -1;
+ }
+ LOCKD_DBG("Peer's pid=%d, uid=%d, gid=%d\n", cr.pid, cr.uid, cr.gid);
+
+ memset(cmd, 0, PHLOCK_SOCK_MAXBUFF);
+
+ lockd_set_sock_option(clifd, 1);
+
+ len = recv(clifd, cmd, PHLOCK_SOCK_MAXBUFF, 0);
+ cmd[PHLOCK_SOCK_MAXBUFF - 1] = '\0';
+
+ if (len != strlen(cmd)) {
+ LOCKD_DBG("recv error %d %d", len, strlen(cmd));
+ close(clifd);
+ return -1;
+ }
+
+ LOCKD_DBG("cmd %s", cmd);
+
+ cmdline = lockd_read_cmdline_from_proc(cr.pid);
+ if (cmdline == NULL) {
+ LOCKD_DBG("Error on opening /proc/%d/cmdline", cr.pid);
+ close(clifd);
+ return -1;
+ }
+
+ LOCKD_DBG("/proc/%d/cmdline : %s", cr.pid, cmdline);
+ LOCKD_DBG("phone_lock_pid : %d vs cr.pid : %d", phone_lock_pid, cr.pid);
+
+ if ((!strncmp(cmdline, PHLOCK_APP_CMDLINE, strlen(cmdline)))
+ && (!strncmp(cmd, PHLOCK_UNLOCK_CMD, strlen(cmd)))) {
+ LOCKD_DBG("cmd is %s\n", PHLOCK_UNLOCK_CMD);
+
+ if (phone_lock_pid == cr.pid) {
+ LOCKD_DBG("pid [%d] %s is verified, unlock..!!\n", cr.pid,
+ cmdline);
+ lockd_process_mgr_terminate_phone_lock(phone_lock_pid);
+ phone_lock_pid = 0;
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, TRUE);
+ }
+ } else if (!strncmp(cmd, PHLOCK_LAUNCH_CMD, strlen(cmd))) {
+ LOCKD_DBG("cmd is %s\n", PHLOCK_LAUNCH_CMD);
+ if (_lockd_get_lock_type() == 1) {
+ lockd->lock_type = 1;
+ lockd_launch_app_lockscreen(lockd);
+ }
+ }
+
+ if(cmdline != NULL) {
+ free(cmdline);
+ cmdline = NULL;
+ }
+
+ close(clifd);
+ return 0;
+}
+
+static gboolean lockd_glib_handler(gpointer data)
+{
+ if (lockd_sock_handler(data) < 0) {
+ LOCKD_DBG("lockd_sock_handler is failed..!!");
+ }
+ return TRUE;
+}
+
+static gboolean lockd_glib_dispatch(GSource * src, GSourceFunc callback,
+ gpointer data)
+{
+ callback(data);
+ return TRUE;
+}
+
+static gboolean lockd_glib_prepare(GSource * src, gint * timeout)
+{
+ return FALSE;
+}
+
+static GSourceFuncs funcs = {
+ .prepare = lockd_glib_prepare,
+ .check = lockd_glib_check,
+ .dispatch = lockd_glib_dispatch,
+ .finalize = NULL
+};
+
+static int lockd_init_sock(struct lockd_data *lockd)
+{
+ int fd;
+ GPollFD *gpollfd;
+ GSource *src;
+ int ret;
+
+ fd = lockd_create_sock();
+ if (fd < 0) {
+ LOCKD_DBG("lock daemon create sock failed..!!");
+ }
+
+ src = g_source_new(&funcs, sizeof(GSource));
+
+ gpollfd = (GPollFD *) g_malloc(sizeof(GPollFD));
+ gpollfd->events = POLLIN;
+ gpollfd->fd = fd;
+
+ lockd->gpollfd = gpollfd;
+
+ g_source_add_poll(src, lockd->gpollfd);
+ g_source_set_callback(src, (GSourceFunc) lockd_glib_handler,
+ (gpointer) lockd, NULL);
+ g_source_set_priority(src, G_PRIORITY_LOW);
+
+ ret = g_source_attach(src, NULL);
+ if (ret == 0)
+ return -1;
+
+ g_source_unref(src);
+
+ return 0;
+}
+
+static void lockd_init_vconf(struct lockd_data *lockd)
+{
+ int val = -1;
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_PM_STATE, _lockd_notify_pm_state_cb, lockd) != 0) {
+ LOCKD_ERR("Fail vconf_notify_key_changed : VCONFKEY_PM_STATE");
+ }
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION,
+ _lockd_notify_phone_lock_verification_cb, lockd) != 0) {
+ if (vconf_get_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, &val) < 0) {
+ LOCKD_ERR
+ ("Cannot get %s", VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION);
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, 0);
+ if (vconf_notify_key_changed
+ (VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION,
+ _lockd_notify_phone_lock_verification_cb,
+ lockd) != 0) {
+ LOCKD_ERR
+ ("Fail vconf_notify_key_changed : %s", VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION);
+ }
+ } else {
+ LOCKD_ERR
+ ("Fail vconf_notify_key_changed : %s", VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION);
+ }
+ }
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_IDLE_LOCK_STATE,
+ _lockd_notify_lock_state_cb,
+ lockd) != 0) {
+ LOCKD_ERR
+ ("[Error] vconf notify : lock state");
+ }
+}
+
+static void lockd_start_lock_daemon(void *data)
+{
+ struct lockd_data *lockd = NULL;
+ int r = 0;
+
+ lockd = (struct lockd_data *)data;
+
+ if (!lockd) {
+ return;
+ }
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockd_init_vconf(lockd);
+
+ r = lockd_init_sock(lockd);
+ if (r < 0) {
+ LOCKD_DBG("lockd init socket failed: %d", r);
+ }
+
+ lockd->lockw = lockd_window_init();
+
+ aul_listen_app_dead_signal(lockd_app_dead_cb, data);
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+}
+
+int start_lock_daemon(int launch_lock)
+{
+ struct lockd_data *lockd = NULL;
+ int val = -1;
+ int recovery_state = -1;
+ int first_boot = 0;
+ int lock_type = 0;
+ int ret = 0;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockd = (struct lockd_data *)malloc(sizeof(struct lockd_data));
+ memset(lockd, 0x0, sizeof(struct lockd_data));
+ lockd_start_lock_daemon(lockd);
+
+ if (launch_lock == FALSE) {
+ LOCKD_DBG("Don't launch lockscreen..");
+ return 0;
+ }
+
+ if (vconf_get_bool(VCONFKEY_PWLOCK_FIRST_BOOT, &first_boot) < 0) {
+ LOCKD_ERR("Cannot get %s vconfkey", VCONFKEY_PWLOCK_FIRST_BOOT);
+ } else if (first_boot == 1) {
+ LOCKD_DBG("first_boot : %d \n", first_boot);
+ return 0;
+ }
+
+ lock_type = _lockd_get_lock_type();
+ if (lock_type == 1) {
+ lockd->request_recovery = FALSE;
+ }
+ lockd->lock_type = lock_type;
+ ret = lockd_launch_app_lockscreen(lockd);
+ return ret;
+}
diff --git a/mobile/src/lockd-debug.c b/mobile/src/lockd-debug.c
new file mode 100644
index 0000000..72c7227
--- /dev/null
+++ b/mobile/src/lockd-debug.c
@@ -0,0 +1,94 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <glib.h>
+
+#include "lockd-debug.h"
+
+#define LINEMAX 256
+#define MAXFILELEN 1048576
+#define LOGFILE "/tmp/starter.log"
+
+void lockd_log_t(char *fmt, ...)
+{
+ va_list ap;
+ FILE *fd = 0;
+ char buf[LINEMAX] = { 0, };
+ char debugString[LINEMAX] = { 0, };
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ int fileLen = 0;
+ struct tm local_t;
+ time_t current_time = 0;
+ bzero((char *)&debugString, LINEMAX);
+ time(&current_time);
+ gmtime_r(&current_time, &local_t);
+ int len = snprintf(debugString, sizeof(debugString),
+ "[%d-%02d-%02d, %02d:%02d:%02d]: ",
+ local_t.tm_year + 1900, local_t.tm_mon + 1,
+ local_t.tm_mday, local_t.tm_hour, local_t.tm_min,
+ local_t.tm_sec);
+ if (len == -1) {
+ return;
+ } else {
+ debugString[len] = '\0';
+ }
+ len = g_strlcat(debugString, buf, LINEMAX);
+ if (len >= LINEMAX) {
+ return;
+ } else {
+ debugString[len] = '\n';
+ }
+ if ((fd = fopen(LOGFILE, "at+")) == NULL) {
+ LOCKD_DBG("File fopen fail for writing Pwlock information");
+ } else {
+ int pid = -1;
+ if (fwrite(debugString, strlen(debugString), 1, fd) < 1) {
+ LOCKD_DBG
+ ("File fwrite fail for writing Pwlock information");
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ } else {
+ fseek(fd, 0l, SEEK_END);
+ fileLen = ftell(fd);
+ if (fileLen > MAXFILELEN) {
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ return;
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ } else
+ fclose(fd);
+ }
+ }
+}
diff --git a/mobile/src/lockd-process-mgr.c b/mobile/src/lockd-process-mgr.c
new file mode 100644
index 0000000..f9bc863
--- /dev/null
+++ b/mobile/src/lockd-process-mgr.c
@@ -0,0 +1,176 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <aul.h>
+
+#include "lockd-debug.h"
+#include "lockd-process-mgr.h"
+#include "starter-vconf.h"
+
+#define LOCKD_DEFAULT_PKG_NAME "org.tizen.lockscreen"
+#define LOCKD_DEFAULT_LOCKSCREEN "org.tizen.lockscreen"
+#define LOCKD_PHONE_LOCK_PKG_NAME "org.tizen.lockscreen"
+#define RETRY_MAXCOUNT 30
+#define RELAUNCH_INTERVAL 100*1000
+
+static char *_lockd_process_mgr_get_pkgname(void)
+{
+ char *pkgname = NULL;
+
+ pkgname = vconf_get_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR);
+
+ LOCKD_DBG("pkg name is %s", pkgname);
+
+ if (pkgname == NULL) {
+ return LOCKD_DEFAULT_PKG_NAME;
+ }
+
+ return pkgname;
+}
+
+int lockd_process_mgr_restart_lock(int phone_lock_state)
+{
+ char *lock_app_path = NULL;
+ int pid;
+
+ lock_app_path = _lockd_process_mgr_get_pkgname();
+ pid = aul_launch_app(lock_app_path, NULL);
+
+ LOCKD_DBG("Reset : aul_launch_app(%s, NULL), pid = %d", lock_app_path,
+ pid);
+
+ return pid;
+}
+
+int lockd_process_mgr_start_lock(void *data, int (*dead_cb) (int, void *),
+ int phone_lock_state)
+{
+ char *lock_app_path = NULL;
+ int pid;
+ int ret;
+
+ lock_app_path = _lockd_process_mgr_get_pkgname();
+
+ int i;
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = aul_launch_app(lock_app_path, NULL);
+
+ LOCKD_DBG("aul_launch_app(%s), pid = %d", lock_app_path, pid);
+
+ if (pid == AUL_R_ECOMM) {
+ LOCKD_DBG("Relaunch lock application [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else if (pid == AUL_R_ERROR) {
+ LOCKD_DBG("launch[%s] is failed, launch default lock screen", lock_app_path);
+ ret = vconf_set_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, LOCKD_DEFAULT_LOCKSCREEN);
+ if (ret != 0) {
+ LOCKD_ERR("set failed");
+ }
+ pid = aul_launch_app(LOCKD_DEFAULT_LOCKSCREEN, NULL);
+ if (pid >0) {
+ return pid;
+ }
+ } else {
+ return pid;
+ }
+ }
+ LOCKD_DBG("Relaunch lock application failed..!!");
+ return pid;
+}
+
+int lockd_process_mgr_start_normal_lock(void *data, int (*dead_cb) (int, void *))
+{
+ int pid = 0;
+
+ int i;
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = aul_launch_app(LOCKD_DEFAULT_PKG_NAME, NULL);
+
+ LOCKD_DBG("aul_launch_app(%s), pid = %d", LOCKD_DEFAULT_PKG_NAME, pid);
+
+ if (pid == AUL_R_ECOMM) {
+ LOCKD_DBG("Relaunch lock application [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else if (pid == AUL_R_ERROR) {
+ LOCKD_DBG("launch[%s] is failed, launch default lock screen", LOCKD_DEFAULT_PKG_NAME);
+ pid = aul_launch_app(LOCKD_DEFAULT_LOCKSCREEN, NULL);
+ if (pid >0) {
+ return pid;
+ }
+ } else {
+ return pid;
+ }
+ }
+ LOCKD_DBG("Relaunch lock application failed..!!");
+ return pid;
+}
+
+int lockd_process_mgr_start_phone_lock(void)
+{
+ int pid = 0;
+
+ pid = aul_launch_app(LOCKD_PHONE_LOCK_PKG_NAME, NULL);
+ LOCKD_DBG("aul_launch_app(%s, b), pid = %d", LOCKD_PHONE_LOCK_PKG_NAME,
+ pid);
+ return pid;
+}
+
+void lockd_process_mgr_terminate_lock_app(int lock_app_pid, int state)
+{
+ LOCKD_DBG
+ ("lockd_process_mgr_terminate_lock_app, state:%d\n",
+ state);
+
+ if (state == 1) {
+ if (lock_app_pid != 0) {
+ LOCKD_DBG("Terminate Lock app(pid : %d)", lock_app_pid);
+ aul_terminate_pid(lock_app_pid);
+ }
+ }
+}
+
+void lockd_process_mgr_terminate_phone_lock(int phone_lock_pid)
+{
+ LOCKD_DBG("Terminate Phone Lock(pid : %d)", phone_lock_pid);
+ aul_terminate_pid(phone_lock_pid);
+}
+
+int lockd_process_mgr_check_lock(int pid)
+{
+ char buf[128];
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (aul_app_get_pkgname_bypid(pid, buf, sizeof(buf)) < 0) {
+ LOCKD_DBG("no such pkg by pid %d\n", pid);
+ } else {
+ LOCKD_DBG("app pkgname = %s, pid = %d\n", buf, pid);
+ if (aul_app_is_running(buf) == TRUE) {
+ LOCKD_DBG("%s [pid = %d] is running\n", buf, pid);
+ return TRUE;
+ } else {
+ LOCKD_DBG("[pid = %d] is exist but %s is not running\n",
+ pid, buf);
+ }
+ }
+ return FALSE;
+}
diff --git a/mobile/src/lockd-window-mgr.c b/mobile/src/lockd-window-mgr.c
new file mode 100644
index 0000000..4d826e5
--- /dev/null
+++ b/mobile/src/lockd-window-mgr.c
@@ -0,0 +1,283 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <ui-gadget.h>
+#include <vconf.h>
+#include <bundle.h>
+#include <appcore-efl.h>
+#include <app.h>
+
+#include "lockd-debug.h"
+#include "lockd-window-mgr.h"
+
+#define PACKAGE "starter"
+#define SOS_KEY_COUNT 3
+#define SOS_KEY_INTERVAL 0.5
+
+struct _lockw_data {
+ Evas_Object *main_win;
+ Evas_Object *main_layout;
+
+ Ecore_X_Window lock_x_window;
+
+ Ecore_Event_Handler *h_keydown;
+ Ecore_Event_Handler *h_wincreate;
+ Ecore_Event_Handler *h_winshow;
+
+ Ecore_Timer *pTimerId;
+ int volume_key_cnt;
+
+ int phone_lock_state;
+ int phone_lock_app_pid;
+};
+
+static Eina_Bool _lockd_window_key_down_cb(void *data, int type, void *event)
+{
+ Ecore_Event_Key *ev = event;
+
+ LOCKD_DBG("Key Down CB : %s", ev->keyname);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static int
+_lockd_window_check_validate_rect(Ecore_X_Display * dpy, Ecore_X_Window window)
+{
+ Ecore_X_Window root;
+ Ecore_X_Window child;
+
+ int rel_x = 0;
+ int rel_y = 0;
+ int abs_x = 0;
+ int abs_y = 0;
+
+ unsigned int width = 0;
+ unsigned int height = 0;
+ unsigned int border = 0;
+ unsigned int depth = 0;
+
+ Eina_Bool ret = FALSE;
+
+ root = ecore_x_window_root_first_get();
+
+ if (XGetGeometry
+ (dpy, window, &root, &rel_x, &rel_y, &width, &height, &border,
+ &depth)) {
+ if (XTranslateCoordinates
+ (dpy, window, root, 0, 0, &abs_x, &abs_y, &child)) {
+ if ((abs_x - border) >= 480 || (abs_y - border) >= 800
+ || (width + abs_x) <= 0 || (height + abs_y) <= 0) {
+ ret = FALSE;
+ } else {
+ ret = TRUE;
+ }
+ }
+ }
+
+ return ret;
+}
+
+static Window get_user_created_window(Window win)
+{
+ Atom type_ret = 0;
+ int ret, size_ret = 0;
+ unsigned long num_ret = 0, bytes = 0;
+ unsigned char *prop_ret = NULL;
+ unsigned int xid;
+ Atom prop_user_created_win;
+
+ prop_user_created_win =
+ XInternAtom(ecore_x_display_get(), "_E_USER_CREATED_WINDOW", False);
+
+ ret =
+ XGetWindowProperty(ecore_x_display_get(), win,
+ prop_user_created_win, 0L, 1L, False, 0,
+ &type_ret, &size_ret, &num_ret, &bytes,
+ &prop_ret);
+
+ if (ret != Success) {
+ if (prop_ret)
+ XFree((void *)prop_ret);
+ return win;
+ } else if (!prop_ret) {
+ return win;
+ }
+
+ memcpy(&xid, prop_ret, sizeof(unsigned int));
+ XFree((void *)prop_ret);
+
+ return xid;
+
+}
+
+Eina_Bool
+lockd_window_set_window_property(lockw_data * data, int lock_app_pid,
+ void *event)
+{
+ Ecore_X_Event_Window_Create *e = event;
+ Ecore_X_Window user_window = 0;
+ lockw_data *lockw = (lockw_data *) data;
+ int pid = 0;
+
+ if (!lockw) {
+ return EINA_FALSE;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ user_window = get_user_created_window((Window) (e->win));
+
+ int ret = ecore_x_netwm_pid_get(user_window, &pid);
+ if(ret != 1) {
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("Check PID(%d) window. (lock_app_pid : %d)\n", pid,
+ lock_app_pid);
+
+ if (lock_app_pid == pid) {
+ if (_lockd_window_check_validate_rect
+ (ecore_x_display_get(), user_window) == TRUE) {
+ lockw->lock_x_window = user_window;
+ LOCKD_DBG
+ ("This is lock application. Set window property. win id : %x",
+ user_window);
+
+ ecore_x_icccm_name_class_set(user_window, "LOCK_SCREEN",
+ "LOCK_SCREEN");
+ ecore_x_netwm_window_type_set(user_window,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ utilx_set_system_notification_level(ecore_x_display_get
+ (), user_window,
+ UTILX_NOTIFICATION_LEVEL_NORMAL);
+ utilx_set_window_opaque_state(ecore_x_display_get(),
+ user_window,
+ UTILX_OPAQUE_STATE_ON);
+ return EINA_TRUE;
+ }
+ }
+ return EINA_FALSE;
+}
+
+Eina_Bool
+lockd_window_set_window_effect(lockw_data * data, int lock_app_pid, void *event)
+{
+ Ecore_X_Event_Window_Create *e = event;
+ Ecore_X_Window user_window = 0;
+ int pid = 0;
+
+ user_window = get_user_created_window((Window) (e->win));
+ int ret = ecore_x_netwm_pid_get(user_window, &pid);
+ if(ret != 1) {
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ LOCKD_DBG("PID(%d) window created. (lock_app_pid : %d)\n", pid,
+ lock_app_pid);
+
+ if (lock_app_pid == pid) {
+ if (_lockd_window_check_validate_rect
+ (ecore_x_display_get(), user_window) == TRUE) {
+ LOCKD_DBG
+ ("This is lock application. Disable window effect. win id : %x\n",
+ user_window);
+
+ utilx_set_window_effect_state(ecore_x_display_get(),
+ user_window, 0);
+ return EINA_TRUE;
+ }
+ }
+ return EINA_FALSE;
+}
+
+void lockd_window_set_phonelock_pid(lockw_data * data, int phone_lock_pid)
+{
+ lockw_data *lockw = (lockw_data *) data;
+
+ if (!lockw) {
+ return;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ lockw->phone_lock_app_pid = phone_lock_pid;
+ LOCKD_DBG("%s, %d, lockw->phone_lock_app_pid = %d", __func__, __LINE__,
+ lockw->phone_lock_app_pid);
+}
+
+void
+lockd_window_mgr_ready_lock(void *data, lockw_data * lockw,
+ Eina_Bool(*create_cb) (void *, int, void *),
+ Eina_Bool(*show_cb) (void *, int, void *))
+{
+ if (lockw == NULL) {
+ LOCKD_ERR("lockw is NULL.");
+ return;
+ }
+ lockw->h_wincreate =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, create_cb,
+ data);
+ lockw->h_winshow =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, show_cb, data);
+
+ lockw->volume_key_cnt = 0;
+
+ lockw->h_keydown =
+ ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
+ _lockd_window_key_down_cb, lockw);
+}
+
+void lockd_window_mgr_finish_lock(lockw_data * lockw)
+{
+ Ecore_X_Window xwin;
+
+ if (lockw == NULL) {
+ LOCKD_ERR("lockw is NULL.");
+ return;
+ }
+ if (lockw->h_wincreate != NULL) {
+ ecore_event_handler_del(lockw->h_wincreate);
+ lockw->h_wincreate = NULL;
+ }
+ if (lockw->h_winshow != NULL) {
+ ecore_event_handler_del(lockw->h_winshow);
+ lockw->h_winshow = NULL;
+ }
+
+ ecore_x_pointer_ungrab();
+
+ if (lockw->h_keydown != NULL) {
+ ecore_event_handler_del(lockw->h_keydown);
+ lockw->h_keydown = NULL;
+ }
+}
+
+lockw_data *lockd_window_init(void)
+{
+ lockw_data *lockw = NULL;
+ long pid;
+
+ lockw = (lockw_data *) malloc(sizeof(lockw_data));
+ memset(lockw, 0x0, sizeof(lockw_data));
+
+ pid = getpid();
+
+ return lockw;
+}
diff --git a/mobile/src/menu_daemon.c b/mobile/src/menu_daemon.c
new file mode 100644
index 0000000..ebb5237
--- /dev/null
+++ b/mobile/src/menu_daemon.c
@@ -0,0 +1,373 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <ail.h>
+#include <aul.h>
+#include <db-util.h>
+#include <Elementary.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pkgmgr-info.h>
+#include <stdio.h>
+#include <sysman.h>
+#include <syspopup_caller.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <vconf.h>
+
+#include "hw_key.h"
+#include "pkg_event.h"
+#include "util.h"
+#include "xmonitor.h"
+
+
+int errno;
+
+
+#define QUERY_UPDATE_NAME "UPDATE app_info SET name='%s' where package='%s';"
+#define SAT_DESKTOP_FILE "/opt/share/applications/org.tizen.sat-ui.desktop"
+#define RELAUNCH_INTERVAL 100*1000
+#define RETRY_MAXCOUNT 30
+
+static struct info {
+ pid_t home_pid;
+ pid_t volume_pid;
+ int power_off;
+} s_info = {
+ .home_pid = -1,
+ .volume_pid = -1,
+ .power_off = 0,
+};
+
+
+
+#define RETRY_COUNT 5
+int menu_daemon_open_app(const char *pkgname)
+{
+ register int i;
+ int r = AUL_R_ETIMEOUT;
+ for (i = 0; AUL_R_ETIMEOUT == r && i < RETRY_COUNT; i ++) {
+ r = aul_open_app(pkgname);
+ if (0 <= r) return r;
+ else {
+ _D("aul_open_app error(%d)", r);
+ _F("cannot open an app(%s) by %d", pkgname, r);
+ }
+ usleep(500000);
+ }
+
+ return r;
+}
+
+
+
+int menu_daemon_launch_app(const char *pkgname, bundle *b)
+{
+ register int i;
+ int r = AUL_R_ETIMEOUT;
+ for (i = 0; AUL_R_ETIMEOUT == r && i < RETRY_COUNT; i ++) {
+ r = aul_launch_app(pkgname, b);
+ if (0 <= r) return r;
+ else {
+ _D("aul_launch_app error(%d)", r);
+ _F("cannot launch an app(%s) by %d", pkgname, r);
+ }
+ usleep(500000);
+ }
+
+ return r;
+}
+
+
+
+bool menu_daemon_is_homescreen(pid_t pid)
+{
+ if (s_info.home_pid == pid) return true;
+ return false;
+}
+
+
+
+inline char *menu_daemon_get_selected_pkgname(void)
+{
+ char *pkgname = NULL;
+
+ pkgname = vconf_get_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME);
+ retv_if(NULL == pkgname, NULL);
+
+ return pkgname;
+}
+
+
+
+static bool _exist_package(char *pkgid)
+{
+ int ret = 0;
+ pkgmgrinfo_pkginfo_h handle = NULL;
+
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (PMINFO_R_OK != ret || NULL == handle) {
+ _D("%s doesn't exist in this binary", pkgid);
+ return false;
+ }
+
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return true;
+}
+
+
+
+inline void menu_daemon_open_homescreen(const char *pkgname)
+{
+ char *homescreen = NULL;
+ char *tmp = NULL;
+
+ system("echo -e '[${_G}menu-daemon launches home-screen${C_}]' > /dev/kmsg");
+
+ if (NULL == pkgname) {
+ tmp = menu_daemon_get_selected_pkgname();
+ ret_if(NULL == tmp);
+ homescreen = tmp;
+ } else {
+ homescreen = (char *) pkgname;
+ }
+
+ syspopup_destroy_all();
+
+ int ret;
+ ret = menu_daemon_open_app(homescreen);
+ _D("can%s launch %s now. (%d)", ret < 0 ? "not" : "", homescreen, ret);
+ if (ret < 0 && strcmp(homescreen, HOME_SCREEN_PKG_NAME) && _exist_package(HOME_SCREEN_PKG_NAME)) {
+ _E("cannot launch package %s", homescreen);
+
+ if (0 != vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, HOME_SCREEN_PKG_NAME)) {
+ _E("Cannot set value(%s) into key(%s)", VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, HOME_SCREEN_PKG_NAME);
+ }
+
+ while (AUL_R_ETIMEOUT == ret) {
+ _E("Failed to open a default home, %s", HOME_SCREEN_PKG_NAME);
+ ret = menu_daemon_open_app(HOME_SCREEN_PKG_NAME);
+ }
+ }
+
+ if (ret < 0) {
+ _E("Critical! Starter cannot launch anymore[%d]", ret);
+ _F("Critical! Starter cannot launch anymore[%d]", ret);
+ }
+
+ s_info.home_pid = ret;
+ if (ret > 0) {
+ if (-1 == sysconf_set_mempolicy_bypid(ret, OOM_IGNORE)) {
+ _E("Cannot set the memory policy for Home-screen(%d)", ret);
+ } else {
+ _D("Set the memory policy for Home-screen(%d)", ret);
+ }
+ }
+
+ if (tmp) free(tmp);
+}
+
+
+
+static void _show_cb(keynode_t* node, void *data)
+{
+ int seq;
+
+ _D("[MENU_DAEMON] _show_cb is invoked");
+
+ if (node) {
+ seq = vconf_keynode_get_int(node);
+ } else {
+ if (vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &seq) < 0) {
+ _E("Failed to get sequence info");
+ return;
+ }
+ }
+
+ switch (seq) {
+ case 0:
+ if (s_info.home_pid > 0) {
+ int pid;
+ _D("pid[%d] is terminated.", s_info.home_pid);
+ pid = s_info.home_pid;
+ s_info.home_pid = -1;
+
+ if (aul_terminate_pid(pid) != AUL_R_OK)
+ _E("Failed to terminate %d", s_info.home_pid);
+ }
+ break;
+ case 1:
+ menu_daemon_open_homescreen(NULL);
+ break;
+ default:
+ _E("False sequence [%d]", seq);
+ break;
+ }
+
+ return;
+}
+
+
+
+static void _pkg_changed(keynode_t* node, void *data)
+{
+ char *pkgname;
+ int seq;
+
+ if (vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &seq) < 0) {
+ _E("Do nothing, there is no sequence info yet");
+ return;
+ }
+
+ if (seq < 1) {
+ _E("Sequence is not ready yet, do nothing");
+ return;
+ }
+
+ _D("_pkg_changed is invoked");
+
+ pkgname = menu_daemon_get_selected_pkgname();
+ if (!pkgname)
+ return;
+
+ _D("pkg_name : %s", pkgname);
+
+ if (s_info.home_pid > 0) {
+ char old_pkgname[256];
+
+ if (aul_app_get_pkgname_bypid(s_info.home_pid, old_pkgname, sizeof(old_pkgname)) == AUL_R_OK) {
+ if (!strcmp(pkgname, old_pkgname)) {
+ _D("Package is changed but same package is selected");
+ free(pkgname);
+ return;
+ }
+ }
+
+ if (AUL_R_OK != aul_terminate_pid(s_info.home_pid))
+ _D("Failed to terminate pid %d", s_info.home_pid);
+ } else {
+ /* If there is no running home */
+ menu_daemon_open_homescreen(pkgname);
+ }
+
+ free(pkgname);
+ return;
+}
+
+
+
+static void _launch_volume(void)
+{
+ int pid;
+ int i;
+ _D("_launch_volume");
+
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = syspopup_launch("volume", NULL);
+
+ _D("syspopup_launch(volume), pid = %d", pid);
+
+ if (pid <0) {
+ _D("syspopup_launch(volume)is failed [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else {
+ s_info.volume_pid = pid;
+ return;
+ }
+ }
+}
+
+int menu_daemon_check_dead_signal(int pid)
+{
+ if (s_info.power_off) {
+ _D("Power off. ignore dead cb\n");
+ return 0;
+ }
+
+ _D("Process %d is termianted", pid);
+
+ if (pid < 0)
+ return 0;
+
+ if (pid == s_info.home_pid) {
+ char *pkgname = NULL;
+ pkgname = menu_daemon_get_selected_pkgname();
+ retv_if(NULL == pkgname, 0);
+
+ _D("pkg_name : %s", pkgname);
+ menu_daemon_open_homescreen(pkgname);
+ free(pkgname);
+ } else if (pid == s_info.volume_pid) {
+ _launch_volume();
+ } else {
+ _D("Unknown process, ignore it (pid %d, home pid %d)",
+ pid, s_info.home_pid);
+ }
+
+
+ return 0;
+}
+
+
+
+void menu_daemon_init(void *data)
+{
+ _D( "[MENU_DAEMON]menu_daemon_init is invoked");
+
+ aul_launch_init(NULL,NULL);
+
+ create_key_window();
+ if (xmonitor_init() < 0) _E("cannot init xmonitor");
+
+ pkg_event_init();
+ _launch_volume();
+
+ if (unlink(SAT_DESKTOP_FILE) != 0)
+ _E("cannot remove sat-ui desktop.");
+
+ if (vconf_notify_key_changed(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, _pkg_changed, NULL) < 0)
+ _E("Failed to add the callback for package change event");
+
+ if (vconf_notify_key_changed(VCONFKEY_STARTER_SEQUENCE, _show_cb, NULL) < 0)
+ _E("Failed to add the callback for show event");
+
+ _pkg_changed(NULL, NULL);
+ vconf_set_int(VCONFKEY_IDLE_SCREEN_LAUNCHED, VCONFKEY_IDLE_SCREEN_LAUNCHED_TRUE);
+}
+
+
+
+void menu_daemon_fini(void)
+{
+ if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, _pkg_changed) < 0)
+ _E("Failed to ignore the callback for package change event");
+
+ if (vconf_ignore_key_changed(VCONFKEY_STARTER_SEQUENCE, _show_cb) < 0)
+ _E("Failed to ignore the callback for show event");
+
+ xmonitor_fini();
+ pkg_event_fini();
+ destroy_key_window();
+}
+
+
+
+// End of a file
diff --git a/mobile/src/pkg_event.c b/mobile/src/pkg_event.c
new file mode 100644
index 0000000..46feba9
--- /dev/null
+++ b/mobile/src/pkg_event.c
@@ -0,0 +1,301 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <ail.h>
+#include <errno.h>
+#include <Elementary.h>
+#include <Ecore.h>
+#include <Ecore_File.h>
+#include <stdio.h>
+#include <sys/inotify.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <vconf.h>
+
+#include "pkg_event.h"
+#include "util.h"
+
+
+#define CONF_FILE "/usr/share/install-info/desktop.conf"
+#define BUFSZE 1024
+
+
+extern int errno;
+struct inotify_path
+{
+ int wd;
+ char *path;
+};
+
+struct desktop_notifier s_desktop_notifier = {
+ .number = 0,
+ .ifd = 0,
+ .handler = NULL,
+};
+
+
+
+struct inotify_path paths[CONF_PATH_NUMBER];
+
+
+static Eina_Bool
+directory_notify(void* data, Ecore_Fd_Handler* fd_handler)
+{
+ char *buf;
+ ssize_t read_size, len, i = 0;
+ int fd;
+
+ fd = ecore_main_fd_handler_fd_get(fd_handler);
+ _D("There are some modification, ifd [%d]", fd);
+ if(fd < 0) {
+ _E("Failed to get fd");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (ioctl(fd, FIONREAD, &read_size) < 0) {
+ _E("Failed to get q size");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (read_size <= 0) {
+ _E("Buffer is not ready!!!");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ buf = malloc(read_size);
+ if (!buf) {
+ _E("Failed to allocate heap for event handling");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ len = read(fd, buf, read_size);
+ if (len < 0) {
+ free(buf);
+ return ECORE_CALLBACK_CANCEL;
+ }
+ buf[read_size - 1] = '\0';
+
+ while (i < len) {
+ struct inotify_event* event = (struct inotify_event*) &buf[i];
+ char *str_potksed = "potksed.";
+ char *package = NULL;
+ ssize_t idx;
+ int nev_name;
+
+ nev_name = strlen(event->name) - 1;
+ for (idx = 0; nev_name >= 0 && str_potksed[idx]; idx++) {
+ if (event->name[nev_name] != str_potksed[idx]) {
+ break;
+ }
+ nev_name --;
+ }
+
+ if (str_potksed[idx] != '\0' || nev_name < 0) {
+ _D("This is not a desktop file : %s", event->name);
+ i += sizeof(struct inotify_event) + event->len;
+ continue;
+ }
+
+ package = strdup(event->name);
+ break_if(NULL == package);
+
+ package[nev_name + 1] = '\0';
+ _D("Package : %s", package);
+
+ if (event->mask & IN_CLOSE_WRITE || event->mask & IN_MOVED_TO) {
+ ail_appinfo_h ai = NULL;
+ ail_error_e ret;
+
+ ret = ail_get_appinfo(package, &ai);
+ if (AIL_ERROR_OK == ret || AIL_ERROR_NO_DATA == ret) {
+ if (ai) ail_destroy_appinfo(ai);
+
+ if (AIL_ERROR_NO_DATA == ret) {
+ if (ail_desktop_add(package) < 0) {
+ _D("Failed to add a new package (%s)", event->name);
+ }
+ } else if (AIL_ERROR_OK == ret) {
+ if (ail_desktop_update(package) < 0) {
+ _D("Failed to add a new package (%s)", event->name);
+ }
+ }
+ } else {
+ _E("Failed to get appinfo");
+ }
+ } else if (event->mask & IN_DELETE) {
+ if (ail_desktop_remove(package) < 0)
+ _D("Failed to remove a package (%s)", event->name);
+ } else {
+ _D("this event is not dealt with inotify");
+ }
+
+ free(package);
+
+ i += sizeof(struct inotify_event) + event->len;
+ }
+
+ free(buf);
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+static inline char *_ltrim(char *str)
+{
+ retv_if(NULL == str, NULL);
+ while (*str && (*str == ' ' || *str == '\t' || *str == '\n')) str ++;
+ return str;
+}
+
+
+
+static inline int _rtrim(char *str)
+{
+ int len;
+
+ retv_if(NULL == str, 0);
+
+ len = strlen(str);
+ while (--len >= 0 && (str[len] == ' ' || str[len] == '\n' || str[len] == '\t')) {
+ str[len] = '\0';
+ }
+
+ return len;
+}
+
+
+
+static int _retrieve_conf_path(struct inotify_path* paths)
+{
+ char *line = NULL;
+ FILE *fp;
+ size_t size = 0;
+ ssize_t read;
+ int i = 0;
+
+ fp = fopen(CONF_FILE, "r");
+ if (NULL == fp) {
+ _E(CONF_FILE);
+ return -1;
+ }
+
+ while ((read = getline(&line, &size, fp)) != -1 && i < CONF_PATH_NUMBER - 1) {
+ char *begin;
+
+ if (size <= 0) break;
+
+ begin = _ltrim(line);
+ _rtrim(line);
+
+ if (*begin == '#' || *begin == '\0') continue;
+
+ paths[i].path = strdup(begin);
+ i++;
+ }
+
+ if (line) free(line);
+ paths[i].path = NULL;
+ fclose(fp);
+
+ return i;
+}
+
+
+
+static void _unretrieve_conf_path(struct inotify_path* paths, int number)
+{
+ register int i;
+
+ for (i = 0; i < number; i ++) {
+ if (paths[i].path) {
+ free(paths[i].path);
+ paths[i].path = NULL;
+ }
+ }
+}
+
+
+
+void pkg_event_init()
+{
+ int wd = 0;
+ int i;
+
+ s_desktop_notifier.ifd = inotify_init();
+ if (s_desktop_notifier.ifd == -1) {
+ _E("inotify_init error: %s", strerror(errno));
+ return;
+ }
+
+ s_desktop_notifier.number = _retrieve_conf_path(paths);
+
+ for (i = 0; i < CONF_PATH_NUMBER && paths[i].path; i++)
+ {
+ _D("Configuration file for desktop file monitoring [%s] is added", paths[i].path);
+ if (access(paths[i].path, R_OK) != 0)
+ {
+ ecore_file_mkpath(paths[i].path);
+ if (chmod(paths[i].path, 0777) == -1) {
+ _E("cannot chmod %s", paths[i].path);
+ }
+ }
+
+ wd = inotify_add_watch(s_desktop_notifier.ifd, paths[i].path, IN_CLOSE_WRITE | IN_MOVED_TO | IN_DELETE);
+ if (wd == -1) {
+ _E("inotify_add_watch error: %s", strerror(errno));
+ close(s_desktop_notifier.ifd);
+ return;
+ }
+
+ paths[i].wd = wd;
+ }
+
+ s_desktop_notifier.handler = ecore_main_fd_handler_add(s_desktop_notifier.ifd, ECORE_FD_READ, directory_notify, NULL, NULL, NULL);
+ if (!s_desktop_notifier.handler) {
+ _E("cannot add handler for inotify");
+ }
+}
+
+
+
+void pkg_event_fini(void)
+{
+ register int i;
+
+ if (s_desktop_notifier.handler) {
+ ecore_main_fd_handler_del(s_desktop_notifier.handler);
+ }
+
+ for (i = 0; i < CONF_PATH_NUMBER; i ++) {
+ if (paths[i].wd) {
+ if (inotify_rm_watch(s_desktop_notifier.ifd, paths[i].wd) < 0) {
+ _E("Error: %s", strerror(errno));
+ }
+ paths[i].wd = 0;
+ }
+ }
+
+ _unretrieve_conf_path(paths, s_desktop_notifier.number);
+
+ if (s_desktop_notifier.ifd) {
+ close(s_desktop_notifier.ifd);
+ s_desktop_notifier.ifd = 0;
+ }
+}
diff --git a/mobile/src/starter.c b/mobile/src/starter.c
new file mode 100644
index 0000000..d96c444
--- /dev/null
+++ b/mobile/src/starter.c
@@ -0,0 +1,273 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <Elementary.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <poll.h>
+#include <systemd/sd-daemon.h>
+
+#include <aul.h>
+#include <vconf.h>
+#include <heynoti.h>
+#include <signal.h>
+#include <system_info.h>
+
+#include "starter.h"
+#include "starter-util.h"
+#include "x11.h"
+#include "lock-daemon.h"
+#include "lockd-debug.h"
+#include "menu_daemon.h"
+
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "org.tizen.starter"
+#endif
+
+#define DEFAULT_THEME "tizen"
+#define PWLOCK_PATH "/usr/apps/org.tizen.pwlock/bin/pwlock"
+#define PWLOCK_PKG_NAME "org.tizen.pwlock"
+#define QP_EMUL_STR "Emulator"
+
+static void lock_menu_screen(void)
+{
+ vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 0);
+}
+
+static void unlock_menu_screen(void)
+{
+ int r;
+ int show_menu;
+
+ show_menu = 0;
+ r = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &show_menu);
+ if (r || !show_menu) {
+ vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+ }
+}
+
+static void _set_elm_theme(void)
+{
+ char *vstr;
+ char *theme;
+ Elm_Theme *th = NULL;
+ vstr = vconf_get_str(VCONFKEY_SETAPPL_WIDGET_THEME_STR);
+ if (vstr == NULL)
+ theme = DEFAULT_THEME;
+ else
+ theme = vstr;
+
+ th = elm_theme_new();
+ _DBG("theme vconf[%s]\n set[%s]\n", vstr, theme);
+ elm_theme_set(th, theme);
+
+ if (vstr)
+ free(vstr);
+}
+
+static int _check_emul()
+{
+ int is_emul = 0;
+ char *info = NULL;
+
+ if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) {
+ if (info == NULL) return 0;
+ if (!strncmp(QP_EMUL_STR, info, strlen(info))) {
+ is_emul = 1;
+ }
+ }
+
+ if (info != NULL) free(info);
+
+ return is_emul;
+}
+
+static int _launch_pwlock(void)
+{
+ int r;
+
+ _DBG("%s", __func__);
+
+ if(_check_emul()) {
+ _DBG("Emulator => skip pwlock");
+ vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+ return 0;
+ }
+
+ r = aul_launch_app(PWLOCK_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("PWLock launch error: error(%d)", r);
+ if (r == AUL_R_ETIMEOUT) {
+ _DBG("Launch pwlock is failed for AUL_R_ETIMEOUT, again launch pwlock");
+ r = aul_launch_app(PWLOCK_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("2'nd PWLock launch error: error(%d)", r);
+ return -1;
+ } else {
+ _DBG("Launch pwlock");
+ return 0;
+ }
+ } else {
+ return -1;
+ }
+ } else {
+ _DBG("Launch pwlock");
+ return 0;
+ }
+}
+
+static void _signal_handler(int signum, siginfo_t *info, void *unused)
+{
+ _DBG("_signal_handler : Terminated...");
+ elm_exit();
+}
+
+static void _heynoti_event_power_off(void *data)
+{
+ _DBG("_heynoti_event_power_off : Terminated...");
+ elm_exit();
+}
+
+static Eina_Bool _init_idle(void *data)
+{
+ _DBG("%s %d\n", __func__, __LINE__);
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ menu_daemon_init(NULL);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void _lock_state_cb(keynode_t * node, void *data)
+{
+ _DBG("%s %d\n", __func__, __LINE__);
+ WRITE_FILE_LOG("%s", "Lock state is changed!");
+
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ menu_daemon_init(NULL);
+ if (vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb) != 0) {
+ LOCKD_DBG("Fail to unregister");
+ }
+}
+
+static void _init(struct appdata *ad)
+{
+ int r;
+ struct sigaction act;
+
+ memset(&act,0x00,sizeof(struct sigaction));
+ act.sa_sigaction = _signal_handler;
+ act.sa_flags = SA_SIGINFO;
+
+ int ret = sigemptyset(&act.sa_mask);
+ if (ret < 0) {
+ _ERR("Failed to sigemptyset[%s]", strerror(errno));
+ }
+ ret = sigaddset(&act.sa_mask, SIGTERM);
+ if (ret < 0) {
+ _ERR("Failed to sigaddset[%s]", strerror(errno));
+ }
+ ret = sigaction(SIGTERM, &act, NULL);
+ if (ret < 0) {
+ _ERR("Failed to sigaction[%s]", strerror(errno));
+ }
+
+ memset(ad, 0, sizeof(struct appdata));
+
+ gettimeofday(&ad->tv_start, NULL);
+
+ lock_menu_screen();
+ _set_elm_theme();
+
+ _DBG("%s %d\n", __func__, __LINE__);
+
+ r = start_lock_daemon(TRUE);
+ if (r == 1) {
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify : lock state");
+ ecore_timer_add(1.5, _init_idle, NULL);
+ }
+ } else {
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ menu_daemon_init(NULL);
+ }
+}
+
+static void _fini(struct appdata *ad)
+{
+ struct timeval tv, res;
+
+ if (ad == NULL) {
+ fprintf(stderr, "Invalid argument: appdata is NULL\n");
+ return;
+ }
+
+ unlock_menu_screen();
+ menu_daemon_fini();
+
+ gettimeofday(&tv, NULL);
+ timersub(&tv, &ad->tv_start, &res);
+ _DBG("Total time: %d.%06d sec\n", (int)res.tv_sec, (int)res.tv_usec);
+}
+
+int main(int argc, char *argv[])
+{
+ struct appdata ad;
+
+ WRITE_FILE_LOG("%s", "Main function is started in starter");
+
+ int heyfd = heynoti_init();
+ if (heyfd < 0) {
+ _ERR("Failed to heynoti_init[%d]", heyfd);
+ return -1;
+ }
+
+ int ret = heynoti_subscribe(heyfd, "power_off_start", _heynoti_event_power_off, NULL);
+ if (ret < 0) {
+ _ERR("Failed to heynoti_subscribe[%d]", ret);
+ }
+ ret = heynoti_attach_handler(heyfd);
+ if (ret < 0) {
+ _ERR("Failed to heynoti_attach_handler[%d]", ret);
+ }
+
+ elm_init(argc, argv);
+
+ _init(&ad);
+
+ sd_notify(0, "READY=1");
+ elm_run();
+
+ _fini(&ad);
+
+ elm_shutdown();
+
+ return 0;
+}
diff --git a/mobile/src/x11.c b/mobile/src/x11.c
new file mode 100644
index 0000000..df41f28
--- /dev/null
+++ b/mobile/src/x11.c
@@ -0,0 +1,111 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define DEFAULT_WINDOW_H 1280
+
+void prop_string_set(const char *name, const char *value)
+{
+ Display *d;
+ Atom a_name;
+ Atom a_UTF8;
+ XTextProperty xtp;
+
+ if (name == NULL || value == NULL || value[0] == '\0')
+ return;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_name = XInternAtom(d, name, False);
+ if (a_name == None)
+ goto exit;
+
+ a_UTF8 = XInternAtom(d, "UTF8_STRING", False);
+ if (a_UTF8 == None)
+ goto exit;
+
+ xtp.value = (unsigned char *)value;
+ xtp.format = 8;
+ xtp.encoding = a_UTF8;
+ xtp.nitems = strlen(value);
+
+ XSetTextProperty(d, DefaultRootWindow(d), &xtp, a_name);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+void prop_int_set(const char *name, unsigned int val)
+{
+ Display *d;
+ Atom a_name;
+
+ if (name == NULL)
+ return;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_name = XInternAtom(d, name, False);
+ if (a_name == None)
+ goto exit;
+
+ XChangeProperty(d, DefaultRootWindow(d), a_name, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&val, 1);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+void set_window_scale(void)
+{
+ double root_width = 0.0, root_height = 0.0;
+ char buf[128] = { 0, };
+ Display *disp;
+ int screen_num;
+
+ disp = XOpenDisplay(NULL);
+ if (disp == NULL)
+ return;
+
+ screen_num = DefaultScreen(disp);
+
+ root_width = DisplayWidth(disp, screen_num);
+ root_height = DisplayHeight(disp, screen_num);
+
+ XCloseDisplay(disp);
+
+ snprintf(buf, sizeof(buf), "%lf", root_height / DEFAULT_WINDOW_H);
+
+ if (root_width == 800 && root_height == 1280) {
+ snprintf(buf, sizeof(buf), "0.71");
+ }
+
+ setenv("ELM_SCALE", buf, 1);
+ setenv("SCALE_FACTOR", buf, 1);
+}
diff --git a/mobile/src/xmonitor.c b/mobile/src/xmonitor.c
new file mode 100644
index 0000000..4c87285
--- /dev/null
+++ b/mobile/src/xmonitor.c
@@ -0,0 +1,296 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <ail.h>
+#include <aul.h>
+#include <dlog.h>
+#include <Ecore.h>
+#include <Ecore_X.h>
+#include <Evas.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/shm.h>
+#include <vconf.h>
+
+#include "menu_daemon.h"
+#include "util.h"
+#include "starter-util.h"
+#include "xmonitor.h"
+
+
+
+static struct info {
+ Ecore_Event_Handler *create_handler;
+ Ecore_Event_Handler *destroy_handler;
+ Ecore_Event_Handler *focus_in_handler;
+ Ecore_Event_Handler *focus_out_handler;
+ int is_top;
+} xmonitor_info = {
+ .create_handler = NULL,
+ .destroy_handler = NULL,
+ .focus_in_handler = NULL,
+ .focus_out_handler = NULL,
+ .is_top = VCONFKEY_IDLE_SCREEN_TOP_FALSE,
+};
+
+
+
+int errno;
+
+
+
+static inline int _get_pid(Ecore_X_Window win)
+{
+ int pid;
+ Ecore_X_Atom atom;
+ unsigned char *in_pid = NULL;
+ int num;
+
+ atom = ecore_x_atom_get("X_CLIENT_PID");
+ if (ecore_x_window_prop_property_get(win, atom, ECORE_X_ATOM_CARDINAL,
+ sizeof(int), &in_pid, &num) == EINA_FALSE) {
+ if(in_pid != NULL) {
+ free(in_pid);
+ in_pid = NULL;
+ }
+ if (ecore_x_netwm_pid_get(win, &pid) == EINA_FALSE) {
+ _E("Failed to get PID from a window 0x%X", win);
+ return -EINVAL;
+ }
+ } else {
+ pid = *(int *)in_pid;
+ free(in_pid);
+ }
+
+ return pid;
+}
+
+
+
+bool _set_idlescreen_top(void)
+{
+ Ecore_X_Window win;
+
+ int is_top;
+ int ret;
+ int focused_pid;
+
+ win = ecore_x_window_focus_get();
+ focused_pid = _get_pid(win);
+ retv_if(focused_pid <= 0, false);
+
+ is_top = menu_daemon_is_homescreen(focused_pid)?
+ VCONFKEY_IDLE_SCREEN_TOP_TRUE : VCONFKEY_IDLE_SCREEN_TOP_FALSE;
+
+ if (is_top != xmonitor_info.is_top) {
+ ret = vconf_set_int(VCONFKEY_IDLE_SCREEN_TOP, is_top);
+ retv_if(0 != ret, false);
+ xmonitor_info.is_top = is_top;
+ _D("set the key of idlescreen_is_top as %d", is_top);
+ }
+
+ return true;
+}
+
+
+
+static Eina_Bool _create_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Create *info = event;
+
+ _D("Create a window[%x]", info->win);
+
+ ecore_x_window_client_sniff(info->win);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _destroy_cb(void *data, int type, void *event)
+{
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _focus_in_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Focus_In *info = event;
+
+ _D("Focus in a window[%x]", info->win);
+
+ retv_if(false == _set_idlescreen_top(), ECORE_CALLBACK_PASS_ON);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _focus_out_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Focus_Out *info = event;
+
+ _D("Focus out a window[%x]", info->win);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static inline void _sniff_all_windows(void)
+{
+ Ecore_X_Window root;
+ Ecore_X_Window ret;
+ struct stack_item *new_item;
+ struct stack_item *item;
+ Eina_List *win_stack = NULL;
+ struct stack_item {
+ Ecore_X_Window *wins;
+ int nr_of_wins;
+ int i;
+ };
+
+ root = ecore_x_window_root_first_get();
+ ecore_x_window_sniff(root);
+
+ new_item = malloc(sizeof(*new_item));
+ if (!new_item) {
+ _E("Error(%s)\n", strerror(errno));
+ return;
+ }
+
+ new_item->nr_of_wins = 0;
+ new_item->wins =
+ ecore_x_window_children_get(root, &new_item->nr_of_wins);
+ new_item->i = 0;
+
+ if (new_item->wins)
+ win_stack = eina_list_append(win_stack, new_item);
+ else
+ free(new_item);
+
+ while ((item = eina_list_nth(win_stack, 0))) {
+ win_stack = eina_list_remove(win_stack, item);
+
+ if (!item->wins) {
+ free(item);
+ continue;
+ }
+
+ while (item->i < item->nr_of_wins) {
+ ret = item->wins[item->i];
+
+ ecore_x_window_client_sniff(ret);
+
+ new_item = malloc(sizeof(*new_item));
+ if (!new_item) {
+ _E("Error %s\n", strerror(errno));
+ item->i++;
+ continue;
+ }
+
+ new_item->i = 0;
+ new_item->nr_of_wins = 0;
+ new_item->wins =
+ ecore_x_window_children_get(ret,
+ &new_item->nr_of_wins);
+ if (new_item->wins) {
+ win_stack =
+ eina_list_append(win_stack, new_item);
+ } else {
+ free(new_item);
+ }
+
+ item->i++;
+ }
+
+ free(item->wins);
+ free(item);
+ }
+
+ return;
+}
+
+
+
+int xmonitor_init(void)
+{
+ if (ecore_x_composite_query() == EINA_FALSE)
+ _D("====> COMPOSITOR IS NOT ENABLED");
+
+ xmonitor_info.create_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, _create_cb, NULL);
+ goto_if(NULL == xmonitor_info.create_handler, Error);
+
+ xmonitor_info.destroy_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _destroy_cb, NULL);
+ goto_if(NULL == xmonitor_info.destroy_handler, Error);
+
+ xmonitor_info.focus_in_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _focus_in_cb, NULL);
+ goto_if(NULL == xmonitor_info.focus_in_handler, Error);
+
+ xmonitor_info.focus_out_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _focus_out_cb, NULL);
+ goto_if(NULL == xmonitor_info.focus_out_handler, Error);
+
+ _sniff_all_windows();
+ if (false == _set_idlescreen_top()) _E("cannot set idlescreen_is_top");
+
+ return 0;
+
+Error:
+ if (xmonitor_info.create_handler) {
+ ecore_event_handler_del(xmonitor_info.create_handler);
+ xmonitor_info.create_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.destroy_handler) {
+ ecore_event_handler_del(xmonitor_info.destroy_handler);
+ xmonitor_info.destroy_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.focus_in_handler) {
+ ecore_event_handler_del(xmonitor_info.focus_in_handler);
+ xmonitor_info.focus_in_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.focus_out_handler) {
+ ecore_event_handler_del(xmonitor_info.focus_out_handler);
+ xmonitor_info.focus_out_handler = NULL;
+ } else return -EFAULT;
+
+ return -EFAULT;
+}
+
+void xmonitor_fini(void)
+{
+ ecore_event_handler_del(xmonitor_info.create_handler);
+ xmonitor_info.create_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.destroy_handler);
+ xmonitor_info.destroy_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.focus_in_handler);
+ xmonitor_info.focus_in_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.focus_out_handler);
+ xmonitor_info.focus_out_handler = NULL;
+}
diff --git a/mobile/starter.desktop.in b/mobile/starter.desktop.in
new file mode 100644
index 0000000..f2a89f3
--- /dev/null
+++ b/mobile/starter.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@PROJECT_NAME@
+Exec=@BINDIR@/@PROJECT_NAME@
+Icon=elementary
+Terminal=false
+Type=Application
+Categories=Application;Utility;
+
diff --git a/mobile/starter.manifest b/mobile/starter.manifest
new file mode 100644
index 0000000..c12fb88
--- /dev/null
+++ b/mobile/starter.manifest
@@ -0,0 +1,17 @@
+<manifest>
+ <define>
+ <domain name="starter"/>
+ </define>
+ <request>
+ <domain name="starter"/>
+ </request>
+ <assign>
+ <filesystem path="/usr/bin/starter" label="starter" exec_label="starter" />
+ <filesystem path="/usr/lib/systemd/user/starter.path" label="_" exec_label="none" />
+ <filesystem path="/usr/lib/systemd/user/starter.service" label="_" exec_label="none" />
+ <filesystem path="/usr/lib/systemd/user/starter.socket" label="_" exec_label="none" />
+ <filesystem path="/usr/lib/systemd/user/core-efl.target.wants/starter.path" label="_" exec_label="none" />
+ <filesystem path="/usr/lib/systemd/user/core-efl.target.wants/starter.service" label="_" exec_label="none" />
+ <filesystem path="/usr/lib/systemd/user/sockets.target.wants/starter.socket" label="_" exec_label="none" />
+ </assign>
+</manifest>
diff --git a/mobile/starter.rule b/mobile/starter.rule
new file mode 100644
index 0000000..5530241
--- /dev/null
+++ b/mobile/starter.rule
@@ -0,0 +1,10 @@
+starter mobileprint x
+starter svi-data rx
+starter tts-server x
+starter system::homedir rx
+starter system::use_internet r
+starter isf rx
+starter system::vconf rwx
+starter _ w
+starter org.tizen.clock rwx
+starter syspopup::db rw
diff --git a/mobile/systemd/starter.path b/mobile/systemd/starter.path
new file mode 100644
index 0000000..724239c
--- /dev/null
+++ b/mobile/systemd/starter.path
@@ -0,0 +1,5 @@
+[Unit]
+Description=Path activation for the "starter" programme
+
+[Path]
+PathExists=/tmp/amd_ready
diff --git a/mobile/systemd/starter.service b/mobile/systemd/starter.service
new file mode 100644
index 0000000..63d0e3f
--- /dev/null
+++ b/mobile/systemd/starter.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Start the "starter" program
+Before=core-efl.target
+After=boot-animation.service
+
+[Service]
+ExecStart=/usr/bin/starter
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=core-efl.target
diff --git a/mobile/systemd/starter.socket b/mobile/systemd/starter.socket
new file mode 100644
index 0000000..871d9d3
--- /dev/null
+++ b/mobile/systemd/starter.socket
@@ -0,0 +1,6 @@
+[Socket]
+ListenStream=/tmp/phlock
+SocketMode=0777
+
+[Install]
+WantedBy=sockets.target
diff --git a/mobile/test/get_entry.c b/mobile/test/get_entry.c
new file mode 100755
index 0000000..ea35358
--- /dev/null
+++ b/mobile/test/get_entry.c
@@ -0,0 +1,89 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+int main(int argc, char *argv[])
+{
+ unsigned char *prop_ret;
+ Atom type_ret;
+ unsigned long bytes_after, num_ret;
+ int format_ret;
+ unsigned int i;
+ int num;
+
+ Display *d;
+ Atom a_ac;
+ Atom a_ap;
+ Status r;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL) {
+ printf("Display open error\n");
+ return 1;
+ }
+
+ a_ac = XInternAtom(d, "ENLIGHTENMENT_AUTOCAPITAL_ALLOW", False);
+ if (a_ac == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetWindowProperty(d, DefaultRootWindow(d), a_ac, 0, 0x7fffffff,
+ False, XA_CARDINAL, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if (r != Success) {
+ printf("XGetWindowProperty error\n");
+ goto exit;
+ }
+
+ if (type_ret == XA_CARDINAL && format_ret == 32 && num_ret > 0
+ && prop_ret) {
+ printf("Auto capital: %lu\n", ((unsigned long *)prop_ret)[0]);
+ }
+ if (prop_ret)
+ XFree(prop_ret);
+
+ a_ap = XInternAtom(d, "ENLIGHTENMENT_AUTOPERIOD_ALLOW", False);
+ if (a_ap == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetWindowProperty(d, DefaultRootWindow(d), a_ap, 0, 0x7fffffff,
+ False, XA_CARDINAL, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if (r != Success) {
+ printf("XGetWindowProperty error\n");
+ goto exit;
+ }
+
+ if (type_ret == XA_CARDINAL && format_ret == 32 && num_ret > 0
+ && prop_ret) {
+ printf("Auto period: %lu\n", ((unsigned long *)prop_ret)[0]);
+ }
+ if (prop_ret)
+ XFree(prop_ret);
+
+ exit:
+ XCloseDisplay(d);
+ return 0;
+}
diff --git a/mobile/test/get_theme.c b/mobile/test/get_theme.c
new file mode 100755
index 0000000..2439ed5
--- /dev/null
+++ b/mobile/test/get_theme.c
@@ -0,0 +1,56 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+int main(int argc, char *argv[])
+{
+ XTextProperty xtp;
+ Display *d;
+ Atom a_e17;
+ Status r;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL) {
+ printf("Display open error\n");
+ return 1;
+ }
+
+ a_e17 = XInternAtom(d, "ENLIGHTENMENT_THEME", False);
+ if (a_e17 == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetTextProperty(d, DefaultRootWindow(d), &xtp, a_e17);
+ if (!r) {
+ printf("XGetTextProperty error\n");
+ goto exit;
+ }
+
+ printf("THEME: [%s]\n", (char *)xtp.value);
+
+ XFree(xtp.value);
+
+ exit:
+ XCloseDisplay(d);
+ return 0;
+}
diff --git a/mobile/test/set_theme.c b/mobile/test/set_theme.c
new file mode 100755
index 0000000..a6cf4eb
--- /dev/null
+++ b/mobile/test/set_theme.c
@@ -0,0 +1,62 @@
+ /*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <string.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+void set_elm_theme(void)
+{
+ char *theme;
+ Display *d;
+ Atom a_e17;
+ Atom a_UTF8;
+ XTextProperty xtp;
+
+ theme = "beat:kessler";
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_e17 = XInternAtom(d, "ENLIGHTENMENT_THEME", False);
+ if (a_e17 == None)
+ goto exit;
+
+ a_UTF8 = XInternAtom(d, "UTF8_STRING", False);
+ if (a_UTF8 == None)
+ goto exit;
+
+ xtp.value = (unsigned char *)theme;
+ xtp.format = 8;
+ xtp.encoding = a_UTF8;
+ xtp.nitems = strlen(theme);
+
+ XSetTextProperty(d, DefaultRootWindow(d), &xtp, a_e17);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+int main(int argc, char *argv[])
+{
+ set_elm_theme();
+ return 0;
+}
diff --git a/packaging/starter.service b/packaging/starter.service
new file mode 100644
index 0000000..f6479ba
--- /dev/null
+++ b/packaging/starter.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Start the "starter" program
+After=ac.service system-server.service launchpad-preload.service wm_ready.service
+
+[Service]
+Type=forking
+ExecStart=/etc/init.d/rd3starter
+Restart=on-failure
+RestartSec=0
+KillSignal=SIGKILL
+
+[Install]
+WantedBy=tizen-system.target
diff --git a/packaging/starter.spec b/packaging/starter.spec
new file mode 100755
index 0000000..5dd1dd1
--- /dev/null
+++ b/packaging/starter.spec
@@ -0,0 +1,185 @@
+#sbs-git:slp/pkgs/s/starter starter 0.3 f75832f2c50c8930cf1a6bfcffbac648bcde87d9
+Name: starter
+Summary: starter
+Version: 0.6.7
+Release: 1
+Group: TO_BE/FILLED_IN
+License: TO_BE/FILLED_IN
+Source0: starter-%{version}.tar.gz
+Source1: starter.service
+BuildRequires: cmake
+BuildRequires: pkgconfig(ail)
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-media-key)
+BuildRequires: pkgconfig(db-util)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(edbus)
+BuildRequires: pkgconfig(eet)
+BuildRequires: pkgconfig(eina)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xcomposite)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(feedback)
+BuildRequires: pkgconfig(syspopup-caller)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(deviced)
+%if "%{_repository}" == "mobile"
+BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(sysman)
+BuildRequires: pkgconfig(tapi)
+BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(libsystemd-daemon)
+%endif
+BuildRequires: cmake
+BuildRequires: edje-bin
+BuildRequires: gettext-tools
+Requires(post): /usr/bin/vconftool
+Requires: sys-assert
+
+
+%description
+Description: Starter
+
+
+%prep
+%setup -q
+
+%build
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+%endif
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+
+%if "%{_repository}" == "wearable"
+export BUILD_PATH="."
+export MOBILE=Off
+export WEARABLE=On
+%if ("%{sec_build_project_name}" == "tizenw2_master")
+ export FEATURE_TIZENW2="YES"
+%endif
+%elseif "%{_repository}" == "mobile"
+export BUILD_PATH="mobile"
+export MOBILE=On
+export WEARABLE=Off
+%endif
+
+%cmake ${BUILD_PATH} -DARCH=%{ARCH} -DFEATURE_TIZENW2=${FEATURE_TIZENW2} -DMOBILE=${MOBILE} -DWEARABLE=${WEARABLE}
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%if "%{_repository}" == "wearable"
+mkdir -p %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants
+install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/starter.service
+ln -s ../starter.service %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants/starter.service
+mkdir -p %{buildroot}/usr/share/license
+cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}/opt/data/home-daemon
+%else
+mkdir -p %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants
+mkdir -p %{buildroot}%{_libdir}/systemd/user/sockets.target.wants
+ln -s ../starter.path %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants/starter.path
+ln -s ../starter.service %{buildroot}%{_libdir}/systemd/user/core-efl.target.wants/starter.service
+ln -s ../starter.socket %{buildroot}%{_libdir}/systemd/user/sockets.target.wants/starter.socket
+mkdir -p %{buildroot}/usr/share/license
+mkdir -p %{buildroot}/opt/data/home-daemon
+%endif
+
+%post
+change_file_executable()
+{
+ chmod +x $@ 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed to change the perms of $@"
+ fi
+}
+
+GOPTION="-u 5000 -f"
+%if "%{_repository}" == "wearable"
+SOPTION="-s system::vconf_inhouse"
+POPTION="-s starter_private::vconf"
+LOPTION="-s starter::vconf"
+
+vconftool set -t string file/private/lockscreen/pkgname "com.samsung.lockscreen" $GOPTION $POPTION
+vconftool set -t string file/private/lockscreen/default_pkgname "com.samsung.lockscreen" $GOPTION $POPTION
+
+vconftool set -t int memory/idle_lock/state "0" -i $GOPTION $LOPTION
+vconftool set -t bool memory/lockscreen/phone_lock_verification 0 -i $GOPTION $SOPTION
+
+vconftool set -t int memory/idle-screen/safemode "0" -i -f $SOPTION
+
+vconftool set -t int "memory/starter/sequence" 0 -i $GOPTION $SOPTION
+vconftool set -t int "memory/starter/use_volume_key" 0 -i $GOPTION $SOPTION
+vconftool set -t int db/starter/missed_call "0" -i -u 5000 -f $SOPTION
+vconftool set -t int db/starter/unread_message "0" -i -u 5000 -f $SOPTION
+
+vconftool set -t string db/svoice/package_name "com.samsung.svoice" -i -u 5000 -f -s svoice::vconf
+
+vconftool set -t string memory/idle-screen/focused_package "" -i $GOPTION $POPTION
+vconftool set -t int memory/idle-screen/is_idle_screen_launched 0 -i $GOPTION $POPTION
+%else
+vconftool set -t int "memory/starter/sequence" 0 -i $GOPTION
+vconftool set -t int "memory/starter/use_volume_key" 0 -i $GOPTION
+vconftool set -t string file/private/lockscreen/pkgname "org.tizen.lockscreen" -u 5000 -g 5000 -f
+vconftool set -t int memory/idle_lock/state "0" -i $GOPTION
+vconftool set -t bool memory/lockscreen/phone_lock_verification 0 -i $GOPTION
+
+vconftool set -t bool db/lockscreen/event_notification_display 1 $GOPTION
+vconftool set -t bool db/lockscreen/clock_display 1 $GOPTION
+vconftool set -t bool db/lockscreen/help_text_display 0 $GOPTION
+
+vconftool set -t int memory/idle-screen/is_idle_screen_launched "0" -i -u 5000 -f
+vconftool set -t int memory/idle-screen/top "0" -i -f
+vconftool set -t int memory/idle-screen/safemode "0" -i -f
+%endif
+
+#ln -sf /etc/init.d/rd4starter /etc/rc.d/rc4.d/S81starter
+#ln -sf /etc/init.d/rd4starter /etc/rc.d/rc3.d/S81starter
+
+%files
+%manifest starter.manifest
+%defattr(-,root,root,-)
+
+%if "%{_repository}" == "wearable"
+%{_sysconfdir}/init.d/rd4starter
+%{_sysconfdir}/init.d/rd3starter
+%{_bindir}/starter
+%{_libdir}/systemd/system/starter.service
+%{_libdir}/systemd/system/tizen-system.target.wants/starter.service
+/usr/share/license/%{name}
+/opt/data/home-daemon
+%else
+%{_bindir}/starter
+/usr/ug/lib/libug-lockscreen-options.so
+/usr/ug/lib/libug-lockscreen-options.so.0.1.0
+/usr/ug/res/locale/*/LC_MESSAGES/*
+%{_libdir}/systemd/user/starter.path
+%{_libdir}/systemd/user/starter.service
+%{_libdir}/systemd/user/starter.socket
+%{_libdir}/systemd/user/core-efl.target.wants/starter.path
+%{_libdir}/systemd/user/core-efl.target.wants/starter.service
+%{_libdir}/systemd/user/sockets.target.wants/starter.socket
+/usr/share/license/%{name}
+/opt/data/home-daemon
+/opt/etc/smack/accesses.d/starter.rule
+%endif
diff --git a/rd3starter b/rd3starter
new file mode 100644
index 0000000..f5caea4
--- /dev/null
+++ b/rd3starter
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# commented and this was moved to isf-panel-efl code
+#while [ ! -f /tmp/.wm_ready ];
+#do
+# sleep 0.1
+#done
+
+while [ ! -f /tmp/amd_ready ];
+do
+ sleep 0.1
+done
+
+vconf_set_safemode()
+{
+ if [ -f /opt/etc/.safeboot ]
+ then
+ vconftool set -t int memory/idle-screen/safemode "1" -i -f -s system::vconf_inhouse
+ else
+ vconftool set -t int memory/idle-screen/safemode "0" -i -f -s system::vconf_inhouse
+ fi
+}
+vconf_set_safemode
+
+echo -e "<2>[${_G}menu-daemon start${C_}]" > /dev/kmsg
+/usr/bin/starter &
+
diff --git a/rd4starter b/rd4starter
new file mode 100644
index 0000000..d937805
--- /dev/null
+++ b/rd4starter
@@ -0,0 +1,14 @@
+#!/bin/sh
+vconf_set_safemode()
+{
+ if [ -f /opt/etc/.safeboot ]
+ then
+ vconftool set -t int memory/idle-screen/safemode "1" -i -f -s system::vconf_inhouse
+ else
+ vconftool set -t int memory/idle-screen/safemode "0" -i -f -s system::vconf_inhouse
+ fi
+}
+vconf_set_safemode
+
+echo -e "<2>[${_G}menu-daemon start${C_}]" > /dev/kmsg
+/usr/bin/starter &
diff --git a/src/hourly_alert.c b/src/hourly_alert.c
new file mode 100644
index 0000000..e2dea21
--- /dev/null
+++ b/src/hourly_alert.c
@@ -0,0 +1,278 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Elementary.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <poll.h>
+#include <errno.h>
+#include <string.h>
+
+#include <vconf.h>
+#include <signal.h>
+#include <app.h>
+#include <alarm.h>
+#include <feedback.h>
+
+#include "starter.h"
+#include "starter-util.h"
+#include "lockd-debug.h"
+
+#include "util.h"
+
+static int __alarm_delete_cb(alarm_id_t id, void * user_param)
+{
+ int ret = ALARMMGR_RESULT_SUCCESS;
+
+ ret = alarmmgr_remove_alarm(id);
+ if(ret != ALARMMGR_RESULT_SUCCESS) {
+ _ERR("alarmmgr_enum_alarm_ids() failed");
+ }
+
+ return 0;
+}
+
+static void _alarm_unset(void *data)
+{
+ int ret = ALARMMGR_RESULT_SUCCESS;
+
+ struct appdata *ad = data;
+ ret_if(ad == NULL);
+
+ if(ad->alarm_id != -1){
+ _DBG("try to delete alarm_id(%d)", ad->alarm_id);
+ ret = alarmmgr_remove_alarm(ad->alarm_id);
+ if(ret != ALARMMGR_RESULT_SUCCESS) {
+ ret = alarmmgr_enum_alarm_ids(__alarm_delete_cb, NULL);
+ if(ret != ALARMMGR_RESULT_SUCCESS) {
+ _ERR("alarmmgr_enum_alarm_ids() failed");
+ }
+ }
+ ad->alarm_id = -1;
+ }
+}
+
+static int _alarm_set(void *data)
+{
+ int ret = ALARMMGR_RESULT_SUCCESS;
+ time_t current_time;
+ struct tm current_tm;
+ alarm_entry_t *alarm_info = NULL;
+ alarm_id_t alarm_id;
+ alarm_date_t alarm_time;
+ struct appdata *ad = data;
+ retv_if(ad == NULL, -1);
+
+ /* delete before registering alarm ids */
+ _alarm_unset(ad);
+
+ time(&current_time);
+
+ /* alarm revision */
+ current_time += 3600; // +1 hour
+
+ localtime_r(&current_time, &current_tm);
+
+ alarm_info = alarmmgr_create_alarm();
+ if(alarm_info == NULL) {
+ _ERR("alarmmgr_create_alarm() is failed\n");
+ return -1;
+ }
+
+ alarm_time.year = current_tm.tm_year;
+ alarm_time.month = current_tm.tm_mon;
+ alarm_time.day = current_tm.tm_mday;
+ alarm_time.hour = current_tm.tm_hour;
+ alarm_time.min = 0;
+ alarm_time.sec = 0;
+
+ //alarmmgr_set_repeat_mode(alarm_info, ALARM_REPEAT_MODE_ONCE, 0);
+ ret = alarmmgr_set_repeat_mode(alarm_info, ALARM_REPEAT_MODE_REPEAT, 60*60);
+ if(ret != ALARMMGR_RESULT_SUCCESS) {
+ _ERR("alarmmgr_set_repeat_mode() failed");
+ alarmmgr_free_alarm(alarm_info) ;
+ return -1;
+ }
+ alarmmgr_set_time(alarm_info, alarm_time);
+ alarmmgr_set_type(alarm_info, ALARM_TYPE_VOLATILE);
+
+ ret = alarmmgr_add_alarm_with_localtime(alarm_info, NULL, &alarm_id);
+ if(ret != ALARMMGR_RESULT_SUCCESS) {
+ _ERR("alarmmgr_add_alarm_with_localtime() failed");
+ alarmmgr_free_alarm(alarm_info) ;
+ return -1;
+ }
+
+ ad->alarm_id = alarm_id;
+ alarmmgr_free_alarm(alarm_info);
+
+ return 0;
+}
+
+static int __alarm_cb(alarm_id_t alarm_id, void *data)
+{
+ _DBG("hourly_alert alarm callback called");
+
+ feedback_initialize();
+ feedback_play(FEEDBACK_PATTERN_HOURLY_ALERT);
+ feedback_deinitialize();
+
+ return 0;
+}
+
+static int _alarm_init(void *data)
+{
+ int ret = 0;
+
+ struct appdata *ad = data;
+ retv_if(ad == NULL, -1);
+
+ g_type_init();
+ ret = alarmmgr_init("starter");
+ retv_if(ret<0, -1);
+
+ ret = alarmmgr_set_cb(__alarm_cb, data);
+ retv_if(ret<0, -1);
+
+ ad->alarm_id = -1;
+
+ return 0;
+}
+
+static void _alarm_fini(void *data)
+{
+ _alarm_unset(data);
+ alarmmgr_fini();
+}
+
+static Eina_Bool _register_hourly_alert_alarm(struct appdata *ad)
+{
+ int ret = 0;
+
+ if(!ad) {
+ _ERR("parameter is NULL");
+ return EINA_FALSE;
+ }
+
+ //alarmmgr_fini();
+
+ ret = _alarm_init(ad);
+ if(ret<0) {
+ _ERR("_alarm_init() failed");
+ return EINA_FALSE;
+ }
+
+ _alarm_set(ad);
+
+ return EINA_TRUE;
+
+}
+
+static int _unregister_hourly_alert_alarm(struct appdata *ad)
+{
+ _alarm_fini(ad);
+
+ return 0;
+}
+
+
+static void _hourly_alert_changed_cb(keynode_t* node, void *data)
+{
+ int hourly_alert = -1;
+ struct appdata *ad = (struct appdata *)data;
+
+ _DBG("%s, %d", __func__, __LINE__);
+
+ if (node) {
+ hourly_alert = vconf_keynode_get_bool(node);
+ } else {
+ if (vconf_get_int(VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, &hourly_alert) < 0) {
+ _ERR("Failed to get %s", VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL);
+ return;
+ }
+ }
+
+ if (hourly_alert == TRUE) {
+ _ERR("hourly_alert is set");
+ _register_hourly_alert_alarm(ad);
+ } else {
+ _ERR("hourly_alert is unset");
+ _unregister_hourly_alert_alarm(ad);
+ }
+
+}
+
+static void _hourly_system_time_changed_cb(keynode_t *node, void *data)
+{
+ struct appdata *ad = data;
+ ret_if(ad == NULL);
+
+ _DBG("%s, %d", __func__, __LINE__);
+
+ /* unset existing alarms and set new alarm */
+ _alarm_set(ad);
+}
+
+void init_hourly_alert(void *data)
+{
+ struct appdata *ad = (struct appdata *)data;
+ int hourly_alert = -1;
+ int ret = 0;
+
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, &hourly_alert);
+ if (ret < 0){
+ _ERR("can't get vconfkey value of [%s], ret=[%d]", VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, ret);
+ hourly_alert = FALSE;
+ } else if (hourly_alert == TRUE) {
+ _DBG("[%s] value is [%d], hourly_alert is set..!!", VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, hourly_alert);
+ if (_register_hourly_alert_alarm(ad) == EINA_FALSE) {
+ _ERR("_register_hourly_alert_alarm is failed..!!");
+ }
+ }
+
+ if (vconf_notify_key_changed(VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, _hourly_alert_changed_cb, ad) < 0) {
+ _ERR("Failed to add the callback for %s changed", VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL);
+ }
+ /* for time revision */
+ if (vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, _hourly_system_time_changed_cb, ad) < 0) {
+ _ERR("Failed to add the callback for %s changed", VCONFKEY_SYSTEM_TIME_CHANGED);
+ }
+}
+
+void fini_hourly_alert(void *data)
+{
+ int ret = 0;
+ struct appdata *ad = data;
+ ret_if(ad == NULL);
+
+ //_unregister_hourly_alert_alarm(data);
+
+ ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_HOURLY_ALERT_BOOL, _hourly_alert_changed_cb);
+ if(ret != 0) {
+ _E("vconf_ignore failed");
+ }
+}
+
diff --git a/src/hw_key.c b/src/hw_key.c
new file mode 100644
index 0000000..9307e5e
--- /dev/null
+++ b/src/hw_key.c
@@ -0,0 +1,1145 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <ail.h>
+#include <bundle.h>
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <Ecore_Input.h>
+#include <utilX.h>
+#include <vconf.h>
+
+#include <syspopup_caller.h>
+#include <dd-display.h>
+#include <E_DBus.h>
+#include <feedback.h>
+#include <pkgmgr-info.h>
+#include <system/media_key.h>
+
+#include "starter.h"
+#include "hw_key.h"
+#include "util.h"
+
+#define GRAB_TWO_FINGERS 2
+#define POWERKEY_TIMER_SEC 0.25
+#define POWERKEY_LCDOFF_TIMER_SEC 0.4
+#define LONG_PRESS_TIMER_SEC 0.7
+#define SYSPOPUP_END_TIMER_SEC 0.5
+
+#define SERVICE_OPERATION_MAIN_KEY "__APP_SVC_OP_TYPE__"
+#define SERVICE_OPERATION_MAIN_VALUE "http://tizen.org/appcontrol/operation/main"
+#define SERVICE_OPERATION_DEFAULT_VALUE "http://tizen.org/appcontrol/operation/default"
+#define HOME_OPERATION_KEY "home_op"
+#define POWERKEY_VALUE "powerkey"
+
+#define USE_DBUS_POWEROFF 1
+
+#define POWEROFF_BUS_NAME "org.tizen.system.popup"
+#define POWEROFF_OBJECT_PATH "/Org/Tizen/System/Popup/Poweroff"
+#define POWEROFF_INTERFACE_NAME POWEROFF_BUS_NAME".Poweroff"
+#define METHOD_POWEROFF_NAME "PopupLaunch"
+#define DBUS_REPLY_TIMEOUT (120 * 1000)
+
+#define DOUBLE_PRESS_NONE "none"
+#define DOUBLE_PRESS_RECENT_APPS "recent"
+#define W_TASKMGR_PKGNAME "org.tizen.w-taskmanager"
+#define W_CONTROLS_PKGNAME "org.tizen.windicator"
+
+#define MUSIC_PLAYER_PKG_NAME "org.tizen.w-music-player"
+
+static struct {
+ Ecore_X_Window win;
+ Ecore_Event_Handler *key_up;
+ Ecore_Event_Handler *key_down;
+ Ecore_Event_Handler *two_fingers_hold_hd;
+ Ecore_Timer *long_press_timer;
+ Ecore_Timer *powerkey_timer;
+ Eina_Bool is_lcd_on;
+ Eina_Bool is_long_press;
+ int powerkey_count;
+ Eina_Bool is_cancel;
+} key_info = {
+ .win = 0x0,
+ .key_up = NULL,
+ .key_down = NULL,
+ .two_fingers_hold_hd = NULL,
+ .long_press_timer = NULL,
+ .powerkey_timer = NULL,
+ .is_lcd_on = EINA_FALSE,
+ .is_long_press = EINA_FALSE,
+ .powerkey_count = 0,
+ .is_cancel = EINA_FALSE,
+};
+
+#if 0 // This is not W code
+/* NOTE: THIS FUNCTION Is ONLY USED FOR CONFIDENTIAL FEATURE. REMOVE ME */
+static inline int _launch_running_apps_FOR_TEMPORARY(void)
+{
+ bundle *kb = NULL;
+ char *package;
+ int ret;
+
+ package = menu_daemon_get_selected_pkgname();
+ if (!package)
+ return -ENOENT;
+
+ if (!strcmp(package, MENU_SCREEN_PKG_NAME)) {
+ free(package);
+ return -EINVAL;
+ }
+
+ free(package);
+
+ kb = bundle_create();
+ if (!kb) {
+ _E("Failed to create a bundle");
+ return -EFAULT;
+ }
+
+ bundle_add(kb, "LONG_PRESS", "1");
+ ret = menu_daemon_launch_app(APP_TRAY_PKG_NAME, kb);
+ bundle_free(kb);
+
+ if (ret < 0) {
+ _E("Failed to launch the running apps, ret : %d", ret);
+ return -EFAULT;
+ } else if (ret > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(ret, OOM_IGNORE)) {
+ _E("Cannot set the memory policy for App tray(%d)", ret);
+ } else {
+ _E("Set the memory policy for App tray(%d)", ret);
+ }
+ }
+
+ return 0;
+}
+
+
+
+#define DESKDOCK_PKG_NAME "org.tizen.desk-dock"
+static Eina_Bool _launch_by_home_key(void *data)
+{
+ int lock_state = (int) data;
+ _D("lock_state : %d ", lock_state);
+
+ key_info.single_timer = NULL;
+
+ if (lock_state == VCONFKEY_IDLE_LOCK) {
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ int cradle_status = menu_daemon_get_cradle_status();
+ if (0 < cradle_status) {
+ int ret;
+ _SECURE_D("Cradle is enabled to [%d], we'll launch the desk dock[%s]", cradle_status, DESKDOCK_PKG_NAME);
+ ret = menu_daemon_open_app(DESKDOCK_PKG_NAME);
+ if (ret < 0) {
+ _SECURE_E("cannot launch package %s(err:%d)", DESKDOCK_PKG_NAME, ret);
+ }
+ }
+
+ menu_daemon_open_homescreen(NULL);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+inline static Eina_Bool _launch_svoice(void)
+{
+ const char *pkg_name = NULL;
+ bundle *b;
+
+ pkg_name = menu_daemon_get_svoice_pkg_name();
+ retv_if(NULL == pkg_name, EINA_FALSE);
+
+ if (!strcmp(pkg_name, SVOICE_PKG_NAME)) {
+ int val = -1;
+
+ if (vconf_get_int(VCONFKEY_SVOICE_OPEN_VIA_HOME_KEY, &val) < 0) {
+ _D("Cannot get VCONFKEY");
+ }
+
+ if (val != 1) {
+ _D("Launch nothing");
+ return EINA_FALSE;
+ }
+ }
+
+ b = bundle_create();
+ retv_if(!b, EINA_FALSE);
+
+ bundle_add(b, SVOICE_LAUNCH_BUNDLE_KEY, SVOICE_LAUNCH_BUNDLE_HOMEKEY_VALUE);
+ if (menu_daemon_launch_app(pkg_name, b) < 0)
+ _SECURE_E("Failed to launch %s", pkg_name);
+ bundle_free(b);
+
+ return EINA_TRUE;
+}
+
+
+
+static void _launch_safety_assurance(void)
+{
+ _SECURE_D("Launch %s", SAFETY_ASSURANCE_PKG_NAME);
+ if (menu_daemon_open_app(SAFETY_ASSURANCE_PKG_NAME) < 0) {
+ _SECURE_E("Cannot open %s", SAFETY_ASSURANCE_PKG_NAME);
+ }
+}
+
+
+static Eina_Bool _launch_svoice_cb(void* data)
+{
+ key_info.media_long_press = NULL;
+
+ int val = -1;
+ if (vconf_get_int(VCONFKEY_SVOICE_OPEN_VIA_EARPHONE_KEY, &val) < 0) {
+ _D("Cannot get VCONFKEY");
+ }
+ if (1 == val) {
+ _D("Launch SVOICE");
+
+ bundle *b;
+ b = bundle_create();
+ retv_if(!b, ECORE_CALLBACK_CANCEL);
+
+ bundle_add(b, SVOICE_LAUNCH_BUNDLE_KEY, SVOICE_LAUNCH_BUNDLE_VALUE);
+ if (menu_daemon_launch_app(SVOICE_PKG_NAME, b) < 0)
+ _SECURE_E("Failed to launch %s", TASKMGR_PKG_NAME);
+ bundle_free(b);
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+static Eina_Bool _client_msg_timer_cb(void* data)
+{
+ _D("_client_msg_timer_cb, safety assurance is enable");
+
+ key_info.enable_safety_assurance = EINA_TRUE;
+ _D("Launch SafetyAssurance");
+ _launch_safety_assurance();
+ key_info.client_msg_timer = NULL;
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+static Eina_Bool _set_unlock(void *data)
+{
+ _D("_set_unlock");
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+inline static int _release_home_key(int lock_state)
+{
+ retv_if(NULL == key_info.long_press, EXIT_SUCCESS);
+ ecore_timer_del(key_info.long_press);
+ key_info.long_press = NULL;
+
+ if (NULL == key_info.single_timer) {
+ key_info.single_timer = ecore_timer_add(0.3, _launch_by_home_key, (void *) lock_state);
+ return EXIT_SUCCESS;
+ }
+ ecore_timer_del(key_info.single_timer);
+ key_info.single_timer = NULL;
+
+ if(EINA_TRUE == _launch_svoice()) {
+ if (lock_state == VCONFKEY_IDLE_LOCK) {
+ ecore_timer_add(0.8, _set_unlock, NULL);
+ }
+ }
+ return EXIT_SUCCESS;
+}
+
+
+
+inline static void _release_multimedia_key(const char *value)
+{
+ ret_if(NULL == value);
+
+ _D("Multimedia key is released with %s", value);
+
+ bundle *b;
+ b = bundle_create();
+ if (!b) {
+ _E("Cannot create bundle");
+ return;
+ }
+ bundle_add(b, "multimedia_key", value);
+
+ int ret;
+ ret = menu_daemon_launch_app(MUSIC_PLAYER_PKG_NAME, b);
+ if (ret < 0)
+ _E("Failed to launch the running apps, ret : %d", ret);
+
+ bundle_free(b);
+}
+
+
+static Eina_Bool _client_message_cb(void *data, int type, void *event)
+{
+ int key_sum;
+ int press;
+ Ecore_X_Event_Client_Message *ev = event;
+ Ecore_X_Atom safety_assurance_atom;
+
+ if (ev->format != 32)
+ return ECORE_CALLBACK_RENEW;
+
+ safety_assurance_atom = ecore_x_atom_get(ATOM_KEY_COMPOSITION);
+ if (ev->message_type == safety_assurance_atom) {
+ press = ev->data.l[2];
+ key_sum = ev->data.l[0]+ev->data.l[1];
+ if (key_sum == 245) {
+ _D("check key_sum[%d] to 122(volume_down)+123(volume_up), press=[%d]", key_sum, press);
+ if (press) {
+ if (key_info.client_msg_timer) {
+ ecore_timer_del(key_info.client_msg_timer);
+ key_info.client_msg_timer = NULL;
+ }
+ key_info.enable_safety_assurance = EINA_FALSE;
+ key_info.client_msg_timer = ecore_timer_add(3, _client_msg_timer_cb, NULL);
+ if (!key_info.client_msg_timer)
+ _E("Failed to add timer for clent message");
+ } else {
+ if (key_info.client_msg_timer) {
+ ecore_timer_del(key_info.client_msg_timer);
+ key_info.client_msg_timer = NULL;
+ }
+#if 0
+ if (key_info.enable_safety_assurance == EINA_TRUE) {
+ _D("Launch SafetyAssurance");
+ _launch_safety_assurance();
+ }
+ key_info.enable_safety_assurance = EINA_FALSE;
+#endif
+ }
+ }
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
+#endif // This is not W code
+
+
+
+static int _append_variant(DBusMessageIter *iter, const char *sig, char *param[])
+{
+ char *ch;
+ int i;
+ int int_type;
+ uint64_t int64_type;
+
+ if (!sig || !param)
+ return 0;
+
+ for (ch = (char*)sig, i = 0; *ch != '\0'; ++i, ++ch) {
+ switch (*ch) {
+ case 'i':
+ int_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &int_type);
+ break;
+ case 'u':
+ int_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &int_type);
+ break;
+ case 't':
+ int64_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64, &int64_type);
+ break;
+ case 's':
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &param[i]);
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+
+ return 0;
+}
+
+
+DBusMessage *_invoke_dbus_method_sync(const char *dest, const char *path,
+ const char *interface, const char *method,
+ const char *sig, char *param[])
+{
+ DBusConnection *conn;
+ DBusMessage *msg;
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ DBusError err;
+ int r;
+
+ conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+ if (!conn) {
+ _E("dbus_bus_get error");
+ return NULL;
+ }
+
+ msg = dbus_message_new_method_call(dest, path, interface, method);
+ if (!msg) {
+ _E("dbus_message_new_method_call(%s:%s-%s)", path, interface, method);
+ return NULL;
+ }
+
+ dbus_message_iter_init_append(msg, &iter);
+ r = _append_variant(&iter, sig, param);
+ if (r < 0) {
+ _E("append_variant error(%d)", r);
+ return NULL;
+ }
+
+#if 0 //Temp block sync call from power off popup.
+ dbus_error_init(&err);
+
+ reply = dbus_connection_send_with_reply_and_block(conn, msg, DBUS_REPLY_TIMEOUT, &err);
+
+ if (!reply) {
+ _E("dbus_connection_send error(No reply)");
+ }
+
+ if (dbus_error_is_set(&err)) {
+ _E("dbus_connection_send error(%s:%s)", err.name, err.message);
+ reply = NULL;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+
+ return reply;
+#else //Temp async call
+ r = dbus_connection_send(conn, msg, NULL);
+ dbus_message_unref(msg);
+ if (r != TRUE) {
+ _E("dbus_connection_send error(%s:%s:%s-%s)", dest, path, interface, method);
+ return -ECOMM;
+ }
+ _D("dbus_connection_send, ret=%d", r);
+ return NULL;
+#endif
+}
+
+
+static int _request_Poweroff(void)
+{
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
+
+ msg = _invoke_dbus_method_sync(POWEROFF_BUS_NAME, POWEROFF_OBJECT_PATH, POWEROFF_INTERFACE_NAME,
+ METHOD_POWEROFF_NAME, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
+
+ dbus_error_init(&err);
+
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+
+ _D("%s-%s : %d", POWEROFF_INTERFACE_NAME, METHOD_POWEROFF_NAME, ret_val);
+ return ret_val;
+}
+
+char *_get_app_type(const char *pkgname)
+{
+ int ret = 0;
+ char *apptype = NULL;
+ char *re_apptype = NULL;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgname, &handle);
+ if (ret != PMINFO_R_OK)
+ return NULL;
+ ret = pkgmgrinfo_pkginfo_get_type(handle, &apptype);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return NULL;
+ }
+
+ /*after call pkgmgrinfo_appinfo_destroy_appinfo, mainappid is destroyed with handle, so must copy it*/
+ re_apptype = strdup(apptype);
+ _SECURE_D("apptype : %s - %s", apptype, re_apptype);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return re_apptype;
+}
+
+#define W_LAUNCHER_PKGNAME "org.tizen.w-launcher-app"
+static Eina_Bool _launch_home_by_powerkey(void)
+{
+ bundle *b = NULL;
+ int pid = 0;
+
+ _D("%s", __func__);
+
+ b = bundle_create();
+ if(!b) {
+ _E("Failed to create bundle");
+ return EINA_FALSE;
+ }
+ bundle_add(b, HOME_OPERATION_KEY, POWERKEY_VALUE);
+
+ pid = w_launch_app(W_LAUNCHER_PKGNAME, b);
+ _SECURE_D("launch[%s], pid[%d]", W_LAUNCHER_PKGNAME, pid);
+
+ if(pid < AUL_R_OK) {
+ if(b) {
+ bundle_free(b);
+ }
+ return EINA_FALSE;
+ }
+
+ if(b) {
+ bundle_free(b);
+ }
+ return EINA_TRUE;
+}
+
+
+static Eina_Bool _syspopup_end_timer_cb(void *data)
+{
+ /* terminate syspopup */
+ syspopup_destroy_all();
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+#define APP_TYPE_WIDGET "wgt"
+#define W_CAMERA_PKGNAME "org.tizen.w-camera-app"
+static Eina_Bool _launch_app_by_double_press(void)
+{
+ char *appid = NULL;
+ char *pkgname = NULL;
+ char *pkgtype = NULL;
+ bundle *b = NULL;
+ int pid = 0;
+ int ret = 0;
+ int ret_aul = 0;
+
+ _D("%s", __func__);
+
+
+ appid = vconf_get_str(VCONFKEY_WMS_POWERKEY_DOUBLE_PRESSING);
+
+ if (appid == NULL) {
+ _E("appid is NULL");
+ } else if (!strcmp(appid, DOUBLE_PRESS_NONE)) {
+ _D("none : DOUBLE_PRESS_NONE !!");
+ return EINA_TRUE;
+ } else if (!strcmp(appid, DOUBLE_PRESS_RECENT_APPS)) {
+ _D("recent : launch task mgr..!!");
+ ret = w_launch_app(W_TASKMGR_PKGNAME, NULL);
+ if (ret >= 0) {
+ _SECURE_D("[%s] is launched, pid=[%d]", W_TASKMGR_PKGNAME, ret);
+ }
+ return EINA_TRUE;
+ } else {
+ char *last;
+ char *temp;
+ char *new_appid;
+ last = strrchr(appid, '/');
+ if (last == NULL || *(last + 1) == NULL) {
+ _E("Invaild data");
+ } else {
+ _D("appid has class name");
+ new_appid = strdup(last + 1);
+ if(new_appid == NULL) {
+ _E("appid is NULL");
+ }
+ temp = strtok(appid, "/");
+ if(temp == NULL){
+ _E("Invalid data");
+ }
+ else{
+ pkgname = strdup(temp);
+ }
+ }
+ free(appid);
+ appid = new_appid;
+ }
+
+ if(appid == NULL) {
+ _E("appid is NULL. set default to none.");
+ return EINA_FALSE;
+ }
+
+ pkgtype = _get_app_type(pkgname);
+ if(pkgtype == NULL && appid != NULL) {
+ _E("Failed to get app_type. app_type is NULL");
+ if(appid){
+ free(appid);
+ }
+ if(pkgname){
+ free(pkgname);
+ }
+ return EINA_FALSE;
+ }
+
+ _SECURE_D("appid : %s, pkgname : %s, pkgtype : %s", appid, pkgname, pkgtype);
+
+ if(!strcmp(pkgtype, APP_TYPE_WIDGET)){
+ ret_aul = aul_open_app(appid);
+ if(ret_aul < AUL_R_OK) {
+ _D("Launching app ret : [%d]", ret_aul);
+ free(appid);
+ free(pkgname);
+ free(pkgtype);
+ return EINA_FALSE;
+ }
+ if(appid) {
+ free(appid);
+ }
+ }
+ else{
+
+ b = bundle_create();
+ if(!b) {
+ _E("Failed to create bundle");
+ if(appid) {
+ free(appid);
+ }
+ return EINA_FALSE;
+ }
+ bundle_add(b, SERVICE_OPERATION_MAIN_KEY, SERVICE_OPERATION_MAIN_VALUE);
+
+ pid = w_launch_app(appid, b);
+ _SECURE_D("launch[%s], pid[%d]", appid, pid);
+
+ if(pid < AUL_R_OK) {
+ if(b) {
+ bundle_free(b);
+ }
+ if(appid) {
+ free(appid);
+ }
+ return EINA_FALSE;
+ }
+
+#if 0
+ if (strcmp(appid, W_CONTROLS_PKGNAME)) {
+ /* terminate syspopup */
+ //syspopup_destroy_all();
+ ecore_timer_add(SYSPOPUP_END_TIMER_SEC, _syspopup_end_timer_cb, NULL);
+ }
+#endif
+ if(b) {
+ bundle_free(b);
+ }
+ if(appid) {
+ free(appid);
+ }
+ }
+ if(pkgname){
+ free(pkgname);
+ }
+ if(pkgtype){
+ free(pkgtype);
+ }
+ return EINA_TRUE;
+}
+
+
+static Eina_Bool _powerkey_timer_cb(void *data)
+{
+ int val = -1;
+ int trigger_val = -1;
+
+ _W("%s, powerkey count[%d]", __func__, key_info.powerkey_count);
+#if 0
+ if(key_info.long_press_timer) {
+ ecore_timer_del(key_info.long_press_timer);
+ key_info.long_press_timer = NULL;
+ _D("delete long_press_timer");
+ }
+
+ if(key_info.powerkey_timer) {
+ ecore_timer_del(key_info.powerkey_timer);
+ key_info.powerkey_timer = NULL;
+ _D("delete powerkey_timer");
+ }
+#endif
+
+ key_info.powerkey_timer = NULL;
+
+ /* setdup_wizard is running : should not turn off LCD*/
+ if(vconf_get_int(VCONFKEY_SETUP_WIZARD_STATE, &val) < 0) {
+ _SECURE_E("Failed to get vconfkey[%s]", VCONFKEY_SETUP_WIZARD_STATE);
+ val = -1;
+ }
+ if(val == VCONFKEY_SETUP_WIZARD_LOCK) {
+ _E("setdup_wizard is running");
+ key_info.powerkey_count = 0;
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ /* Check critical low batt clock mode */
+ if(vconf_get_int(VCONFKEY_PM_KEY_IGNORE, &val) < 0) {
+ _SECURE_E("Failed to get vconfkey[%s]", VCONFKEY_PM_KEY_IGNORE);
+ val = -1;
+ }
+ if(val == 1) { //Critical Low Batt Clock Mode
+ _E("Critical Low Batt Clock Mode");
+ key_info.powerkey_count = 0; //initialize powerkey count
+ if(!key_info.is_lcd_on) {
+ _W("just turn on LCD by powerkey.. starter ignore powerkey operation");
+ } else {
+ _W("just turn off LCD");
+ display_change_state(LCD_OFF);
+ }
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+
+ /* Safety Assitance */
+ if(vconf_get_int(VCONFKEY_WMS_SAFETY_ENABLE, &val) < 0) {
+ _SECURE_E("Failed to get vconfkey[%s]", VCONFKEY_WMS_SAFETY_ENABLE);
+ val = -1;
+ }
+ if(val == 1) { //Safety Assistance is ON
+ if(key_info.powerkey_count == 2) {
+ /* double press */
+ _W("powerkey double press");
+ key_info.powerkey_count = 0;
+ if(!_launch_app_by_double_press()) {
+ _E("Failed to launch by double press");
+ }
+ return ECORE_CALLBACK_CANCEL;
+ } else if(key_info.powerkey_count >= 3) {
+ _E("Safety Assistance : safety is enabled");
+ key_info.powerkey_count = 0;
+ if(vconf_get_int(VCONFKEY_WMS_SAFETY_MESSAGE_TRIGGER, &trigger_val) < 0) {
+ _SECURE_E("Failed to get vconfkey[%s]", VCONFKEY_WMS_SAFETY_MESSAGE_TRIGGER);
+ }
+ _E("Safety Assistance trigger status : [%d]", trigger_val);
+ if(trigger_val == 0) {
+ //set wms trigger
+ if(vconf_set_int(VCONFKEY_WMS_SAFETY_MESSAGE_TRIGGER, 2) < 0) {
+ _SECURE_E("Failed to set vconfkey[%s]", VCONFKEY_WMS_SAFETY_MESSAGE_TRIGGER);
+ }
+
+#if 1 // TO DO.. NEED UX Flow
+ feedback_initialize();
+ feedback_play(FEEDBACK_PATTERN_SAFETY_ASSISTANCE);
+ feedback_deinitialize();
+#endif
+ }
+ return ECORE_CALLBACK_CANCEL;
+ }
+ } else { //Safety Assistance is OFF
+ if(key_info.powerkey_count%2 == 0) {
+ /* double press */
+ _W("powerkey double press");
+ key_info.powerkey_count = 0;
+ if(!_launch_app_by_double_press()) {
+ _E("Failed to launch by double press");
+ }
+ return ECORE_CALLBACK_CANCEL;
+ }
+ }
+ key_info.powerkey_count = 0; //initialize powerkey count
+
+ if(!key_info.is_lcd_on) {
+ _D("just turn on LCD by powerkey.. starter ignore powerkey operation");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ /* check Call state */
+ if(vconf_get_int(VCONFKEY_CALL_STATE, &val) < 0) {
+ _E("Failed to get call state");
+ val = -1;
+ }
+ if(val == VCONFKEY_CALL_VOICE_ACTIVE) {
+ _W("call state is [%d] -> just turn off LCD", val);
+ display_change_state(LCD_OFF);
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ /* checkLockstate */
+ if(vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ _E("Failed to get lock state");
+ val = -1;
+ }
+ if(val == VCONFKEY_IDLE_LOCK) {
+ _W("lock state is [%d] -> just turn off LCD", val);
+ display_change_state(LCD_OFF);
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ /* Show Idle-Clock */
+ if(!_launch_home_by_powerkey())
+ _E("Failed to send powerkey to home..!!");
+#if 0
+ /* terminate syspopup */
+ syspopup_destroy_all();
+#endif
+
+ /* To notify powerkey to fmd & fmw */
+ vconf_set_int("memory/wfmd/wfmd_end_key", 1);
+ vconf_set_int("memory/wfmw/wfmw_end_key", 1);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+static Eina_Bool _long_press_timer_cb(void* data)
+{
+ int pid;
+ bundle *b;
+ int test_mode = -1;
+
+ _W("%s", __func__);
+
+ key_info.long_press_timer = NULL;
+ key_info.is_long_press = EINA_TRUE;
+ key_info.powerkey_count = 0; //initialize powerkey count
+
+ vconf_get_int(VCONFKEY_TESTMODE_POWER_OFF_POPUP, &test_mode);
+ if (test_mode == VCONFKEY_TESTMODE_POWER_OFF_POPUP_DISABLE) {
+ _E("test mode => skip poweroff popup");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ //Check single powerkey press/release
+ if(key_info.powerkey_timer) {
+ ecore_timer_del(key_info.powerkey_timer);
+ key_info.powerkey_timer = NULL;
+ _D("delete powerkey_timer");
+ }
+
+#if USE_DBUS_POWEROFF
+ _request_Poweroff();
+#else
+ b = bundle_create();
+ if (!b)
+ return ECORE_CALLBACK_CANCEL;
+ pid = syspopup_launch("poweroff-syspopup", b);
+ _D("launch power off syspopup, pid : %d", pid);
+ bundle_free(b);
+#endif
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+static Eina_Bool _key_release_cb(void *data, int type, void *event)
+{
+ Evas_Event_Key_Up *ev = event;
+ int val = -1;
+
+ if (!ev) {
+ _D("Invalid event object");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!ev->keyname) {
+ _D("_key_release_cb : Invalid event keyname object");
+ return ECORE_CALLBACK_RENEW;
+ } else {
+ _D("_key_release_cb : %s Released", ev->keyname);
+ }
+
+ if (!strcmp(ev->keyname, KEY_POWER)) {
+
+ _W("POWER Key is released");
+
+ // Check long press timer
+ if(key_info.long_press_timer) {
+ ecore_timer_del(key_info.long_press_timer);
+ key_info.long_press_timer = NULL;
+ _D("delete long press timer");
+ }
+
+ // Check powerkey timer
+ if(key_info.powerkey_timer) {
+ ecore_timer_del(key_info.powerkey_timer);
+ key_info.powerkey_timer = NULL;
+ _D("delete powerkey timer");
+ }
+
+ // Cancel key operation
+ if (EINA_TRUE == key_info.is_cancel) {
+ _D("Cancel key is activated");
+ key_info.is_cancel = EINA_FALSE;
+ key_info.powerkey_count = 0; //initialize powerkey count
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ // Check long press operation
+ if(key_info.is_long_press) {
+ _D("ignore power key release by long poress");
+ key_info.is_long_press = EINA_FALSE;
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if(!key_info.is_lcd_on) {
+ _D("lcd off --> [%f]sec timer", POWERKEY_LCDOFF_TIMER_SEC);
+ key_info.powerkey_timer = ecore_timer_add(POWERKEY_LCDOFF_TIMER_SEC, _powerkey_timer_cb, NULL);
+ } else {
+ key_info.powerkey_timer = ecore_timer_add(POWERKEY_TIMER_SEC, _powerkey_timer_cb, NULL);
+ }
+
+ } else if (!strcmp(ev->keyname, KEY_CANCEL)) {
+ _D("CANCEL Key is released");
+ key_info.is_cancel = EINA_FALSE;
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+static Eina_Bool _key_press_cb(void *data, int type, void *event)
+{
+ Evas_Event_Key_Down *ev = event;
+ int pm_val = -1;
+ int val = -1;
+
+
+ if (!ev) {
+ _D("Invalid event object");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!ev->keyname) {
+ _D("_key_press_cb : Invalid event keyname object");
+ return ECORE_CALLBACK_RENEW;
+ } else {
+ _D("_key_press_cb : %s Pressed", ev->keyname);
+ }
+
+ if (!strcmp(ev->keyname, KEY_POWER)) {
+
+ _W("POWER Key is pressed");
+
+ // Check LCD status
+ if(vconf_get_int(VCONFKEY_PM_STATE, &val) < 0) {
+ _D("Cannot get VCONFKEY_PM_STATE");
+ }
+ _W("LCD state : %d", val);
+ if(val <= VCONFKEY_PM_STATE_LCDDIM) {
+ key_info.is_lcd_on = EINA_TRUE;
+ } else if(val >= VCONFKEY_PM_STATE_LCDOFF) {
+ key_info.is_lcd_on = EINA_FALSE;
+ }
+
+ // Check powerkey press count
+ key_info.powerkey_count++;
+ _W("powerkey count : %d", key_info.powerkey_count);
+
+ // Check powerkey timer
+ if(key_info.powerkey_timer) {
+ ecore_timer_del(key_info.powerkey_timer);
+ key_info.powerkey_timer = NULL;
+ _D("delete powerkey timer");
+ }
+
+ // Check long press
+ if (key_info.long_press_timer) {
+ ecore_timer_del(key_info.long_press_timer);
+ key_info.long_press_timer = NULL;
+ }
+ _D("create long press timer");
+ key_info.is_long_press = EINA_FALSE;
+ key_info.long_press_timer = ecore_timer_add(LONG_PRESS_TIMER_SEC, _long_press_timer_cb, NULL);
+ if(!key_info.long_press_timer) {
+ _E("Failed to add long_press_timer");
+ }
+
+ } else if (!strcmp(ev->keyname, KEY_CANCEL)) {
+ _D("CANCEL key is pressed");
+ key_info.is_cancel = EINA_TRUE;
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+static int _w_gesture_hold_cb(void *data, int ev_type, void *ev)
+{
+ Ecore_X_Event_Gesture_Notify_Hold *e = ev;
+ int ret = 0;
+ int val = -1;
+
+ _D("_w_gesture_hold_cb..!!");
+
+ /* Check critical low batt clock mode */
+ if(vconf_get_int(VCONFKEY_PM_KEY_IGNORE, &val) < 0) {
+ _SECURE_E("Failed to get vconfkey[%s]", VCONFKEY_PM_KEY_IGNORE);
+ }
+ if(val ==1) { //Critical Low Batt Clock Mode
+ _E("Critical Low Batt Clock Mode, ignore gesture");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if(e->num_fingers == GRAB_TWO_FINGERS) {
+ _D("subtype[%d]: hold[%d]\n", e->subtype, e->hold_time);
+ if (e->subtype == ECORE_X_GESTURE_BEGIN) {
+ _D("Begin : launch task mgr..!!");
+ ret = w_launch_app(W_TASKMGR_PKGNAME, NULL);
+ if (ret >= 0) {
+ _SECURE_D("[%s] is launched, pid=[%d]", W_TASKMGR_PKGNAME, ret);
+#if 0
+ /* terminate syspopup */
+ //syspopup_destroy_all();
+ ecore_timer_add(SYSPOPUP_END_TIMER_SEC*2, _syspopup_end_timer_cb, NULL);
+#endif
+ }
+ }
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+inline static void _release_multimedia_key(const char *value)
+{
+ int pid = 0;
+
+ ret_if(NULL == value);
+
+ _D("Multimedia key is released with %s", value);
+
+ bundle *b;
+ b = bundle_create();
+ if (!b) {
+ _E("Cannot create bundle");
+ return;
+ }
+ bundle_add(b, "multimedia_key", value);
+ bundle_add(b, SERVICE_OPERATION_MAIN_KEY, SERVICE_OPERATION_DEFAULT_VALUE);
+
+ pid = w_launch_app(MUSIC_PLAYER_PKG_NAME, b);
+ if (pid < 0)
+ _E("Failed to launch music player, ret : %d", pid);
+
+ bundle_free(b);
+}
+
+
+void _media_key_event_cb(media_key_e key, media_key_event_e status, void *user_data)
+{
+ _D("MEDIA KEY EVENT : %d", key);
+ if (MEDIA_KEY_STATUS_PRESSED == status) return;
+
+ if (MEDIA_KEY_PAUSE == key) {
+ _release_multimedia_key("KEY_PAUSECD");
+ } else if (MEDIA_KEY_PLAY == key) {
+ _release_multimedia_key("KEY_PLAYCD");
+ } else if (MEDIA_KEY_PLAYPAUSE == key) {
+ _release_multimedia_key("KEY_PLAYPAUSECD");
+ }
+}
+
+
+
+void create_key_window(void)
+{
+ int status = -1;
+ int ret = -1;
+
+ _W("create_key_window..!!");
+
+ key_info.win = ecore_x_window_input_new(0, 0, 0, 1, 1);
+ if (!key_info.win) {
+ _E("Failed to create hidden window");
+ return;
+ }
+ ecore_x_event_mask_unset(key_info.win, ECORE_X_EVENT_MASK_NONE);
+ ecore_x_icccm_title_set(key_info.win, "w_starter,key,receiver");
+ ecore_x_netwm_name_set(key_info.win, "w_starter,key,receiver");
+ ecore_x_netwm_pid_set(key_info.win, getpid());
+
+ g_type_init();
+ e_dbus_init();
+
+ ret = utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_POWER, SHARED_GRAB);
+ if (ret != 0) {
+ _E("utilx_grab_key KEY_POWER GrabSHARED_GRAB failed, ret[%d]", ret);
+ }
+
+ key_info.key_up = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, NULL);
+ if (!key_info.key_up)
+ _E("Failed to register a key up event handler");
+
+ key_info.key_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, NULL);
+ if (!key_info.key_down)
+ _E("Failed to register a key down event handler");
+
+ status = ecore_x_gesture_event_grab(key_info.win, ECORE_X_GESTURE_EVENT_HOLD, GRAB_TWO_FINGERS);
+ _E("ECORE_X_GESTURE_EVENT_HOLD Grab(%d fingers) status[%d]\n", GRAB_TWO_FINGERS, status);
+
+ key_info.two_fingers_hold_hd = ecore_event_handler_add(ECORE_X_EVENT_GESTURE_NOTIFY_HOLD,
+ (Ecore_Event_Handler_Cb)_w_gesture_hold_cb, NULL);
+ if (!key_info.two_fingers_hold_hd) {
+ _E("Failed to register handler : ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD\n");
+ }
+
+ media_key_reserve(_media_key_event_cb, NULL);
+
+}
+
+
+
+void destroy_key_window(void)
+{
+ int status;
+
+ if (key_info.two_fingers_hold_hd) {
+ ecore_event_handler_del(key_info.two_fingers_hold_hd);
+ key_info.two_fingers_hold_hd = NULL;
+ }
+
+ status = ecore_x_gesture_event_ungrab(key_info.win, ECORE_X_GESTURE_EVENT_HOLD, GRAB_TWO_FINGERS);
+ if (!status) {
+ _E("ECORE_X_GESTURE_EVENT_HOLD UnGrab(%d fingers) failed, status[%d]\n", GRAB_TWO_FINGERS, status);
+ }
+
+ utilx_ungrab_key(ecore_x_display_get(), key_info.win, KEY_POWER);
+
+ if (key_info.key_up) {
+ ecore_event_handler_del(key_info.key_up);
+ key_info.key_up = NULL;
+ }
+
+ if (key_info.key_down) {
+ ecore_event_handler_del(key_info.key_down);
+ key_info.key_down = NULL;
+ }
+
+ ecore_x_window_delete_request_send(key_info.win);
+ key_info.win = 0x0;
+
+}
+
+
+
+// End of a file
diff --git a/src/lock-daemon.c b/src/lock-daemon.c
new file mode 100644
index 0000000..74801db
--- /dev/null
+++ b/src/lock-daemon.c
@@ -0,0 +1,1763 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Elementary.h>
+
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <glib.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <errno.h>
+#include <sensors.h>
+#include <feedback.h>
+#include <alarm.h>
+#include <time.h>
+#include <dd-deviced.h>
+#include <dd-display.h>
+#include <E_DBus.h>
+
+#include "lockd-debug.h"
+#include "lock-daemon.h"
+#include "lockd-process-mgr.h"
+#include "lockd-window-mgr.h"
+#include "starter-util.h"
+#include "menu_daemon.h"
+#include "hw_key.h"
+
+static int phone_lock_pid;
+static sensor_type_e smart_alert_sensor_type = SENSOR_MOTION_SMART_ALERT;
+
+struct lockd_data {
+ int lock_app_pid;
+ int phone_lock_app_pid;
+ int lock_type; /* -1: None, 0:Normal, 1:Security, 2:Other */
+ Eina_Bool is_sensor; /* EINA_TRUE : can use sensor EINA_FALSE : cannot use */
+ sensor_h s_handle;
+ Eina_Bool request_recovery;
+ Eina_Bool back_to_app;
+ lockw_data *lockw;
+ GPollFD *gpollfd;
+ Eina_Bool is_alarm; /* EINA_TRUE : can use alarm EINA_FALSE : cannot use */
+ alarm_id_t alarm_id; /* -1 : None, others : set alarm */
+ Eina_Bool is_first_boot; /* EINA_TRUE : first boot */
+ int hall_status; /* 0: cover is closed, 1:cover is opened */
+ E_DBus_Connection *hall_conn;
+ E_DBus_Signal_Handler *hall_handler;
+};
+
+#define PHLOCK_SOCK_PREFIX "/tmp/phlock"
+#define PHLOCK_SOCK_MAXBUFF 65535
+
+#define PHLOCK_APP_CMDLINE "/usr/apps/org.tizen.lockscreen/bin/lockscreen" //PHLOCK_UNLOCK_CMD
+#define MDM_APP_CMDLINE "/usr/bin/mdm-server" //PHLOCK_LAUNCH_CMD
+#define VOICE_CALL_APP_CMDLINE "/usr/apps/org.tizen.call/bin/calls" //HOME_RAISE_CMD, LOCK_SHOW_CMD
+#define VIDEO_CALL_APP_CMDLINE "/usr/apps/org.tizen.vtmain/bin/vtmain" //HOME_RAISE_CMD, LOCK_SHOW_CMD
+#define OMA_DRM_AGENT_CMDLINE "/usr/bin/oma-dm-agent" //PHLOCK_UNLOCK_RESET_CMD
+
+#define PHLOCK_UNLOCK_CMD "unlock"
+#define PHLOCK_LAUNCH_CMD "launch_phone_lock"
+#define PHLOCK_UNLOCK_RESET_CMD "unlock_reset"
+#define HOME_RAISE_CMD "raise_homescreen"
+#define LOCK_SHOW_CMD "show_lockscreen"
+
+#define LAUNCH_INTERVAL 100*1000
+
+#define HALL_COVERED_STATUS 0
+#define BUS_NAME "org.tizen.system.deviced"
+#define OBJECT_PATH "/Org/Tizen/System/DeviceD"
+#define INTERFACE_NAME BUS_NAME
+#define DEVICED_PATH_HALL OBJECT_PATH"/Hall"
+#define DEVICED_INTERFACE_HALL INTERFACE_NAME".hall"
+#define SIGNAL_HALL_STATE "ChangeState"
+//#define METHOD_GET_STATUS "getstatus"
+//#define DBUS_REPLY_TIMEOUT (120 * 1000)
+
+#define VOLUME_PKG_NAME "org.tizen.volume"
+#define SHOW_LOCK "show_lock"
+#define ISTRUE "TRUE"
+#define SMART_ALERT_INTERVAL 0.5
+
+enum {
+ LOCK_TYPE_NONE = -1,
+ LOCK_TYPE_NORMAL = 0,
+ LOCK_TYPE_SECURITY,
+ LOCK_TYPE_OTHER,
+ LOCK_TYPE_MAX
+};
+
+static int lockd_launch_app_lockscreen(struct lockd_data *lockd);
+static void lockd_unlock_lockscreen(struct lockd_data *lockd);
+static Eina_Bool lockd_start_sensor(void *data);
+static void lockd_stop_sensor(void *data);
+
+static void _lockd_set_lock_state(bool lock_state)
+{
+ LOCKD_DBG("%s, %d, %d", __func__, __LINE__, lock_state);
+ if(lock_state == TRUE)
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_LOCK);
+ else
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+}
+
+static void _lockd_play_sound(bool unlock)
+{
+ int ret = -1, val = 0;
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &val);
+
+ if(ret == 0 && val == 1) {
+ feedback_play_type(FEEDBACK_TYPE_SOUND, unlock ? FEEDBACK_PATTERN_UNLOCK : FEEDBACK_PATTERN_LOCK);
+ }
+}
+
+int lockd_get_lock_type(void)
+{
+ int lock_type = 0;
+ int ret = 0;
+
+ vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
+
+ if (lock_type == SETTING_SCREEN_LOCK_TYPE_NONE) {
+ ret = LOCK_TYPE_NONE;
+ } else if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD ||
+ lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD ||
+ lock_type == SETTING_SCREEN_LOCK_TYPE_FACE_AND_VOICE) {
+ ret = LOCK_TYPE_SECURITY;
+ } else if (lock_type == SETTING_SCREEN_LOCK_TYPE_SWIPE ||
+ lock_type == SETTING_SCREEN_LOCK_TYPE_MOTION) {
+ ret = LOCK_TYPE_NORMAL;
+ } else {
+ ret = LOCK_TYPE_OTHER;
+ }
+
+ LOCKD_DBG("lockd_get_lock_type ret(%d), lock_type (%d)", ret, lock_type);
+
+ return ret;
+}
+
+#if 0
+int _lockd_append_variant(DBusMessageIter *iter, const char *sig, char *param[])
+{
+ char *ch;
+ int i;
+ int int_type;
+ uint64_t int64_type;
+
+ if (!sig || !param)
+ return 0;
+
+ for (ch = (char*)sig, i = 0; *ch != '\0'; ++i, ++ch) {
+ switch (*ch) {
+ case 'i':
+ int_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &int_type);
+ break;
+ case 'u':
+ int_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &int_type);
+ break;
+ case 't':
+ int64_type = atoi(param[i]);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64, &int64_type);
+ break;
+ case 's':
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &param[i]);
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+
+ return 0;
+}
+
+DBusMessage *_lockd_invoke_dbus_method_sync(const char *dest, const char *path,
+ const char *interface, const char *method,
+ const char *sig, char *param[])
+{
+ DBusConnection *conn;
+ DBusMessage *msg;
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ DBusError err;
+ int r;
+
+ conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+ if (!conn) {
+ LOCKD_ERR("dbus_bus_get error");
+ return NULL;
+ }
+
+ msg = dbus_message_new_method_call(dest, path, interface, method);
+ if (!msg) {
+ LOCKD_ERR("dbus_message_new_method_call(%s:%s-%s)", path, interface, method);
+ return NULL;
+ }
+
+ dbus_message_iter_init_append(msg, &iter);
+ r = _lockd_append_variant(&iter, sig, param);
+ if (r < 0) {
+ LOCKD_ERR("append_variant error(%d)", r);
+ return NULL;
+ }
+
+ dbus_error_init(&err);
+
+ reply = dbus_connection_send_with_reply_and_block(conn, msg, DBUS_REPLY_TIMEOUT, &err);
+ if (!reply) {
+ LOCKD_ERR("dbus_connection_send error(No reply)");
+ }
+
+ if (dbus_error_is_set(&err)) {
+ LOCKD_ERR("dbus_connection_send error(%s:%s)", err.name, err.message);
+ reply = NULL;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+
+ return reply;
+}
+
+static int _lockd_get_hall_status(void)
+{
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
+
+ msg = _lockd_invoke_dbus_method_sync(BUS_NAME, DEVICED_PATH_HALL, DEVICED_INTERFACE_HALL,
+ METHOD_GET_STATUS, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
+
+ dbus_error_init(&err);
+
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ LOCKD_ERR("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+
+ LOCKD_DBG("%s-%s : %d", DEVICED_INTERFACE_HALL, METHOD_GET_STATUS, ret_val);
+ return ret_val;
+}
+#endif
+
+static void _lockd_delete_alarm(alarm_id_t id, void * user_param)
+{
+ int ret_val = ALARMMGR_RESULT_SUCCESS;
+ LOCKD_DBG("Del alarm_id(%d)", id);
+ ret_val = alarmmgr_remove_alarm(id);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_enum_alarm_ids() failed");
+ }
+}
+
+static void _lockd_unset_alarms(void)
+{
+ LOCKD_DBG("[ == %s == ]", __func__);
+ int ret_val = ALARMMGR_RESULT_SUCCESS;
+ ret_val = alarmmgr_enum_alarm_ids(_lockd_delete_alarm, NULL);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_enum_alarm_ids() failed");
+ }
+}
+
+static void _lockd_lauch_lockscreen(alarm_id_t alarm_id, void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ int ret_val = ALARMMGR_RESULT_SUCCESS;
+
+ LOCKD_DBG("[ == %s == ], alarm_id(%d)", __func__, alarm_id);
+
+ lockd->lock_type = lockd_get_lock_type();
+ lockd_launch_app_lockscreen(lockd);
+
+ if(alarm_id != -1) {
+ if(alarm_id != lockd->alarm_id) {
+ LOCKD_ERR("alarm ids are different callback->id(%d), lockd->alarm_id(%d)", alarm_id, lockd->alarm_id);
+ /* delete all registering alarm*/
+ _lockd_unset_alarms();
+ lockd->alarm_id = -1;
+ } else {
+ ret_val = alarmmgr_remove_alarm(alarm_id);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_remove_alarm() failed");
+ /* delete all registering alarm*/
+ _lockd_unset_alarms();
+ }
+ lockd->alarm_id = -1;
+ }
+ }
+}
+
+static Eina_Bool _lockd_set_alarm(int sec, void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return EINA_FALSE;
+ }
+
+ time_t current_time;
+ struct tm current_tm;
+ alarm_entry_t *alarm_info;
+ alarm_id_t alarm_id;
+ alarm_date_t alarm_time;
+ int ret_val = ALARMMGR_RESULT_SUCCESS;
+
+ /* delete before registering alarm ids */
+ if(lockd->alarm_id != -1){
+ LOCKD_ERR("ad->alarm_id(%d) deleted", lockd->alarm_id);
+ ret_val = alarmmgr_remove_alarm(lockd->alarm_id);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_remove_alarm(%d) failed", lockd->alarm_id);
+ _lockd_unset_alarms();
+ }
+ lockd->alarm_id = -1;
+ }
+
+ /* set alarm after sec */
+ time(&current_time);
+
+ LOCKD_DBG("[ == %s ==], %s, after %d SEC.s alarm set", __func__, ctime(&current_time), sec);
+ localtime_r(&current_time, &current_tm);
+
+ alarm_info = alarmmgr_create_alarm();
+ if(alarm_info == NULL) {
+ LOCKD_ERR("alarmmgr_create_alarm() is failed\n");
+ return EINA_FALSE;
+ }
+
+ alarm_time.year = 0;
+ alarm_time.month = 0;
+ alarm_time.day = 0;
+ alarm_time.hour = current_tm.tm_hour;
+ alarm_time.min = current_tm.tm_min;
+ alarm_time.sec = current_tm.tm_sec + sec;
+
+ alarmmgr_set_repeat_mode(alarm_info, ALARM_REPEAT_MODE_ONCE, 0);
+ alarmmgr_set_time(alarm_info, alarm_time);
+ alarmmgr_set_type(alarm_info, ALARM_TYPE_VOLATILE);
+
+ ret_val = alarmmgr_add_alarm_with_localtime(alarm_info, NULL, &alarm_id);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_add_alarm_with_localtime() failed");
+ alarmmgr_free_alarm(alarm_info) ;
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("alarm id(%d) is set", alarm_id);
+ lockd->alarm_id = alarm_id;
+ alarmmgr_free_alarm(alarm_info) ;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool _lockd_sensor_idelr_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ int val = -1;
+ if (vconf_get_int(VCONFKEY_PM_STATE, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY_PM_STATE");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (val == VCONFKEY_PM_STATE_LCDOFF) {
+ LOCKD_DBG("LCD OFF");
+ if(lockd_start_sensor(data) == EINA_FALSE) {
+ LOCKD_ERR("smart_alert sensor start is failed");
+ }
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool _lockd_alarm_idelr_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ _lockd_unset_alarms();
+ lockd->alarm_id = -1;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool _lockd_launch_idelr_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ _lockd_lauch_lockscreen(-1, lockd);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void _lockd_notify_pm_state_cb(keynode_t * node, void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+ int lcdoff_source = VCONFKEY_PM_LCDOFF_BY_POWERKEY;
+ int accessbility_lock_time = 0;
+ int idle_lock_state = VCONFKEY_IDLE_UNLOCK;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_int(VCONFKEY_PM_STATE, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ return;
+ }
+
+ LOCKD_DBG("[ == %s == ] pm_state(%d)", __func__, val);
+
+ if (val == VCONFKEY_PM_STATE_LCDOFF) {
+ LOCKD_DBG("LCD OFF");
+ if(vconf_get_int(VCONFKEY_PM_LCDOFF_SOURCE, &lcdoff_source) < 0)
+ {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ lcdoff_source = VCONFKEY_PM_LCDOFF_BY_POWERKEY;
+ }
+#if 0
+ if(lockd->is_sensor) {
+ if(lockd_start_sensor(lockd) == EINA_FALSE) {
+ LOCKD_ERR("smart_alert sensor start is failed");
+ }
+ }
+#else
+ if(lockd->is_sensor) {
+ ecore_idler_add(_lockd_sensor_idelr_cb, lockd);
+ }
+#endif
+
+ if (lockd->hall_status == HALL_COVERED_STATUS) {
+ LOCKD_DBG("lockd->hall_status : %d, not launch lockscreen", lockd->hall_status);
+ } else if(lcdoff_source == VCONFKEY_PM_LCDOFF_BY_POWERKEY) {
+ LOCKD_DBG("lcd off by powerkey");
+ //ecore_idler_add(_lockd_launch_idelr_cb, lockd);
+ _lockd_lauch_lockscreen(-1, lockd);
+ } else {
+ LOCKD_DBG("lcd off by timeout");
+ if(vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &idle_lock_state) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ idle_lock_state = VCONFKEY_IDLE_UNLOCK;
+ }
+
+ if(idle_lock_state == VCONFKEY_IDLE_LOCK) {
+ LOCKD_DBG("VCONFKEY is set(not need to set alarm)");
+ return;
+ }
+
+ if(lockd->alarm_id != -1) {
+ LOCKD_ERR("Alarm is set yet (alarm_id = %d) : do nothing", lockd->alarm_id);
+ return;
+ }
+
+ if(vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_LOCK_TIME_INT, &accessbility_lock_time) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ accessbility_lock_time = 0;
+ }
+
+ if(accessbility_lock_time == 0) {
+ LOCKD_ERR("accessbility_lock_time is 0");
+ _lockd_lauch_lockscreen(-1, lockd);
+ return;
+ } else {
+ if(lockd->is_alarm) {
+ LOCKD_DBG("set alarm %d sec", accessbility_lock_time);
+ if(_lockd_set_alarm(accessbility_lock_time, lockd) != EINA_TRUE) {
+ LOCKD_ERR("_lockd_set_alarm() failed");
+ _lockd_lauch_lockscreen(-1, lockd);
+ }
+ }
+ else {
+ LOCKD_ERR("is_alarm is EINA_FALSE");
+ _lockd_lauch_lockscreen(-1, lockd);
+ }
+ }
+ }
+ } else if (val == VCONFKEY_PM_STATE_NORMAL) {
+ LOCKD_DBG("LCD ON");
+ /* delete all alarm registering */
+ LOCKD_DBG("%d", lockd->alarm_id);
+#if 1
+ _lockd_unset_alarms();
+ lockd->alarm_id = -1;
+#else
+ ecore_idler_add(_lockd_alarm_idelr_cb, lockd);
+#endif
+ if(lockd->lock_type == LOCK_TYPE_NONE) {
+ LOCKD_DBG("Lockscreen type is none, unlock");
+ //_lockd_set_lock_state(FALSE);
+ }
+ lockd_stop_sensor(lockd);
+ }
+}
+
+static void _lockd_notify_factory_mode_cb(keynode_t * node, void *data)
+{
+ int factory_mode = -1;
+ LOCKD_DBG("Factory mode Notification!!");
+
+ vconf_get_int(VCONFKEY_TELEPHONY_SIM_FACTORY_MODE, &factory_mode);
+ if (factory_mode == VCONFKEY_TELEPHONY_SIM_FACTORYMODE_ON) {
+ LOCKD_DBG("Factory mode ON, lock screen can't be launched..!!");
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ }
+}
+
+static void
+_lockd_notify_lock_state_cb(keynode_t * node, void *data)
+{
+ LOCKD_DBG("lock state changed!!");
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ return;
+ }
+
+ if (val == VCONFKEY_IDLE_UNLOCK) {
+ LOCKD_DBG("unlocked..!!");
+
+ /*Phone lock can't be terminated..!! */
+ if (phone_lock_pid != 0) {
+ LOCKD_ERR("Security lock is unlocked why???");
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_LOCK);
+ return;
+ }
+
+ if (vconf_set_bool(VCONFKEY_SAT_NORMAL_PRIORITY_AVAILABLE_BOOL, EINA_FALSE) < 0) {
+ LOCKD_ERR("Cannot set VCONFKEY");
+ }
+ if (lockd->lock_app_pid > 0) {
+ LOCKD_DBG("terminate lock app..!!");
+ lockd_process_mgr_terminate_lock_app(lockd->lock_app_pid, 1);
+ _lockd_play_sound(TRUE);
+ lockd->lock_app_pid = 0;
+ }
+ }else if (val == VCONFKEY_IDLE_LOCK) {
+ display_unlock_state(LCD_OFF, PM_SLEEP_MARGIN);
+ }
+}
+
+static Eina_Bool lockd_set_lock_state_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_LOCK);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_lockd_notify_phone_lock_verification_cb(keynode_t * node, void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ int val = -1;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ if (vconf_get_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, &val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ return;
+ }
+
+ if (val == TRUE) {
+ /* password verified */
+ /* lockd_unlock_lockscreen(lockd); */
+ lockd_window_mgr_finish_lock(lockd->lockw);
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ }
+}
+
+static int lockd_app_dead_cb(int pid, void *data)
+{
+ LOCKD_DBG("app dead cb call! (pid : %d)", pid);
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (pid == lockd->lock_app_pid && lockd->lock_type == LOCK_TYPE_OTHER) {
+ LOCKD_DBG("lock app(pid:%d) is destroyed.", pid);
+ lockd_unlock_lockscreen(lockd);
+ }
+ menu_daemon_check_dead_signal(pid);
+
+ return 0;
+}
+
+static Eina_Bool lockd_app_create_cb(void *data, int type, void *event)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (lockd == NULL) {
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ if (lockd_window_set_window_effect(lockd->lockw, lockd->lock_app_pid,
+ event) == EINA_TRUE) {
+ //FIXME sometimes show cb is not called.
+ if(lockd_window_set_window_property(lockd->lockw, lockd->lock_app_pid,
+ event) == EINA_FALSE) {
+ LOCKD_ERR("window is not matched..!!");
+ }
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool lockd_app_show_cb(void *data, int type, void *event)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (lockd == NULL) {
+ return EINA_TRUE;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ if (lockd_window_set_window_property(lockd->lockw, lockd->lock_app_pid,
+ event)) {
+ lockd_window_set_scroll_property(lockd->lockw, lockd->lock_type);
+ if (lockd->lock_type > LOCK_TYPE_SECURITY) {
+ ecore_idler_add(lockd_set_lock_state_cb, NULL);
+ }
+ }
+ return EINA_FALSE;
+}
+
+static int _show_lock_bg(void)
+{
+ bundle *b;
+ int r = 0;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (menu_daemon_get_volume_pid() <0) {
+ LOCKD_DBG("volume is not running");
+ return -1;
+ }
+
+ b = bundle_create();
+
+ bundle_add(b, SHOW_LOCK, ISTRUE);
+ r = aul_launch_app(VOLUME_PKG_NAME, b);
+ bundle_free(b);
+
+ return r;
+}
+
+static Eina_Bool _lockd_play_idelr_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ _lockd_play_sound(FALSE);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int lockd_launch_app_lockscreen(struct lockd_data *lockd)
+{
+ LOCKD_DBG("launch app lock screen");
+
+ int call_state = -1, factory_mode = -1, test_mode = -1;
+ int r = 0;
+ int idle_lock_val = VCONFKEY_IDLE_SCREEN_TOP_TRUE;
+ int lcdoff_source = 0;
+ int pid = 0;
+ int pw_type = 0;
+
+ WRITE_FILE_LOG("%s", "Launch lockscreen in starter");
+ vconf_get_int(VCONFKEY_TELEPHONY_SIM_FACTORY_MODE, &factory_mode);
+ if (factory_mode == VCONFKEY_TELEPHONY_SIM_FACTORYMODE_ON) {
+ LOCKD_DBG("Factory mode ON, lock screen can't be launched..!!");
+ return 0;
+ }
+ vconf_get_int(VCONFKEY_TESTMODE_SCREEN_LOCK, &test_mode);
+ if (test_mode == VCONFKEY_TESTMODE_SCREEN_LOCK_DISABLE) {
+ LOCKD_DBG("Test mode ON, lock screen can't be launched..!!");
+ return 0;
+ }
+
+ if (lockd->is_first_boot == TRUE) {
+ if(vconf_get_int(VCONFKEY_PWLOCK_STATE, &pw_type) < 0)
+ {
+ LOCKD_ERR("vconf_get_int() failed");
+ pw_type = VCONFKEY_PWLOCK_RUNNING_UNLOCK;
+ }
+ if(pw_type == VCONFKEY_PWLOCK_BOOTING_LOCK || pw_type == VCONFKEY_PWLOCK_RUNNING_LOCK) {
+ LOCKD_DBG("First boot & pwlock state[%d], lock screen can't be launched..!!", pw_type);
+ return 0;
+ }
+ }
+
+ if (lockd->lock_type == LOCK_TYPE_NONE) {
+ LOCKD_DBG("Lock screen type is None..!!");
+ //_lockd_set_lock_state(TRUE); //just lcd on off
+ return 0;
+ }
+
+ /* Get Call state */
+ if(vconf_get_int(VCONFKEY_PM_LCDOFF_SOURCE, &lcdoff_source) < 0)
+ {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ }
+ vconf_get_int(VCONFKEY_CALL_STATE, &call_state);
+ if(lcdoff_source == VCONFKEY_PM_LCDOFF_BY_POWERKEY) {
+ if ((call_state != VCONFKEY_CALL_OFF) && (lockd->lock_type != LOCK_TYPE_SECURITY)) {
+ pid = lockd_window_mgr_get_focus_win_pid();
+ if (pid >0) {
+ if (lockd_process_mgr_check_call(pid) == TRUE) {
+ LOCKD_DBG("Call is FG => not allow to launch lock screen!!");
+ return 0;
+ } else {
+ LOCKD_DBG("Call is BG => allow to launch lock screen!!");
+ }
+ }
+ }
+ } else {
+ if ((call_state != VCONFKEY_CALL_OFF) && (lockd->back_to_app == FALSE)) {
+ LOCKD_DBG("Current call state(%d) does not allow to launch lock screen.",
+ call_state);
+ return 0;
+ }
+ }
+
+ if(vconf_get_int(VCONFKEY_IDLE_SCREEN_TOP, &idle_lock_val) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ idle_lock_val = VCONFKEY_IDLE_SCREEN_TOP_TRUE;
+ }
+
+ if(idle_lock_val == VCONFKEY_IDLE_SCREEN_TOP_TRUE) {
+ if(vconf_set_bool(VCONFKEY_SAT_NORMAL_PRIORITY_AVAILABLE_BOOL, EINA_TRUE) < 0) {
+ LOCKD_ERR("Cannot get VCONFKEY");
+ }
+ }
+
+ /* Check lock screen application is already exit, no checking phone-lock */
+ if ((lockd->lock_type != LOCK_TYPE_SECURITY)
+ && (lockd_process_mgr_check_lock(lockd->lock_app_pid) == TRUE)) {
+ LOCKD_DBG("Lock Screen App is already running.");
+#if 0
+ r = lockd_process_mgr_restart_lock(lockd->lock_type);
+ if (r < 0) {
+ LOCKD_ERR("Restarting Lock Screen App is fail [%d].", r);
+ usleep(LAUNCH_INTERVAL);
+ } else {
+ if (lockd->lock_app_pid == r) {
+ LOCKD_ERR("Restarting Lock Screen App, pid[%d].", r);
+ return 1;
+ } else {
+ LOCKD_ERR("Restarting Lock Screen App, pid[%d] but previous pid[%d] is running.", r, lockd->lock_app_pid);
+ lockd_process_mgr_kill_lock_app(lockd->lock_app_pid);
+ lockd->lock_app_pid = r;
+ }
+ }
+#else
+ return 1;
+#endif
+ }
+
+ if (lockd->lock_type == LOCK_TYPE_NORMAL) {
+ if (_show_lock_bg() < 0)
+ LOCKD_ERR("Showing bg is failed");
+ if (lockd->lock_app_pid > 0) {
+ LOCKD_ERR("Lock Screen App is remained, pid[%d].", lockd->lock_app_pid);
+ lockd_process_mgr_kill_lock_app(lockd->lock_app_pid);
+ lockd->lock_app_pid = 0;
+ }
+ if(lcdoff_source == VCONFKEY_PM_LCDOFF_BY_POWERKEY)
+ ecore_idler_add(_lockd_play_idelr_cb, NULL);
+ display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ lockd->lock_app_pid =
+ lockd_process_mgr_start_normal_lock(lockd, lockd_app_dead_cb);
+ if (lockd->lock_app_pid < 0)
+ return 0;
+ //display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+#if 0
+ /* reset window mgr before start win mgr */
+ lockd_window_mgr_finish_lock(lockd->lockw);
+ lockd_window_mgr_ready_lock(lockd, lockd->lockw, lockd_app_create_cb,
+ lockd_app_show_cb);
+#endif
+ //_lockd_play_sound(FALSE);
+ } else if (lockd->lock_type == LOCK_TYPE_SECURITY) {
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, FALSE);
+ /* Check phone lock application is already exit */
+ if (lockd_process_mgr_check_lock(lockd->phone_lock_app_pid) == TRUE) {
+ LOCKD_DBG("phone lock App is already running.");
+ if ((lockd->request_recovery == FALSE) && (lockd->back_to_app == FALSE))
+ return 1;
+ }
+
+ if (_show_lock_bg() < 0)
+ LOCKD_ERR("Showing bg is failed");
+ if(lcdoff_source == VCONFKEY_PM_LCDOFF_BY_POWERKEY)
+ ecore_idler_add(_lockd_play_idelr_cb, NULL);
+ display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+
+ /* TO DO : Recovery should be checked by EAS interface later */
+ /* After getting EAS interface, we should remove lockd->request_recovery */
+ if (lockd->request_recovery == TRUE) {
+ lockd->phone_lock_app_pid =
+ lockd_process_mgr_start_recovery_lock();
+ lockd->request_recovery = FALSE;
+ } else if (lockd->back_to_app == TRUE) {
+ lockd->phone_lock_app_pid =
+ lockd_process_mgr_start_back_to_app_lock();
+ lockd->back_to_app = FALSE;
+ } else {
+ lockd->phone_lock_app_pid =
+ lockd_process_mgr_start_phone_lock();
+ }
+ phone_lock_pid = lockd->phone_lock_app_pid;
+ LOCKD_DBG("%s, %d, phone_lock_pid = %d", __func__, __LINE__,
+ phone_lock_pid);
+ //display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ lockd_window_set_phonelock_pid(lockd->lockw, phone_lock_pid);
+ if (phone_lock_pid > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(phone_lock_pid, OOM_IGNORE)) {
+ LOCKD_ERR("Cannot set the memory policy for PW Lockscreen(%d)", phone_lock_pid);
+ } else {
+ LOCKD_ERR("Set the memory policy for PW Lockscreen(%d)", phone_lock_pid);
+ }
+ }
+ //_lockd_play_sound(FALSE);
+ return 1;
+ } else {
+ if (lockd->lock_app_pid > 0) {
+ LOCKD_ERR("Lock Screen App is remained, pid[%d].", lockd->lock_app_pid);
+ lockd_process_mgr_kill_lock_app(lockd->lock_app_pid);
+ lockd->lock_app_pid = 0;
+ }
+ if(lcdoff_source == VCONFKEY_PM_LCDOFF_BY_POWERKEY)
+ ecore_idler_add(_lockd_play_idelr_cb, NULL);
+ display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ lockd->lock_app_pid =
+ lockd_process_mgr_start_lock(lockd, lockd_app_dead_cb,
+ lockd->lock_type);
+ if (lockd->lock_app_pid < 0)
+ return 0;
+ //display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ /* reset window mgr before start win mgr */
+ lockd_window_mgr_finish_lock(lockd->lockw);
+ lockd_window_mgr_ready_lock(lockd, lockd->lockw, lockd_app_create_cb,
+ lockd_app_show_cb);
+ //_lockd_play_sound(FALSE);
+ }
+
+ if (lockd->lock_app_pid > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(lockd->lock_app_pid, OOM_IGNORE)) {
+ LOCKD_ERR("Cannot set the memory policy for Lockscreen(%d)", lockd->lock_app_pid);
+ } else {
+ LOCKD_ERR("Set the memory policy for Lockscreen(%d)", lockd->lock_app_pid);
+ }
+ }
+ return 1;
+}
+
+static void lockd_unlock_lockscreen(struct lockd_data *lockd)
+{
+ LOCKD_DBG("unlock lock screen");
+ lockd->lock_app_pid = 0;
+
+ vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_UNLOCK);
+ lockd_window_mgr_finish_lock(lockd->lockw);
+}
+
+inline static void lockd_set_sock_option(int fd, int cli)
+{
+ int size;
+ int ret;
+ struct timeval tv = { 1, 200 * 1000 }; /* 1.2 sec */
+
+ size = PHLOCK_SOCK_MAXBUFF;
+ ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
+ if(ret != 0)
+ return;
+ ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
+ if(ret != 0)
+ return;
+ if (cli) {
+ ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+ if(ret != 0)
+ return;
+ }
+}
+
+static int lockd_create_sock(void)
+{
+ struct sockaddr_un saddr;
+ int fd;
+
+ fd = socket(AF_UNIX, SOCK_STREAM, 0); /* support above version 2.6.27 */
+ if (fd < 0) {
+ if (errno == EINVAL) {
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ LOCKD_ERR
+ ("second chance - socket create error");
+ return -1;
+ }
+ } else {
+ LOCKD_ERR("socket error");
+ return -1;
+ }
+ }
+
+ bzero(&saddr, sizeof(saddr));
+ saddr.sun_family = AF_UNIX;
+
+ strncpy(saddr.sun_path, PHLOCK_SOCK_PREFIX, strlen(PHLOCK_SOCK_PREFIX));
+ saddr.sun_path[strlen(PHLOCK_SOCK_PREFIX)] = 0;
+
+ unlink(saddr.sun_path);
+
+ if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
+ LOCKD_ERR("bind error");
+ close(fd);
+ return -1;
+ }
+
+ if (chmod(saddr.sun_path, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0) {
+ /* Flawfinder: ignore */
+ LOCKD_ERR("failed to change the socket permission");
+ close(fd);
+ return -1;
+ }
+
+ lockd_set_sock_option(fd, 0);
+
+ if (listen(fd, 10) == -1) {
+ LOCKD_ERR("listen error");
+ close(fd);
+ return -1;
+ }
+
+ return fd;
+}
+
+static gboolean lockd_glib_check(GSource * src)
+{
+ GSList *fd_list;
+ GPollFD *tmp;
+
+ fd_list = src->poll_fds;
+ do {
+ tmp = (GPollFD *) fd_list->data;
+ if ((tmp->revents & (POLLIN | POLLPRI)))
+ return TRUE;
+ fd_list = fd_list->next;
+ } while (fd_list);
+
+ return FALSE;
+}
+
+static char *lockd_read_cmdline_from_proc(int pid)
+{
+ int memsize = 32;
+ char path[32];
+ char *cmdline = NULL, *tempptr = NULL;
+ FILE *fp = NULL;
+
+ snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
+
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ LOCKD_ERR("Cannot open cmdline on pid[%d]", pid);
+ return NULL;
+ }
+
+ cmdline = malloc(32);
+ if (cmdline == NULL) {
+ LOCKD_ERR("%s", "Out of memory");
+ fclose(fp);
+ return NULL;
+ }
+
+ bzero(cmdline, memsize);
+ if (fgets(cmdline, 32, fp) == NULL) {
+ LOCKD_ERR("%s", "Cannot read cmdline");
+ free(cmdline);
+ fclose(fp);
+ return NULL;
+ }
+
+ while (cmdline[memsize - 2] != 0) {
+ cmdline[memsize - 1] = (char)fgetc(fp);
+ tempptr = realloc(cmdline, memsize + 32);
+ if (tempptr == NULL) {
+ fclose(fp);
+ LOCKD_ERR("%s", "Out of memory");
+ return NULL;
+ }
+ cmdline = tempptr;
+ bzero(cmdline + memsize, 32);
+ fgets(cmdline + memsize, 32, fp);
+ memsize += 32;
+ }
+
+ if (fp != NULL)
+ fclose(fp);
+ return cmdline;
+}
+
+static int lockd_sock_handler(void *data)
+{
+ int cl;
+ int len;
+ int sun_size;
+ int clifd = -1;
+ char cmd[PHLOCK_SOCK_MAXBUFF];
+ char *cmdline = NULL;
+ int fd = -1;
+ int recovery_state = -1;
+ GPollFD *gpollfd;
+
+ struct ucred cr;
+ struct sockaddr_un lockd_addr;
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if ((lockd == NULL) || (lockd->gpollfd == NULL)) {
+ LOCKD_ERR("lockd->gpollfd is NULL");
+ return -1;
+ }
+ gpollfd = (GPollFD *)lockd->gpollfd;
+ fd = gpollfd->fd;
+
+ cl = sizeof(cr);
+ sun_size = sizeof(struct sockaddr_un);
+
+ if ((clifd =
+ accept(fd, (struct sockaddr *)&lockd_addr,
+ (socklen_t *) & sun_size)) == -1) {
+ if (errno != EINTR)
+ LOCKD_ERR("accept error");
+ return -1;
+ }
+
+ if (getsockopt(clifd, SOL_SOCKET, SO_PEERCRED, &cr, (socklen_t *) & cl)
+ < 0) {
+ LOCKD_ERR("peer information error");
+ close(clifd);
+ return -1;
+ }
+ LOCKD_ERR("Peer's pid=%d, uid=%d, gid=%d\n", cr.pid, cr.uid, cr.gid);
+
+ memset(cmd, 0, PHLOCK_SOCK_MAXBUFF);
+
+ lockd_set_sock_option(clifd, 1);
+
+ /* receive single packet from socket */
+ len = recv(clifd, cmd, PHLOCK_SOCK_MAXBUFF, 0);
+
+ if (len < 0) {
+ LOCKD_ERR("recv error, read number is less than zero");
+ close(clifd);
+ return -1;
+ }
+
+ cmd[PHLOCK_SOCK_MAXBUFF - 1] = '\0';
+
+ LOCKD_ERR("cmd %s", cmd);
+
+ /* Read command line of the PID from proc fs */
+ cmdline = lockd_read_cmdline_from_proc(cr.pid);
+ if (cmdline == NULL) {
+ /* It's weired. no file in proc file system, */
+ LOCKD_ERR("Error on opening /proc/%d/cmdline", cr.pid);
+ close(clifd);
+ return -1;
+ }
+ LOCKD_SECURE_ERR("/proc/%d/cmdline : %s", cr.pid, cmdline);
+
+ if ((!strncmp(cmdline, PHLOCK_APP_CMDLINE, strlen(cmdline)))
+ && (!strncmp(cmd, PHLOCK_UNLOCK_CMD, strlen(cmd)))) {
+ LOCKD_ERR("phone_lock_pid : %d vs cr.pid : %d", phone_lock_pid, cr.pid);
+ if (phone_lock_pid == cr.pid) {
+ LOCKD_SECURE_ERR("pid [%d] %s is verified, unlock..!!\n", cr.pid,
+ cmdline);
+ lockd_process_mgr_terminate_phone_lock(phone_lock_pid);
+ phone_lock_pid = 0;
+ _lockd_play_sound(TRUE);
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, TRUE);
+ }
+ } else if ((!strncmp(cmd, PHLOCK_UNLOCK_RESET_CMD, strlen(cmd)))
+ && (!strncmp(cmdline, OMA_DRM_AGENT_CMDLINE, strlen(cmdline)))) {
+ LOCKD_SECURE_ERR("%s request %s \n", cmdline, cmd);
+ if(phone_lock_pid > 0) {
+ LOCKD_SECURE_ERR("pid [%d] %s is verified, unlock..!!\n", cr.pid,
+ cmdline);
+ lockd_process_mgr_terminate_phone_lock(phone_lock_pid);
+ phone_lock_pid = 0;
+ _lockd_play_sound(TRUE);
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, TRUE);
+ // reset lockscreen type
+ if (vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE) < 0) {
+ LOCKD_ERR("%s set to %d is failed. error \n",
+ VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE);
+ }
+ }
+ } else if (!strncmp(cmd, PHLOCK_LAUNCH_CMD, strlen(cmd))) {
+ if (!strncmp(cmdline, MDM_APP_CMDLINE, strlen(cmdline))) {
+ LOCKD_ERR("%s request %s \n", cmdline, cmd);
+ if (vconf_get_int(VCONFKEY_EAS_RECOVERY_MODE, &recovery_state) < 0) {
+ LOCKD_ERR("Cannot get vconfkey", VCONFKEY_EAS_RECOVERY_MODE);
+ lockd->request_recovery = FALSE;
+ } else if (recovery_state == 1) {
+ LOCKD_ERR("recovery mode : %d \n", recovery_state);
+ lockd->request_recovery = TRUE;
+ } else {
+ lockd->request_recovery = FALSE;
+ }
+ }
+ if (lockd_get_lock_type() == LOCK_TYPE_SECURITY) {
+ lockd->lock_type = LOCK_TYPE_SECURITY;
+ lockd_launch_app_lockscreen(lockd);
+ } else {
+ lockd->request_recovery = FALSE;
+ }
+ } else if (!strncmp(cmd, HOME_RAISE_CMD, strlen(cmd))) {
+ if ((!strncmp(cmdline, VOICE_CALL_APP_CMDLINE, strlen(cmdline)))
+ || (!strncmp(cmdline, VIDEO_CALL_APP_CMDLINE, strlen(cmdline)))) {
+ LOCKD_SECURE_ERR("%s request %s \n", cmdline, cmd);
+ menu_daemon_open_homescreen(NULL);
+ }
+ } else if (!strncmp(cmd, LOCK_SHOW_CMD, strlen(cmd))) {
+ if ((!strncmp(cmdline, VOICE_CALL_APP_CMDLINE, strlen(cmdline)))
+ || (!strncmp(cmdline, VIDEO_CALL_APP_CMDLINE, strlen(cmdline)))) {
+ LOCKD_SECURE_ERR("%s request %s \n", cmdline, cmd);
+ lockd->back_to_app = TRUE;
+ }
+ if (lockd_get_lock_type() == LOCK_TYPE_SECURITY) {
+ lockd->lock_type = LOCK_TYPE_SECURITY;
+ lockd_launch_app_lockscreen(lockd);
+ } else {
+ lockd->back_to_app = FALSE;
+ }
+ }
+
+ if(cmdline != NULL) {
+ free(cmdline);
+ cmdline = NULL;
+ }
+
+ close(clifd);
+ return 0;
+}
+
+static gboolean lockd_glib_handler(gpointer data)
+{
+ if (lockd_sock_handler(data) < 0) {
+ LOCKD_ERR("lockd_sock_handler is failed..!!");
+ }
+ return TRUE;
+}
+
+static gboolean lockd_glib_dispatch(GSource * src, GSourceFunc callback,
+ gpointer data)
+{
+ callback(data);
+ return TRUE;
+}
+
+static gboolean lockd_glib_prepare(GSource * src, gint * timeout)
+{
+ return FALSE;
+}
+
+static GSourceFuncs funcs = {
+ .prepare = lockd_glib_prepare,
+ .check = lockd_glib_check,
+ .dispatch = lockd_glib_dispatch,
+ .finalize = NULL
+};
+
+static int lockd_init_sock(struct lockd_data *lockd)
+{
+ int fd;
+ GPollFD *gpollfd;
+ GSource *src;
+ int ret;
+
+ fd = lockd_create_sock();
+ if (fd < 0) {
+ LOCKD_ERR("lock daemon create sock failed..!!");
+ }
+
+ src = g_source_new(&funcs, sizeof(GSource));
+
+ gpollfd = (GPollFD *) g_malloc(sizeof(GPollFD));
+ gpollfd->events = POLLIN;
+ gpollfd->fd = fd;
+
+ lockd->gpollfd = gpollfd;
+
+ g_source_add_poll(src, lockd->gpollfd);
+ g_source_set_callback(src, (GSourceFunc) lockd_glib_handler,
+ (gpointer) lockd, NULL);
+ g_source_set_priority(src, G_PRIORITY_LOW);
+
+ ret = g_source_attach(src, NULL);
+ if (ret == 0)
+ return -1;
+
+ g_source_unref(src);
+
+ return 0;
+}
+
+static void lockd_init_vconf(struct lockd_data *lockd)
+{
+ int val = -1;
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_PM_STATE, _lockd_notify_pm_state_cb, lockd) != 0) {
+ LOCKD_ERR("Fail vconf_notify_key_changed : VCONFKEY");
+ }
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_TELEPHONY_SIM_FACTORY_MODE, _lockd_notify_factory_mode_cb, NULL) != 0) {
+ LOCKD_ERR("Fail vconf_notify_key_changed : VCONFKEY");
+ }
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION,
+ _lockd_notify_phone_lock_verification_cb, lockd) != 0) {
+ if (vconf_get_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, &val) < 0) {
+ LOCKD_ERR
+ ("Cannot get VCONFKEY");
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, 0);
+ if (vconf_notify_key_changed
+ (VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION,
+ _lockd_notify_phone_lock_verification_cb,
+ lockd) != 0) {
+ LOCKD_ERR
+ ("Fail vconf_notify_key_changed " );
+ }
+ } else {
+ LOCKD_ERR
+ ("Fail vconf_notify_key_changed " );
+ }
+ }
+
+ if (vconf_notify_key_changed
+ (VCONFKEY_IDLE_LOCK_STATE,
+ _lockd_notify_lock_state_cb,
+ lockd) != 0) {
+ LOCKD_ERR
+ ("[Error] vconf notify : lock state");
+ }
+}
+
+static Eina_Bool _lockd_play_smart_alert_cb(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_REACTIVE_ALERT);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void smart_alert_cb( unsigned long long timestamp, void *user_data)
+{
+ LOCKD_DBG("[ sensor ] smart alert cb called");
+
+ int ret = -1, pm_state = -1, call_state = -1;
+
+ ret = vconf_get_int(VCONFKEY_CALL_STATE, &call_state);
+ if(ret != 0) {
+ LOCKD_ERR("[ sensor ] Get vconf key error");
+ return;
+ }
+
+ if(call_state != VCONFKEY_CALL_OFF) {
+ LOCKD_DBG("[ sensor ] calling now, sensor ignored.");
+ return;
+ }
+
+ ret = vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
+ if(ret != 0) {
+ LOCKD_ERR("[ sensor ] Get vconf key error");
+ return;
+ }
+
+ if(pm_state == VCONFKEY_PM_STATE_LCDOFF) {
+ int calls = 0;
+ int messages = 0;
+ ret = vconf_get_int(VCONFKEY_STARTER_MISSED_CALL, &calls);
+ LOCKD_ERR("[ sensor ] ret = %d calls = %d", ret, calls);
+ if(ret != 0)
+ calls = 0;
+ ret = vconf_get_int(VCONFKEY_STARTER_UNREAD_MESSAGE, &messages);
+ LOCKD_ERR("[ sensor ] ret = %d messages = %d", ret, messages);
+ if(ret != 0)
+ messages = 0;
+ if(calls > 0 || messages > 0) {
+ ecore_timer_add(SMART_ALERT_INTERVAL, _lockd_play_smart_alert_cb, NULL);
+ //feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_REACTIVE_ALERT);
+ }
+ }
+}
+
+static Eina_Bool lockd_create_sensor(void *data)
+{
+ struct lockd_data *lockd = data;
+
+ if(!lockd)
+ return EINA_FALSE;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ sensor_h handle = NULL;
+ int is_supported = 0;
+
+ if(sensor_is_supported(smart_alert_sensor_type, &is_supported) != SENSOR_ERROR_NONE){
+ LOCKD_ERR("sensor_is_supported() failed");
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+ if(!is_supported){
+ LOCKD_ERR("doesn't support the sensor_type SENSOR_MOTION_SMART_ALERT");
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+
+ if(sensor_create(&handle) != SENSOR_ERROR_NONE) {
+ LOCKD_ERR("sensor_create() failed");
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+ lockd->s_handle = handle;
+
+#if 0 //move to start lock daemon
+ if(feedback_initialize() != FEEDBACK_ERROR_NONE) {
+ LOCKD_ERR("feedback_initialize() failed");
+ sensor_destroy(handle);
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+#endif
+ LOCKD_DBG("lockd_create_sensor success!!");
+ return EINA_TRUE;
+}
+
+static Eina_Bool lockd_start_sensor(void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ sensor_h handle = NULL;
+ int ret = -1;
+
+ if(!lockd) {
+ LOCKD_ERR("[ sensor ] lockd is NULL");
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("[ sensor ] %s, %d", __func__, __LINE__);
+ handle = lockd->s_handle;
+ if(handle == NULL){
+ LOCKD_ERR("[ sensor ] sensor handle is NULL");
+ return EINA_FALSE;
+ }
+ ret = sensor_motion_smart_alert_set_cb(handle, smart_alert_cb, NULL);
+ if(ret == SENSOR_ERROR_NONE) {
+ LOCKD_DBG("[ sensor ] sensor_motion_smart_alert_set_cb() success");
+ } else {
+ LOCKD_ERR("[ sensor ] sensor_motion_smart_alert_set_cb() failed[%d]", ret);
+ sensor_destroy(handle);
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+ ret = sensor_start(handle, smart_alert_sensor_type);
+ if(ret == SENSOR_ERROR_NONE) {
+ LOCKD_DBG("[ sensor ] sensor_start() success");
+ } else {
+ LOCKD_ERR("[ sensor ] sensor_start() failed[%d]", ret);
+ sensor_motion_smart_alert_unset_cb(handle);
+ sensor_destroy(handle);
+ lockd->s_handle = NULL;
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+static void lockd_stop_sensor(void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ sensor_h handle = NULL;
+
+ if(!lockd)
+ return;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ handle = lockd->s_handle;
+ if(handle == NULL){
+ return;
+ }
+ sensor_motion_smart_alert_unset_cb(handle);
+ sensor_stop(handle, smart_alert_sensor_type);
+}
+
+static void lockd_destroy_sensor(void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if(!lockd)
+ return;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if(lockd->s_handle == NULL)
+ return;
+
+ lockd_stop_sensor(lockd);
+ sensor_destroy(lockd->s_handle);
+ lockd->s_handle = NULL;
+
+ feedback_deinitialize();
+}
+
+static void lockd_notify_pickup_state_cb(keynode_t * node, void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if(!lockd)
+ return;
+
+ Eina_Bool ret_create = EINA_FALSE;
+ int ret = 0, is_pickup = 0, is_motion = 0;
+
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &is_motion);
+ LOCKD_DBG("ret = %d is_motion = %d", ret, is_motion);
+ if(ret != 0) {
+ LOCKD_ERR("get vconf key VCONFKEY error");
+ return;
+ }
+
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_USE_PICK_UP, &is_pickup);
+ LOCKD_DBG("ret = %d is_pickup = %d", ret, is_pickup);
+ if(ret != 0) {
+ LOCKD_ERR("get vconf key VCONFKEY error");
+ return;
+ }
+
+ if(is_motion && is_pickup && !lockd->s_handle && lockd->is_sensor) {
+ ret_create = lockd_create_sensor(lockd);
+ }
+
+ if((!is_pickup || !is_motion) && lockd->s_handle && lockd->is_sensor) {
+ lockd_destroy_sensor(lockd);
+ lockd->s_handle = NULL;
+ }
+}
+
+static Eina_Bool lockd_init_sensor(void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if(!lockd)
+ return EINA_FALSE;
+
+ LOCKD_DBG("[ sensor ] %s", __func__);
+
+ lockd->s_handle = NULL;
+
+ //check vconf keys
+ int ret = 0;
+ int is_motion = 0;
+ int is_pickup = 0;
+ int pm_val = -1;
+ Eina_Bool is_sensor = EINA_TRUE;
+
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &is_motion);
+ LOCKD_DBG("[ sensor ] ret = %d is_motion = %d", ret, is_motion);
+ if(ret == 0 && is_motion == 1) {
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_USE_PICK_UP, &is_pickup);
+ LOCKD_DBG("[ sensor ] ret = %d is_pickup = %d", ret, is_pickup);
+ if(ret == 0 && is_pickup == 1) {
+ if(lockd_create_sensor(lockd) != EINA_TRUE) {
+ LOCKD_ERR("[ sensor ] lockd_create_sensor() failed");
+ is_sensor = EINA_FALSE;
+ }
+ }
+ }
+
+ if(vconf_notify_key_changed(VCONFKEY_SETAPPL_MOTION_ACTIVATION, lockd_notify_pickup_state_cb, lockd) != 0) {
+ LOCKD_ERR("[ sensor ] Fail vconf_notify_key_changed : VCONFKEY");
+ if(lockd->s_handle)
+ sensor_destroy(lockd->s_handle);
+ lockd->s_handle = NULL;
+ is_sensor = EINA_FALSE;
+ }
+
+ if(vconf_notify_key_changed(VCONFKEY_SETAPPL_USE_PICK_UP, lockd_notify_pickup_state_cb, lockd) != 0) {
+ LOCKD_ERR("[ sensor ] Fail vconf_notify_key_changed : VCONFKEY");
+ if(lockd->s_handle)
+ sensor_destroy(lockd->s_handle);
+ lockd->s_handle = NULL;
+ is_sensor = EINA_FALSE;
+ }
+
+ if(!is_sensor) {
+ return EINA_FALSE;
+ }
+
+ ret = vconf_get_int(VCONFKEY_PM_STATE, &pm_val);
+ LOCKD_DBG("[ sensor ] ret = %d pm_val = %d", ret, pm_val);
+ if(ret == 0 && pm_val == VCONFKEY_PM_STATE_LCDOFF) {
+ if(lockd_start_sensor(lockd) != EINA_TRUE) {
+ LOCKD_ERR("[ sensor ] lockd_start_sensor() failed");
+ return EINA_FALSE;
+ }
+ }
+
+ LOCKD_DBG("[ sensor ] lockd_init_sensor is success!!");
+ return EINA_TRUE;
+}
+
+static Eina_Bool lockd_init_alarm(void *data)
+{
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if(!lockd) {
+ LOCKD_ERR("parameter is NULL");
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ int ret_val = 0;
+ /* alarm id initialize */
+ lockd->alarm_id = -1;
+
+ g_type_init();
+ ret_val = alarmmgr_init(PACKAGE_NAME);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_init() failed(%d)", ret_val);
+ return EINA_FALSE;
+ }
+ ret_val = alarmmgr_set_cb((alarm_cb_t)_lockd_lauch_lockscreen, lockd);
+ if(ret_val != ALARMMGR_RESULT_SUCCESS) {
+ LOCKD_ERR("alarmmgr_init() failed");
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("alarm init success");
+ return EINA_TRUE;
+}
+
+static void _lockd_on_changed_receive(void *data, DBusMessage *msg)
+{
+ DBusError err;
+ char *str;
+ int response;
+ int r;
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+
+ if (lockd == NULL) {
+ LOCKD_ERR("lockd is NULL");
+ return;
+ }
+
+ LOCKD_DBG("hall signal is received");
+
+ r = dbus_message_is_signal(msg, DEVICED_INTERFACE_HALL, SIGNAL_HALL_STATE);
+ if (!r) {
+ LOCKD_ERR("dbus_message_is_signal error");
+ return;
+ }
+
+ LOCKD_DBG("%s - %s", DEVICED_INTERFACE_HALL, SIGNAL_HALL_STATE);
+
+ dbus_error_init(&err);
+ r = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &response, DBUS_TYPE_INVALID);
+ if (!r) {
+ LOCKD_ERR("dbus_message_get_args error");
+ return;
+ }
+
+ LOCKD_DBG("receive data : %d", response);
+ lockd->hall_status = response;
+ if (lockd->hall_status == HALL_COVERED_STATUS) {
+ LOCKD_DBG("lockd->hall_status : %d", response);
+ lockd->lock_type = lockd_get_lock_type();
+ if (lockd->lock_type == LOCK_TYPE_SECURITY) {
+ lockd_launch_app_lockscreen(lockd);
+ }
+ } else {
+ LOCKD_DBG("lockd->hall_status : %d", response);
+ }
+}
+
+static int lockd_init_hall_signal(void *data)
+{
+ E_DBus_Connection *conn;
+ E_DBus_Signal_Handler *handler;
+ int r;
+
+ struct lockd_data *lockd = (struct lockd_data *)data;
+ if(!lockd) {
+ LOCKD_ERR("parameter is NULL");
+ return EINA_FALSE;
+ }
+
+ conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
+ if (conn == NULL) {
+ LOCKD_ERR("e_dbus_bus_get error");
+ return -1;
+ }
+ lockd->hall_conn = conn;
+
+ r = e_dbus_request_name(conn, BUS_NAME, 0, NULL, NULL);
+ if (!r) {
+ LOCKD_ERR("e_dbus_request_name erro");
+ return -1;
+ }
+
+ handler = e_dbus_signal_handler_add(conn, NULL, DEVICED_PATH_HALL,
+ DEVICED_INTERFACE_HALL, SIGNAL_HALL_STATE,
+ _lockd_on_changed_receive, lockd);
+ if (handler == NULL) {
+ LOCKD_ERR("e_dbus_signal_handler_add error");
+ return -1;
+ }
+ lockd->hall_handler = handler;
+ /* S-Cover Lock : Signal <!-- END --> */
+}
+
+static void lockd_start_lock_daemon(void *data)
+{
+ struct lockd_data *lockd = NULL;
+ int r = 0;
+
+ lockd = (struct lockd_data *)data;
+
+ if (!lockd) {
+ return;
+ }
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ /*init and check hall status*/
+ e_dbus_init();
+ lockd->hall_status = -1;
+#if 0
+ lockd->hall_status = _lockd_get_hall_status();
+ LOCKD_DBG(" >>> hall_status : %d", lockd->hall_status);
+#endif
+ if (lockd_init_hall_signal(lockd) < 0) {
+ LOCKD_ERR("Hall signal can't be used.");
+ lockd->hall_status = -1;
+ }
+
+ /*init sensor for smart alert*/
+ lockd->is_sensor = lockd_init_sensor(lockd);
+ /* register vconf notification */
+ lockd_init_vconf(lockd);
+ lockd_process_mgr_init();
+ /* init alarm manager */
+ lockd->is_alarm = lockd_init_alarm(lockd);
+
+ /* Initialize socket */
+ r = lockd_init_sock(lockd);
+ if (r < 0) {
+ LOCKD_ERR("lockd init socket failed: %d", r);
+ }
+ /* Create internal 1x1 window */
+ lockd->lockw = lockd_window_init();
+
+ aul_listen_app_dead_signal(lockd_app_dead_cb, data);
+
+ if(feedback_initialize() != FEEDBACK_ERROR_NONE) {
+ LOCKD_ERR("[CAUTION][ERROR] feedback_initialize() is failed..!!");
+ }
+}
+
+int start_lock_daemon(int launch_lock, int is_first_boot)
+{
+ struct lockd_data *lockd = NULL;
+ int recovery_state = -1;
+ int first_boot = 0;
+ int lock_type = 0;
+ int ret = 0;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockd = (struct lockd_data *)malloc(sizeof(struct lockd_data));
+ memset(lockd, 0x0, sizeof(struct lockd_data));
+ lockd_start_lock_daemon(lockd);
+
+ if (launch_lock == FALSE) {
+ LOCKD_ERR("Don't launch lockscreen..");
+ return 0;
+ }
+
+ lockd->is_first_boot = is_first_boot;
+ if (lockd->is_first_boot == TRUE){
+ LOCKD_ERR("first_boot : %d \n", lockd->is_first_boot);
+ return 0;
+ }
+
+ lock_type = lockd_get_lock_type();
+ if (lock_type == LOCK_TYPE_NONE)
+ return -1;
+ if (lock_type == LOCK_TYPE_SECURITY) {
+ if (vconf_get_int(VCONFKEY_EAS_RECOVERY_MODE, &recovery_state) < 0) {
+ LOCKD_ERR("Cannot get vconfkey" );
+ lockd->request_recovery = FALSE;
+ } else if (recovery_state == 1) {
+ LOCKD_DBG("recovery mode : %d \n", recovery_state);
+ lockd->request_recovery = TRUE;
+ } else {
+ lockd->request_recovery = FALSE;
+ }
+ } else {
+ lockd->request_recovery = FALSE;
+ }
+ lockd->back_to_app = FALSE;
+ lockd->lock_type = lock_type;
+
+ vconf_set_bool(VCONFKEY_SAT_NORMAL_PRIORITY_AVAILABLE_BOOL, EINA_TRUE);
+
+ ret = lockd_launch_app_lockscreen(lockd);
+ return ret;
+}
diff --git a/src/lockd-debug.c b/src/lockd-debug.c
new file mode 100644
index 0000000..747d860
--- /dev/null
+++ b/src/lockd-debug.c
@@ -0,0 +1,103 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <glib.h>
+
+#include "lockd-debug.h"
+
+#define LINEMAX 256
+#define MAXFILELEN 1048576 /* 32000 */
+#define LOGFILE "/tmp/starter.log"
+
+void lockd_log_t(char *fmt, ...)
+{
+ va_list ap;
+ FILE *fd = 0;
+ char buf[LINEMAX] = { 0, };
+ char debugString[LINEMAX] = { 0, };
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ int fileLen = 0;
+ struct tm local_t;
+ time_t current_time = 0;
+ bzero((char *)&debugString, LINEMAX);
+ time(&current_time);
+ /* local_t = gmtime(&current_time); */
+ gmtime_r(&current_time, &local_t); /* for prevent 53555 */
+ int len = snprintf(debugString, sizeof(debugString),
+ "[%d-%02d-%02d, %02d:%02d:%02d]: ",
+ local_t.tm_year + 1900, local_t.tm_mon + 1,
+ local_t.tm_mday, local_t.tm_hour, local_t.tm_min,
+ local_t.tm_sec);
+ if (len == -1) {
+ return;
+ } else {
+ debugString[len] = '\0';
+ }
+ len = g_strlcat(debugString, buf, LINEMAX);
+ if (len >= LINEMAX) {
+ /* TODO:ERROR handling */
+ return;
+ } else {
+ debugString[len] = '\n';
+ }
+ /* FIXME this is for permission.. later we should fix and remove this... */
+ /* system("chmod 666 "LOGFILE); */
+ if ((fd = fopen(LOGFILE, "at+")) == NULL) {
+ LOCKD_DBG("File fopen fail for writing Pwlock information");
+ } else {
+ int pid = -1;
+ if (fwrite(debugString, strlen(debugString), 1, fd) < 1) {
+ LOCKD_DBG
+ ("File fwrite fail for writing Pwlock information");
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ /* system("rm -rf "LOGFILE); */
+ } else {
+ fseek(fd, 0l, SEEK_END);
+ fileLen = ftell(fd);
+ if (fileLen > MAXFILELEN) {
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ return;
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ /* system("rm -rf "LOGFILE); */
+ } else
+ fclose(fd);
+ }
+ }
+}
diff --git a/src/lockd-process-mgr.c b/src/lockd-process-mgr.c
new file mode 100644
index 0000000..787c400
--- /dev/null
+++ b/src/lockd-process-mgr.c
@@ -0,0 +1,315 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <aul.h>
+#include <pkgmgr-info.h>
+
+#include "lockd-debug.h"
+#include "lockd-process-mgr.h"
+#include "starter-vconf.h"
+
+#define LOCKD_DEFAULT_PKG_NAME "org.tizen.lockscreen"
+#define LOCKD_DRAG_LOCKSCREEN "org.tizen.draglock"
+#define LOCKD_PHONE_LOCK_PKG_NAME LOCKD_DEFAULT_PKG_NAME
+#define RETRY_MAXCOUNT 30
+#define RELAUNCH_INTERVAL 100*1000
+
+#define LOCKD_VOICE_CALL_PKG_NAME "org.tizen.call"
+#define LOCKD_VIDEO_CALL_PKG_NAME "org.tizen.vtmain"
+
+static char *default_lockscreen_pkg = NULL;
+
+static bool _lockd_exist_package(char *pkgid)
+{
+ int ret = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(pkgid, &handle);
+ if (PMINFO_R_OK != ret || NULL == handle) {
+ LOCKD_SECURE_DBG("%s doesn't exist in this binary", pkgid);
+ return false;
+ }
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+
+ return true;
+}
+
+void lockd_process_mgr_init(void)
+{
+ default_lockscreen_pkg = vconf_get_str(VCONF_PRIVATE_LOCKSCREEN_DEFAULT_PKGNAME);
+ LOCKD_SECURE_DBG("default lock screen pkg name is %s", default_lockscreen_pkg);
+ if (default_lockscreen_pkg == NULL) {
+ default_lockscreen_pkg = LOCKD_DEFAULT_PKG_NAME;
+ }
+ if (!_lockd_exist_package(default_lockscreen_pkg)) {
+ LOCKD_SECURE_ERR("%s is not exist, default lock screen pkg name is set to %s", default_lockscreen_pkg, LOCKD_DRAG_LOCKSCREEN);
+ default_lockscreen_pkg = LOCKD_DRAG_LOCKSCREEN;
+ if (vconf_set_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, default_lockscreen_pkg) != 0) {
+ LOCKD_SECURE_ERR("vconf key [%s] set [%s] is failed", VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, default_lockscreen_pkg);
+ }
+ }
+}
+
+static char *_lockd_process_mgr_get_pkgname(int lock_type)
+{
+ char *pkgname = NULL;
+
+ if (lock_type > 1) {
+ pkgname = vconf_get_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR);
+ LOCKD_SECURE_DBG("pkg name is %s", pkgname);
+ if (pkgname == NULL) {
+ pkgname = default_lockscreen_pkg;
+ } else if (_lockd_exist_package(pkgname) == FALSE) {
+ pkgname = default_lockscreen_pkg;
+ }
+ } else {
+ pkgname = default_lockscreen_pkg;
+ }
+ return pkgname;
+}
+
+int lockd_process_mgr_restart_lock(int lock_type)
+{
+ char *lock_app_path = NULL;
+ int pid;
+ int i;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ lock_app_path = _lockd_process_mgr_get_pkgname(lock_type);
+
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = aul_launch_app(lock_app_path, NULL);
+ LOCKD_DBG("aul_launch_app(%s), pid = %d", lock_app_path, pid);
+ if (pid == AUL_R_ETIMEOUT) {
+ LOCKD_DBG("Relaunch lock application [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else {
+ return pid;
+ }
+ }
+
+ LOCKD_SECURE_DBG("Reset : aul_launch_app(%s, NULL), pid = %d", lock_app_path,
+ pid);
+ return pid;
+}
+
+int
+lockd_process_mgr_start_lock(void *data, int (*dead_cb) (int, void *),
+ int lock_type)
+{
+ char *lock_app_path = NULL;
+ int pid;
+ int i;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ lock_app_path = _lockd_process_mgr_get_pkgname(lock_type);
+
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = aul_launch_app(lock_app_path, NULL);
+
+ LOCKD_SECURE_DBG("aul_launch_app(%s), pid = %d", lock_app_path, pid);
+
+ if ((pid == AUL_R_ECOMM) || (pid == AUL_R_ETERMINATING)) {
+ LOCKD_DBG("Relaunch lock application [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else if (pid == AUL_R_ERROR) {
+ LOCKD_SECURE_ERR("launch[%s] is failed, launch default lock screen", lock_app_path);
+ pid = aul_launch_app(default_lockscreen_pkg, NULL);
+ if (pid == AUL_R_ERROR) {
+ LOCKD_SECURE_ERR("launch[%s] is failed, launch drag lock screen", default_lockscreen_pkg);
+ pid = aul_launch_app(LOCKD_DRAG_LOCKSCREEN, NULL);
+ if (pid >0) {
+ if (vconf_set_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, LOCKD_DRAG_LOCKSCREEN) != 0) {
+ LOCKD_SECURE_ERR("vconf key [%s] set [%s] is failed", VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, LOCKD_DRAG_LOCKSCREEN);
+ }
+ return pid;
+ }
+ } else {
+ return pid;
+ }
+ } else {
+ return pid;
+ }
+ }
+ LOCKD_DBG("Relaunch lock application failed..!!");
+ return pid;
+}
+
+int lockd_process_mgr_start_normal_lock(void *data, int (*dead_cb) (int, void *))
+{
+ int pid = 0;
+
+ int i;
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = aul_launch_app(default_lockscreen_pkg, NULL);
+
+ LOCKD_SECURE_DBG("aul_launch_app(%s), pid = %d", default_lockscreen_pkg, pid);
+
+ if ((pid == AUL_R_ECOMM) || (pid == AUL_R_ETERMINATING)) {
+ LOCKD_DBG("Relaunch lock application [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else if (pid == AUL_R_ERROR) {
+ LOCKD_SECURE_DBG("launch[%s] is failed, launch default lock screen", default_lockscreen_pkg);
+#if 0
+ pid = aul_launch_app(LOCKD_DRAG_LOCKSCREEN, NULL);
+ if (pid >0) {
+ if (vconf_set_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, LOCKD_DRAG_LOCKSCREEN) != 0) {
+ LOCKD_SECURE_ERR("vconf key [%s] set [%s] is failed", VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, LOCKD_DRAG_LOCKSCREEN);
+ }
+ return pid;
+ }
+#endif
+ } else {
+ return pid;
+ }
+ }
+ LOCKD_DBG("Relaunch lock application failed..!!");
+ return pid;
+}
+
+int lockd_process_mgr_start_phone_lock(void)
+{
+ int pid = 0;
+ bundle *b = NULL;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ b = bundle_create();
+
+ bundle_add(b, "lock_type", "phone_lock");
+
+ pid = aul_launch_app(LOCKD_PHONE_LOCK_PKG_NAME, b);
+ LOCKD_SECURE_DBG("aul_launch_app(%s, b), pid = %d", LOCKD_PHONE_LOCK_PKG_NAME,
+ pid);
+ if (b)
+ bundle_free(b);
+
+ return pid;
+}
+
+int lockd_process_mgr_start_recovery_lock(void)
+{
+ int pid = 0;
+ bundle *b = NULL;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ b = bundle_create();
+
+ bundle_add(b, "lock_type", "recovery_lock");
+
+ pid = aul_launch_app(LOCKD_PHONE_LOCK_PKG_NAME, b);
+ LOCKD_SECURE_DBG("aul_launch_app(%s, b), pid = %d", LOCKD_PHONE_LOCK_PKG_NAME,
+ pid);
+ if (b)
+ bundle_free(b);
+
+ return pid;
+}
+
+int lockd_process_mgr_start_back_to_app_lock(void)
+{
+ int pid = 0;
+ bundle *b = NULL;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ b = bundle_create();
+
+ bundle_add(b, "lock_type", "back_to_call");
+
+ pid = aul_launch_app(LOCKD_PHONE_LOCK_PKG_NAME, b);
+ LOCKD_SECURE_DBG("aul_launch_app(%s, b), pid = %d", LOCKD_PHONE_LOCK_PKG_NAME,
+ pid);
+ if (b)
+ bundle_free(b);
+
+ return pid;
+}
+
+void
+lockd_process_mgr_terminate_lock_app(int lock_app_pid, int state)
+{
+ LOCKD_DBG
+ ("lockd_process_mgr_terminate_lock_app, state:%d\n",
+ state);
+
+ if (state == 1) {
+ if (lock_app_pid != 0) {
+ LOCKD_DBG("Terminate Lock app(pid : %d)", lock_app_pid);
+ aul_terminate_pid(lock_app_pid);
+ }
+ }
+}
+
+void lockd_process_mgr_terminate_phone_lock(int phone_lock_pid)
+{
+ LOCKD_DBG("Terminate Phone Lock(pid : %d)", phone_lock_pid);
+ aul_terminate_pid(phone_lock_pid);
+}
+
+void lockd_process_mgr_kill_lock_app(int lock_app_pid)
+{
+ LOCKD_DBG ("lockd_process_mgr_kill_lock_app [pid:%d]..", lock_app_pid);
+ aul_kill_pid(lock_app_pid);
+}
+
+int lockd_process_mgr_check_lock(int pid)
+{
+ char buf[128];
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ /* Check pid is invalid. */
+ if (aul_app_get_pkgname_bypid(pid, buf, sizeof(buf)) < 0) {
+ LOCKD_DBG("no such pkg by pid %d\n", pid);
+ } else {
+ LOCKD_SECURE_DBG("app pkgname = %s, pid = %d\n", buf, pid);
+ if (aul_app_is_running(buf) == TRUE) {
+ LOCKD_DBG("%s [pid = %d] is running\n", buf, pid);
+ return TRUE;
+ } else {
+ LOCKD_SECURE_DBG("[pid = %d] is exist but %s is not running\n",
+ pid, buf);
+ }
+ }
+ return FALSE;
+}
+
+int lockd_process_mgr_check_call(int pid)
+{
+ char buf[128];
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ /* Check pid is invalid. */
+ if (aul_app_get_pkgname_bypid(pid, buf, sizeof(buf)) < 0) {
+ LOCKD_DBG("no such pkg by pid %d\n", pid);
+ } else {
+ LOCKD_SECURE_DBG("app pkgname = %s, pid = %d\n", buf, pid);
+ if ((!strncmp(buf, LOCKD_VOICE_CALL_PKG_NAME, strlen(buf)))
+ || (!strncmp(buf, LOCKD_VIDEO_CALL_PKG_NAME, strlen(buf)))) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
diff --git a/src/lockd-window-mgr.c b/src/lockd-window-mgr.c
new file mode 100644
index 0000000..82fddae
--- /dev/null
+++ b/src/lockd-window-mgr.c
@@ -0,0 +1,781 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <ui-gadget.h>
+#include <vconf.h>
+#include <bundle.h>
+#include <appcore-efl.h>
+#include <app.h>
+
+#include "lockd-debug.h"
+#include "lockd-window-mgr.h"
+
+#define PACKAGE "starter"
+#define SOS_KEY_COUNT 3
+#define SOS_KEY_INTERVAL 0.5
+
+#define _MAKE_ATOM(a, s) \
+ do { \
+ a = ecore_x_atom_get(s); \
+ if (!a) \
+ fprintf(stderr, \
+ "##s creation failed.\n"); \
+ } while(0)
+
+#define STR_ATOM_PANEL_SCROLLABLE_STATE "_E_MOVE_PANEL_SCROLLABLE_STATE"
+
+struct _lockw_data {
+ Evas_Object *main_win;
+ Evas_Object *main_layout;
+
+ Ecore_X_Window lock_x_window;
+
+ Ecore_Event_Handler *h_keydown;
+ Ecore_Event_Handler *h_wincreate;
+ Ecore_Event_Handler *h_winshow;
+
+#if 0
+ Ecore_Timer *pTimerId; /* volume key timer */
+ int volume_key_cnt;
+#endif
+
+ int phone_lock_state; /* 0 : disable, 1 : enable */
+ int phone_lock_app_pid;
+};
+
+#if 0
+Eina_Bool volume_key_expire_cb(void *pData)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+ lockw_data *lockw = (lockw_data *) pData;
+
+ _DBG("volume_key_expire_cb..!!");
+
+ lockw->volume_key_cnt = 0;
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eina_Bool _lockd_window_key_down_cb(void *data, int type, void *event)
+{
+ Ecore_Event_Key *ev = event;
+ lockw_data *lockw = (lockw_data *) data;
+ int vconf_val = 0;
+ int ret = 0;
+
+ LOCKD_DBG("Key Down CB : %s", ev->keyname);
+
+ ret = vconf_get_int(VCONFKEY_MESSAGE_SOS_STATE, &vconf_val);
+
+ if(ret != 0)
+ {
+ LOCKD_ERR("_lockd_window_key_down_cb:VCONFKEY_MESSAGE_SOS_STATE FAILED");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (!strcmp(ev->keyname, KEY_VOLUMEUP) || !strcmp(ev->keyname, KEY_VOLUMEDOWN)) {
+ if (vconf_val == VCONFKEY_MESSAGE_SOS_IDLE) {
+ if (lockw->volume_key_cnt == 0) {
+ lockw->volume_key_cnt++;
+ LOCKD_DBG("Volume key is pressed %d times", lockw->volume_key_cnt);
+ lockw->pTimerId = ecore_timer_add(SOS_KEY_INTERVAL, volume_key_expire_cb, lockw);
+ } else if (lockw->volume_key_cnt == SOS_KEY_COUNT) {
+ LOCKD_DBG("SOS msg invoked");
+ if (lockw->pTimerId != NULL) {
+ ecore_timer_del(lockw->pTimerId);
+ lockw->pTimerId = NULL;
+ lockw->volume_key_cnt =0;
+ vconf_set_int(VCONFKEY_MESSAGE_SOS_STATE, VCONFKEY_MESSAGE_SOS_INVOKED);
+ ecore_x_pointer_grab(lockw->lock_x_window);
+ }
+ } else {
+ if (lockw->pTimerId != NULL) {
+ ecore_timer_del(lockw->pTimerId);
+ lockw->pTimerId = NULL;
+ lockw->volume_key_cnt++;
+ LOCKD_DBG("Volume key is pressed %d times", lockw->volume_key_cnt);
+ lockw->pTimerId = ecore_timer_add(SOS_KEY_INTERVAL, volume_key_expire_cb, lockw);
+ }
+ }
+ }
+ } else if (!strcmp(ev->keyname, KEY_HOME)) {
+ if (vconf_val != VCONFKEY_MESSAGE_SOS_IDLE) {
+ LOCKD_DBG("Home key is pressed set to idle", lockw->volume_key_cnt);
+ vconf_set_int(VCONFKEY_MESSAGE_SOS_STATE, VCONFKEY_MESSAGE_SOS_IDLE);
+ ecore_x_pointer_ungrab();
+ }
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+#endif
+
+static int
+_lockd_window_check_validate_rect(Ecore_X_Display * dpy, Ecore_X_Window window)
+{
+ Ecore_X_Window root;
+ Ecore_X_Window child;
+
+ int rel_x = 0;
+ int rel_y = 0;
+ int abs_x = 0;
+ int abs_y = 0;
+
+ unsigned int width = 0;
+ unsigned int height = 0;
+ unsigned int border = 0;
+ unsigned int depth = 0;
+
+ Eina_Bool ret = FALSE;
+
+ root = ecore_x_window_root_first_get();
+
+ if (XGetGeometry
+ (dpy, window, &root, &rel_x, &rel_y, &width, &height, &border,
+ &depth)) {
+ if (XTranslateCoordinates
+ (dpy, window, root, 0, 0, &abs_x, &abs_y, &child)) {
+ if ((abs_x - border) >= 480 || (abs_y - border) >= 800
+ || (width + abs_x) <= 0 || (height + abs_y) <= 0) {
+ ret = FALSE;
+ } else {
+ ret = TRUE;
+ }
+ }
+ }
+
+ return ret;
+}
+
+static Evas_Object *lockd_create_main_window(const char *pkgname)
+{
+ Evas_Object *eo = NULL;
+ int w, h;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ eo = elm_win_add(NULL, pkgname, ELM_WIN_BASIC);
+ if (eo) {
+ elm_win_title_set(eo, pkgname);
+ elm_win_borderless_set(eo, EINA_TRUE);
+ ecore_x_window_size_get(ecore_x_window_root_first_get(),
+ &w, &h);
+ LOCKD_DBG("%s, %d, w = %d, h = %d", __func__, __LINE__, w, h);
+ evas_object_resize(eo, w, h);
+ }
+ return eo;
+}
+
+static Evas_Object *lockd_create_main_layout(Evas_Object * parent)
+{
+ Evas_Object *ly = NULL;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ ly = elm_layout_add(parent);
+ if (!ly) {
+ LOCKD_ERR("UI layout add error");
+ return NULL;
+ }
+
+ elm_layout_theme_set(ly, "layout", "application", "default");
+ evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_show(ly);
+
+ elm_win_indicator_mode_set(parent, ELM_WIN_INDICATOR_SHOW);
+
+ return ly;
+}
+
+static void _lockd_phone_lock_alpha_ug_layout_cb(ui_gadget_h ug,
+ enum ug_mode mode, void *priv)
+{
+ lockw_data *lockw = (lockw_data *) priv;;
+ Evas_Object *base = NULL;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (!ug || !lockw)
+ return;
+
+ base = ug_get_layout(ug);
+ if (!base)
+ return;
+
+ switch (mode) {
+ case UG_MODE_FULLVIEW:
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ ug_disable_effect(ug); /* not use effect when destroy phone lock UG */
+ evas_object_show(base);
+ break;
+ case UG_MODE_FRAMEVIEW:
+ /* elm_layout_content_set(lockw->main_layout, "content", base); *//* not used */
+ break;
+ default:
+ break;
+ }
+}
+
+static void _lockd_phone_lock_alpha_ug_result_cb(ui_gadget_h ug,
+ service_h service, void *priv)
+{
+ int alpha;
+ const char *val1 = NULL, *val2 = NULL;
+ lockw_data *lockw = (lockw_data *) priv;;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (!ug || !lockw)
+ return;
+
+ service_get_extra_data(service, "name", &val1);
+
+ LOCKD_DBG("val1 = %s", val1);
+
+ if (val1 == NULL)
+ return;
+
+ service_get_extra_data(service, "result", &val2);
+
+ if (val2 == NULL)
+ return;
+
+ LOCKD_DBG("val2 = %s", val2);
+
+
+ if (!strcmp(val1, "phonelock-ug")) {
+ if (!strcmp(val2, "success")) {
+ LOCKD_DBG("password verified. Unlock!\n");
+ }
+ } else if (!strcmp(val1, "phonelock-ug-alpha")) {
+ alpha = atoi(val2);
+ }
+
+ if(val1 != NULL)
+ free(val1);
+
+ if(val2 != NULL)
+ free(val2);
+}
+
+static void _lockd_phone_lock_alpha_ug_destroy_cb(ui_gadget_h ug,
+ void *priv)
+{
+ lockw_data *lockw = (lockw_data *) priv;;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (!ug || !lockw)
+ return;
+
+ ug_destroy(ug);
+ ug = NULL;
+ lockd_destroy_ug_window(lockw);
+ vconf_set_bool(VCONFKEY_LOCKSCREEN_PHONE_LOCK_VERIFICATION, TRUE);
+}
+
+static void _lockd_ug_window_set_win_prop(void *data, int type)
+{
+ Ecore_X_Window w;
+ Evas_Object *win = NULL;
+ lockw_data *lockw = (lockw_data *) data;;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (!lockw)
+ return;
+
+ win = lockw->main_win;
+
+ w = elm_win_xwindow_get(win);
+
+ if (type == ECORE_X_WINDOW_TYPE_NORMAL) {
+ ecore_x_netwm_window_type_set(w, ECORE_X_WINDOW_TYPE_NORMAL);
+ } else if (type == ECORE_X_WINDOW_TYPE_NOTIFICATION) {
+ ecore_x_netwm_window_type_set(w,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ utilx_set_system_notification_level(ecore_x_display_get(), w,
+ UTILX_NOTIFICATION_LEVEL_NORMAL);
+ }
+}
+
+static void _lockd_ug_window_set_key_grab(void *data)
+{
+ Ecore_X_Window w;
+ int ret = 0;
+ Evas_Object *win = NULL;
+ lockw_data *lockw = (lockw_data *) data;;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (!lockw)
+ return;
+
+ win = lockw->main_win;
+ w = elm_win_xwindow_get(win);
+ ret = utilx_grab_key(ecore_x_display_get(), w, KEY_HOME, EXCLUSIVE_GRAB);
+ if(ret)
+ {
+ LOCKD_ERR("Key grab error : KEY_HOME");
+ }
+ ret = utilx_grab_key(ecore_x_display_get(), w, KEY_CONFIG, TOP_POSITION_GRAB);
+ if(ret)
+ {
+ LOCKD_ERR("Key grab error : KEY_CONFIG");
+ }
+}
+
+static void _lockd_ug_window_set_key_ungrab(void *data)
+{
+ Ecore_X_Window xwin;
+ Ecore_X_Display *disp = NULL;
+ lockw_data *lockw = (lockw_data *) data;;
+
+ if (!lockw)
+ return;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ disp = ecore_x_display_get();
+ xwin = elm_win_xwindow_get(lockw->main_win);
+
+ utilx_ungrab_key(disp, xwin, KEY_HOME);
+ utilx_ungrab_key(disp, xwin, KEY_CONFIG);
+}
+
+static void _lockd_ug_window_vconf_call_state_changed_cb(keynode_t * node,
+ void *data)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+ lockw_data *lockw = (lockw_data *) data;
+
+ if (!lockw)
+ return;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ api_ret = vconf_get_int(VCONFKEY_CALL_STATE, &vconf_val);
+ if (api_ret != 0) {
+ LOCKD_DBG("fail to get vconf key value"
+ );
+ } else {
+ if (vconf_val == VCONFKEY_CALL_OFF) {
+ LOCKD_DBG("call off state..");
+ _lockd_ug_window_set_win_prop(lockw,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ } else {
+ LOCKD_DBG("call on state..");
+ _lockd_ug_window_set_win_prop(lockw,
+ ECORE_X_WINDOW_TYPE_NORMAL);
+ }
+ }
+ return;
+}
+
+static void _lockd_ug_window_register_vconf_changed(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ if (vconf_notify_key_changed
+ (VCONFKEY_CALL_STATE, _lockd_ug_window_vconf_call_state_changed_cb,
+ data) != 0) {
+ LOCKD_DBG("Fail to register");
+ }
+}
+
+static void _lockd_ug_window_unregister_vconf_changed(void *data)
+{
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ if (vconf_ignore_key_changed
+ (VCONFKEY_CALL_STATE,
+ _lockd_ug_window_vconf_call_state_changed_cb) != 0) {
+ LOCKD_DBG("Fail to unregister");
+ }
+
+}
+
+void _lockd_window_transient_for_set(void *data)
+{
+ lockw_data *lockw = (lockw_data *) data;
+ Ecore_X_Window xwin_ug;
+ Ecore_X_Window xwin_lock;
+
+ if (!lockw)
+ return;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ xwin_ug = elm_win_xwindow_get(lockw->main_win);
+ xwin_lock = lockw->lock_x_window;
+
+ LOCKD_DBG("ug win id : %x, and lock win id is :%x", xwin_ug, xwin_lock);
+ ecore_x_icccm_transient_for_set(xwin_ug, xwin_lock);
+}
+
+Eina_Bool _lockd_window_set_window_property_timer_cb(void *data)
+{
+ Ecore_X_Window win = (Ecore_X_Window) data;
+ LOCKD_DBG
+ ("[MINSU] win id(%x) set lock screen window property to notification and level low\n",
+ win);
+
+ /* Set notification type */
+ ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
+
+ /* Set notification's priority */
+ utilx_set_system_notification_level(ecore_x_display_get(), win,
+ UTILX_NOTIFICATION_LEVEL_LOW);
+
+ return EINA_FALSE;
+}
+
+static Window get_user_created_window(Window win)
+{
+ Atom type_ret = 0;
+ int ret, size_ret = 0;
+ unsigned long num_ret = 0, bytes = 0;
+ unsigned char *prop_ret = NULL;
+ unsigned int xid;
+ Atom prop_user_created_win;
+
+ prop_user_created_win =
+ XInternAtom(ecore_x_display_get(), "_E_USER_CREATED_WINDOW", False);
+
+ ret =
+ XGetWindowProperty(ecore_x_display_get(), win,
+ prop_user_created_win, 0L, 1L, False, 0,
+ &type_ret, &size_ret, &num_ret, &bytes,
+ &prop_ret);
+
+ if (ret != Success) {
+ if (prop_ret)
+ XFree((void *)prop_ret);
+ return win;
+ } else if (!prop_ret) {
+ return win;
+ }
+
+ memcpy(&xid, prop_ret, sizeof(unsigned int));
+ XFree((void *)prop_ret);
+
+ return xid;
+
+}
+
+int
+lockd_window_mgr_get_focus_win_pid(void)
+{
+ Ecore_X_Window x_win_focused = 0;
+ int pid = 0;
+ int ret = -1;
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ x_win_focused = ecore_x_window_focus_get();
+ ret = ecore_x_netwm_pid_get(x_win_focused, &pid);
+ if(ret != 1) {
+ LOCKD_ERR("Can't get pid for focus x window (%x)\n", x_win_focused);
+ return -1;
+ }
+ LOCKD_DBG("PID(%d) for focus x window (%x)\n", pid, x_win_focused);
+
+ return pid;
+}
+
+Eina_Bool
+lockd_window_set_window_property(lockw_data * data, int lock_app_pid,
+ void *event)
+{
+ Ecore_X_Event_Window_Create *e = event;
+ Ecore_X_Window user_window = 0;
+ lockw_data *lockw = (lockw_data *) data;
+ int pid = 0;
+
+ if (!lockw) {
+ return EINA_FALSE;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ user_window = get_user_created_window((Window) (e->win));
+
+ int ret = ecore_x_netwm_pid_get(user_window, &pid);
+ if(ret != 1) {
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("Check PID(%d) window. (lock_app_pid : %d)\n", pid,
+ lock_app_pid);
+
+ if (lock_app_pid == pid) {
+ if (_lockd_window_check_validate_rect
+ (ecore_x_display_get(), user_window) == TRUE) {
+ lockw->lock_x_window = user_window;
+ LOCKD_DBG
+ ("This is lock application. Set window property. win id : %x",
+ user_window);
+
+ /* window effect : fade in /out */
+ ecore_x_icccm_name_class_set(user_window, "LOCK_SCREEN",
+ "LOCK_SCREEN");
+
+ /* Set notification type */
+ ecore_x_netwm_window_type_set(user_window,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+
+ /* Set notification's priority */
+ utilx_set_system_notification_level(ecore_x_display_get
+ (), user_window,
+ UTILX_NOTIFICATION_LEVEL_NORMAL);
+ /* Set opaque state */
+ utilx_set_window_opaque_state(ecore_x_display_get(),
+ user_window,
+ UTILX_OPAQUE_STATE_ON);
+ return EINA_TRUE;
+ }
+ }
+ return EINA_FALSE;
+}
+
+Eina_Bool
+lockd_window_set_window_effect(lockw_data * data, int lock_app_pid, void *event)
+{
+ Ecore_X_Event_Window_Create *e = event;
+ Ecore_X_Window user_window = 0;
+ int pid = 0;
+
+ user_window = get_user_created_window((Window) (e->win));
+ int ret = ecore_x_netwm_pid_get(user_window, &pid);
+ if(ret != 1) {
+ return EINA_FALSE;
+ }
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ LOCKD_DBG("PID(%d) window created. (lock_app_pid : %d)\n", pid,
+ lock_app_pid);
+
+ if (lock_app_pid == pid) {
+ if (_lockd_window_check_validate_rect
+ (ecore_x_display_get(), user_window) == TRUE) {
+ LOCKD_DBG
+ ("This is lock application. Disable window effect. win id : %x\n",
+ user_window);
+
+ utilx_set_window_effect_state(ecore_x_display_get(),
+ user_window, 0);
+ return EINA_TRUE;
+ }
+ }
+ return EINA_FALSE;
+}
+
+void
+lockd_window_set_scroll_property(lockw_data * data, int lock_type)
+{
+ lockw_data *lockw = (lockw_data *) data;
+ Ecore_X_Atom ATOM_PANEL_SCROLLABLE_STATE = 0;
+ unsigned int val[3];
+
+ if (!lockw) {
+ return;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+
+ // init atoms
+ _MAKE_ATOM(ATOM_PANEL_SCROLLABLE_STATE, STR_ATOM_PANEL_SCROLLABLE_STATE );
+
+ if (lock_type == 1) {
+ val[0] = 0; // always enable F
+ val[1] = 0; // quickpanel enable F
+ val[2] = 0; // apptray enable F
+ } else {
+ val[0] = 0; // always enable F
+ val[1] = 1; // quickpanel enable T
+ val[2] = 0; // apptray enable F
+ }
+ ecore_x_window_prop_card32_set(lockw->lock_x_window,
+ ATOM_PANEL_SCROLLABLE_STATE,
+ val,
+ 3);
+}
+
+void lockd_window_set_phonelock_pid(lockw_data * data, int phone_lock_pid)
+{
+ lockw_data *lockw = (lockw_data *) data;
+
+ if (!lockw) {
+ return;
+ }
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+ lockw->phone_lock_app_pid = phone_lock_pid;
+ LOCKD_DBG("%s, %d, lockw->phone_lock_app_pid = %d", __func__, __LINE__,
+ lockw->phone_lock_app_pid);
+}
+
+void
+lockd_window_mgr_ready_lock(void *data, lockw_data * lockw,
+ Eina_Bool(*create_cb) (void *, int, void *),
+ Eina_Bool(*show_cb) (void *, int, void *))
+{
+ if (lockw == NULL) {
+ LOCKD_ERR("lockw is NULL.");
+ return;
+ }
+ /* Register window create CB */
+ lockw->h_wincreate =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, create_cb,
+ data);
+ lockw->h_winshow =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, show_cb, data);
+
+#if 0
+ lockw->volume_key_cnt = 0;
+
+ /* Register keydown event handler */
+ lockw->h_keydown =
+ ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
+ _lockd_window_key_down_cb, lockw);
+#endif
+}
+
+void lockd_window_mgr_finish_lock(lockw_data * lockw)
+{
+ Ecore_X_Window xwin;
+
+ if (lockw == NULL) {
+ LOCKD_ERR("lockw is NULL.");
+ return;
+ }
+ /* delete window create event handler */
+ if (lockw->h_wincreate != NULL) {
+ ecore_event_handler_del(lockw->h_wincreate);
+ lockw->h_wincreate = NULL;
+ }
+ if (lockw->h_winshow != NULL) {
+ ecore_event_handler_del(lockw->h_winshow);
+ lockw->h_winshow = NULL;
+ }
+
+ ecore_x_pointer_ungrab();
+
+ /* delete keydown event handler */
+ if (lockw->h_keydown != NULL) {
+ ecore_event_handler_del(lockw->h_keydown);
+ lockw->h_keydown = NULL;
+ }
+}
+
+lockw_data *lockd_window_init(void)
+{
+ lockw_data *lockw = NULL;
+ long pid;
+
+ /* Create lockd window data */
+ lockw = (lockw_data *) malloc(sizeof(lockw_data));
+ memset(lockw, 0x0, sizeof(lockw_data));
+
+ pid = getpid();
+
+ return lockw;
+}
+
+void lockd_create_ug_window(void *data)
+{
+ lockw_data *lockw = NULL;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockw = (lockw_data *) data;
+ if (!lockw) {
+ return;
+ }
+
+ lockd_destroy_ug_window(lockw);
+
+ /* create main window */
+ lockw->main_win = lockd_create_main_window(PACKAGE);
+
+ /* create main layout */
+ /* remove indicator in running time */
+ /* lockw->main_layout = lockd_create_main_layout(lockw->main_win); */
+ appcore_set_i18n(PACKAGE, NULL);
+ _lockd_ug_window_set_key_grab(lockw);
+ _lockd_ug_window_register_vconf_changed(lockw);
+ lockw->phone_lock_state = 1;
+}
+
+void lockd_destroy_ug_window(void *data)
+{
+ lockw_data *lockw = NULL;
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockw = (lockw_data *) data;
+ if (!lockw) {
+ return;
+ }
+
+ _lockd_ug_window_set_key_ungrab(lockw);
+ _lockd_ug_window_unregister_vconf_changed(lockw);
+
+ if (lockw->main_win) {
+ evas_object_del(lockw->main_win);
+ lockw->main_win = NULL;
+ }
+ lockw->phone_lock_state = 0;
+}
+
+void lockd_show_phonelock_alpha_ug(void *data)
+{
+ lockw_data *lockw = NULL;
+ service_h service;
+ struct ug_cbs cbs = { 0, };
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ lockw = (lockw_data *) data;
+ if (!lockw) {
+ return;
+ }
+
+ cbs.layout_cb = _lockd_phone_lock_alpha_ug_layout_cb;
+ cbs.result_cb = _lockd_phone_lock_alpha_ug_result_cb;
+ cbs.destroy_cb = _lockd_phone_lock_alpha_ug_destroy_cb;
+ cbs.priv = (void *)data;
+
+ service_create(&service);
+
+ service_add_extra_data(service, "phone-lock-type", "phone-lock");
+ service_add_extra_data(service, "window-type", "alpha");
+
+ elm_win_alpha_set(lockw->main_win, TRUE);
+ evas_object_color_set(lockw->main_win, 0, 0, 0, 0);
+
+ /* window effect : fade in /out */
+ ecore_x_icccm_name_class_set(elm_win_xwindow_get(lockw->main_win),
+ "LOCK_SCREEN", "LOCK_SCREEN");
+
+ UG_INIT_EFL(lockw->main_win, UG_OPT_INDICATOR_ENABLE);
+ ug_create(NULL, "phone-lock-efl", UG_MODE_FULLVIEW, service, &cbs);
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ service_destroy(service);
+
+ LOCKD_DBG("%s, %d", __func__, __LINE__);
+
+ evas_object_show(lockw->main_win);
+ _lockd_ug_window_set_win_prop(lockw, ECORE_X_WINDOW_TYPE_NOTIFICATION);
+}
diff --git a/src/menu_daemon.c b/src/menu_daemon.c
new file mode 100644
index 0000000..a33e193
--- /dev/null
+++ b/src/menu_daemon.c
@@ -0,0 +1,645 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <ail.h>
+#include <aul.h>
+#include <db-util.h>
+#include <Elementary.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pkgmgr-info.h>
+#include <stdio.h>
+#include <dd-deviced.h>
+#include <syspopup_caller.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <vconf.h>
+
+#include "hw_key.h"
+#include "util.h"
+#include "xmonitor.h"
+
+
+int errno;
+
+
+#define QUERY_UPDATE_NAME "UPDATE app_info SET name='%s' where package='%s';"
+#define RELAUNCH_INTERVAL 100*1000
+#define RETRY_MAXCOUNT 30
+#if !defined(VCONFKEY_SVOICE_PACKAGE_NAME)
+#define VCONFKEY_SVOICE_PACKAGE_NAME "db/svoice/package_name"
+#endif
+
+
+
+// Define prototype of the "hidden API of AUL"
+//extern int aul_listen_app_dead_signal(int (*func)(int signal, void *data), void *data);
+
+
+
+static struct info {
+ pid_t home_pid;
+ pid_t tray_pid;
+ pid_t volume_pid;
+ int safe_mode;
+ int cradle_status;
+ int pm_key_ignore;
+ int power_off;
+ char *svoice_pkg_name;
+} s_info = {
+ .home_pid = (pid_t)-1,
+ .tray_pid = (pid_t)-1,
+ .volume_pid = (pid_t)-1,
+ .safe_mode = -1,
+ .cradle_status = -1,
+ .pm_key_ignore = -1,
+ .power_off = 0,
+ .svoice_pkg_name = NULL,
+};
+
+
+
+#define VCONFKEY_IDLE_SCREEN_SAFEMODE "memory/idle-screen/safemode"
+int menu_daemon_is_safe_mode(void)
+{
+ if (-1 == s_info.safe_mode) {
+ if (vconf_get_int(VCONFKEY_IDLE_SCREEN_SAFEMODE, &s_info.safe_mode) < 0) {
+ _E("Failed to get safemode info");
+ s_info.safe_mode = 0;
+ }
+ }
+
+ return s_info.safe_mode;
+}
+
+
+
+#define VCONFKEY_SYSMAN_CRADLE_STATUS "memory/sysman/cradle_status"
+int menu_daemon_get_cradle_status(void)
+{
+ if (-1 == s_info.cradle_status) {
+ if (vconf_get_int(VCONFKEY_SYSMAN_CRADLE_STATUS, &s_info.cradle_status) < 0) {
+ _E("Failed to get cradle status");
+ s_info.cradle_status = 0;
+ }
+ }
+
+ return s_info.cradle_status;
+}
+
+
+
+#define RETRY_COUNT 5
+int menu_daemon_open_app(const char *pkgname)
+{
+ register int i;
+ int r = AUL_R_OK;
+ for (i = 0; i < RETRY_COUNT; i ++) {
+ r = aul_open_app(pkgname);
+ if (0 <= r) return r;
+ else {
+ _D("aul_open_app error(%d)", r);
+ _F("cannot open an app(%s) by %d", pkgname, r);
+ }
+ usleep(500000);
+ }
+
+ return r;
+}
+
+
+
+int menu_daemon_launch_app(const char *pkgname, bundle *b)
+{
+ register int i;
+ int r = AUL_R_OK;
+ for (i = 0; i < RETRY_COUNT; i ++) {
+ r = aul_launch_app(pkgname, b);
+ if (0 <= r) return r;
+ else {
+ _D("aul_launch_app error(%d)", r);
+ _F("cannot launch an app(%s) by %d", pkgname, r);
+ }
+ usleep(500000);
+ }
+
+ return r;
+}
+
+
+
+void menu_daemon_launch_app_tray(void)
+{
+ bundle *kb = NULL;
+
+ _D("launch App-tray");
+ kb = bundle_create();
+ bundle_add(kb, "HIDE_LAUNCH", "0");
+
+ s_info.tray_pid = menu_daemon_launch_app(APP_TRAY_PKG_NAME, kb);
+ if (s_info.tray_pid < 0) {
+ _SECURE_E("Failed to reset %s", APP_TRAY_PKG_NAME);
+ } else if (s_info.tray_pid > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(s_info.tray_pid, OOM_IGNORE)) {
+ _E("Cannot set the memory policy for App tray(%d)", s_info.tray_pid);
+ } else {
+ _D("Set the memory policy for App tray(%d)", s_info.tray_pid);
+ }
+ }
+
+ bundle_free(kb);
+}
+
+
+
+bool menu_daemon_is_homescreen(pid_t pid)
+{
+ if (s_info.home_pid == pid) return true;
+ return false;
+}
+
+
+
+inline char *menu_daemon_get_selected_pkgname(void)
+{
+ char *pkgname = NULL;
+
+ pkgname = vconf_get_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME);
+ retv_if(NULL == pkgname, NULL);
+
+ return pkgname;
+}
+
+
+
+/* NOTE: THIS FUNCTION Is ONLY USED FOR CONFIDENTIAL FEATURE. REMOVE ME */
+static inline void _hide_launch_app_tray(void)
+{
+ bundle *kb = NULL;
+
+ _D("Hide-launch App-tray");
+ kb = bundle_create();
+ bundle_add(kb, "HIDE_LAUNCH", "1");
+
+ s_info.tray_pid = menu_daemon_launch_app(APP_TRAY_PKG_NAME, kb);
+ if (s_info.tray_pid < 0) {
+ _SECURE_E("Failed to reset %s", APP_TRAY_PKG_NAME);
+ } else if (s_info.tray_pid > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(s_info.tray_pid, OOM_IGNORE)) {
+ _E("Cannot set the memory policy for App tray(%d)", s_info.tray_pid);
+ } else {
+ _E("Set the memory policy for App tray(%d)", s_info.tray_pid);
+ }
+ }
+
+ bundle_free(kb);
+}
+
+
+
+static bool _exist_package(char *pkgid)
+{
+ int ret = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(pkgid, &handle);
+ if (PMINFO_R_OK != ret || NULL == handle) {
+ _SECURE_D("%s doesn't exist in this binary", pkgid);
+ return false;
+ }
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+
+ return true;
+}
+
+
+
+static void _check_home_screen_package(void)
+{
+ char *pkgname = NULL;
+ pkgname = menu_daemon_get_selected_pkgname();
+ if (pkgname) {
+ _SECURE_D("Selected Home-screen : %s", pkgname);
+ bool is_existed = _exist_package(pkgname);
+ free(pkgname);
+ if (true == is_existed) {
+ return;
+ }
+ }
+
+ if (_exist_package(CLUSTER_HOME_PKG_NAME)) {
+ if (0 != vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, CLUSTER_HOME_PKG_NAME)) {
+ _SECURE_E("Cannot set value(%s) into key(%s)", VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, CLUSTER_HOME_PKG_NAME);
+ } else return;
+ }
+
+ if (_exist_package(MENU_SCREEN_PKG_NAME)) {
+ if (0 != vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, MENU_SCREEN_PKG_NAME)) {
+ _SECURE_E("Cannot set value(%s) into key(%s)", VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, MENU_SCREEN_PKG_NAME);
+ } else return;
+ }
+}
+
+
+
+inline void menu_daemon_open_homescreen(const char *pkgname)
+{
+ char *homescreen = NULL;
+ char *tmp = NULL;
+
+ if (menu_daemon_is_safe_mode()) {
+ homescreen = CLUSTER_HOME_PKG_NAME;
+ } else {
+ homescreen = (char *) pkgname;
+ }
+
+ if (!pkgname) {
+ tmp = menu_daemon_get_selected_pkgname();
+ ret_if(NULL == tmp);
+ homescreen = tmp;
+ }
+
+ int ret = -1;
+ ret = menu_daemon_open_app(homescreen);
+ while (0 > ret) {
+ _E("Failed to open a default home, %s", homescreen);
+ ret = menu_daemon_open_app(homescreen);
+ }
+
+ /* NOTE: [BEGIN] REMOVE THIS, THIS CODE Is ONLY USED FOR CONFIDENTIAL FEATURE */
+ if (!strcmp(homescreen, CLUSTER_HOME_PKG_NAME) || !strcmp(homescreen, EASY_HOME_PKG_NAME)) {
+ if (s_info.tray_pid < 0) {
+ _hide_launch_app_tray();
+ }
+ }
+ /* NOTE: [END] REMOVE THIS, THIS CODE Is ONLY USED FOR CONFIDENTIAL FEATURE */
+
+ s_info.home_pid = ret;
+ if (ret > 0) {
+ if (-1 == deviced_conf_set_mempolicy_bypid(ret, OOM_IGNORE)) {
+ _E("Cannot set the memory policy for Home-screen(%d)", ret);
+ } else {
+ _D("Set the memory policy for Home-screen(%d)", ret);
+ }
+ }
+
+ if (tmp) free(tmp);
+}
+
+
+
+inline int menu_daemon_get_pm_key_ignore(int ignore_key)
+{
+ return s_info.pm_key_ignore & ignore_key;
+}
+
+
+
+inline void menu_daemon_set_pm_key_ignore(int ignore_key, int value)
+{
+ if (value) {
+ s_info.pm_key_ignore |= ignore_key;
+ } else {
+ s_info.pm_key_ignore &= ~ignore_key;
+ }
+
+ if (vconf_set_int(VCONFKEY_PM_KEY_IGNORE, s_info.pm_key_ignore) < 0) {
+ _E("Can't set %s", VCONFKEY_PM_KEY_IGNORE);
+ }
+}
+
+
+
+static void _show_cb(keynode_t* node, void *data)
+{
+ int seq;
+
+ _D("[MENU_DAEMON] _show_cb is invoked");
+
+ if (node) {
+ seq = vconf_keynode_get_int(node);
+ } else {
+ if (vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &seq) < 0) {
+ _E("Failed to get sequence info");
+ return;
+ }
+ }
+
+ switch (seq) {
+ case 0:
+ if (s_info.home_pid > 0) {
+ int pid;
+ _D("pid[%d] is terminated.", s_info.home_pid);
+ pid = s_info.home_pid;
+ s_info.home_pid = -1; /* to freeze the dead_cb */
+ if (aul_terminate_pid(pid) != AUL_R_OK)
+ _E("Failed to terminate %d", s_info.home_pid);
+
+ _D("pid[%d] is terminated.", s_info.tray_pid);
+ pid = s_info.tray_pid;
+ s_info.tray_pid = -1; /* to freeze the dead_cb */
+ if (pid > 0 && aul_terminate_pid(pid) != AUL_R_OK)
+ _E("Failed to terminate %d", s_info.tray_pid);
+ }
+ break;
+ case 1:
+ menu_daemon_open_homescreen(NULL);
+ break;
+ default:
+ _E("False sequence [%d]", seq);
+ break;
+ }
+
+ return;
+}
+
+
+
+static void _font_cb(keynode_t* node, void *data)
+{
+ _D("Font is changed");
+
+ if (AUL_R_OK != aul_terminate_pid(s_info.tray_pid))
+ _E("Cannot terminate App-tray");
+}
+
+
+
+static void _cradle_status_cb(keynode_t* node, void *data)
+{
+ if (vconf_get_int(VCONFKEY_SYSMAN_CRADLE_STATUS, &s_info.cradle_status) < 0) {
+ _E("Failed to get cradle status");
+ s_info.cradle_status = 0;
+ }
+
+ _D("Cradle status is changed to [%d]", s_info.cradle_status);
+}
+
+
+
+static void _pm_key_ignore_cb(keynode_t* node, void *data)
+{
+ if (vconf_get_int(VCONFKEY_PM_KEY_IGNORE, &s_info.pm_key_ignore) < 0) {
+ _E("Failed to get pm key ignore");
+ s_info.pm_key_ignore= -1;
+ }
+
+ _D("pm key ignore is changed to [%d]", s_info.pm_key_ignore);
+}
+
+
+
+static void _pkg_changed(keynode_t* node, void *data)
+{
+ char *pkgname;
+ int seq;
+
+ if (vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &seq) < 0) {
+ _E("Do nothing, there is no sequence info yet");
+ return;
+ }
+
+ if (seq < 1) {
+ _E("Sequence is not ready yet, do nothing");
+ return;
+ }
+
+ _D("_pkg_changed is invoked");
+
+ _check_home_screen_package();
+
+ pkgname = menu_daemon_get_selected_pkgname();
+ if (!pkgname)
+ return;
+
+ _SECURE_D("pkg_name : %s", pkgname);
+
+ if (s_info.home_pid > 0) {
+ char old_pkgname[256];
+
+ if (aul_app_get_pkgname_bypid(s_info.home_pid, old_pkgname, sizeof(old_pkgname)) == AUL_R_OK) {
+ if (!strcmp(pkgname, old_pkgname)) {
+ _D("Package is changed but same package is selected");
+ free(pkgname);
+ return;
+ }
+ }
+
+ if (!strcmp(old_pkgname, CLUSTER_HOME_PKG_NAME)) {
+ if (AUL_R_OK != aul_terminate_pid(s_info.tray_pid))
+ _D("Failed to terminate pid %d", s_info.tray_pid);
+ }
+
+ if (AUL_R_OK != aul_terminate_pid(s_info.home_pid))
+ _D("Failed to terminate pid %d", s_info.home_pid);
+ } else {
+ /* If there is no running home */
+ menu_daemon_open_homescreen(pkgname);
+ }
+
+ /* NOTE: Dead callback will catch the termination of a current menuscreen
+ * menu_daemon_open_homescreen(pkgname);
+ */
+ free(pkgname);
+ return;
+}
+
+
+
+static void _launch_volume(void)
+{
+ int pid;
+ int i;
+ _D("_launch_volume");
+
+ for (i=0; i<RETRY_MAXCOUNT; i++)
+ {
+ pid = syspopup_launch("volume", NULL);
+
+ _D("syspopup_launch(volume), pid = %d", pid);
+
+ if (pid <0) {
+ _D("syspopup_launch(volume)is failed [%d]times", i);
+ usleep(RELAUNCH_INTERVAL);
+ } else {
+ s_info.volume_pid = pid;
+ return;
+ }
+ }
+}
+
+
+
+int menu_daemon_check_dead_signal(int pid)
+{
+ char *pkgname;
+
+ _D("Process %d is termianted", pid);
+
+ if (pid < 0) return 0;
+ if (s_info.power_off) return 0;
+
+ pkgname = menu_daemon_get_selected_pkgname();
+ if (!pkgname)
+ return 0;
+
+ if (pid == s_info.home_pid) {
+ /* Relaunch */
+ _SECURE_D("pkg_name : %s", pkgname);
+ menu_daemon_open_homescreen(pkgname);
+ } else if (pid == s_info.tray_pid) {
+ /* NOTE: [BEGIN] REMOVE THIS, THIS CODE Is ONLY USED FOR CONFIDENTIAL FEATURE */
+ if (!strcmp(pkgname, CLUSTER_HOME_PKG_NAME) || !strcmp(pkgname, EASY_HOME_PKG_NAME)) {
+ _hide_launch_app_tray();
+ } else {
+ _D("Do not launch App-tray");
+ s_info.tray_pid = -1;
+ }
+ /* NOTE: [END] REMOVE THIS, THIS CODE Is ONLY USED FOR CONFIDENTIAL FEATURE */
+ } else if (pid == s_info.volume_pid) {
+ /* Relaunch */
+ _launch_volume();
+ } else {
+ _D("Unknown process, ignore it (dead pid %d, home pid %d, tray pid %d)",
+ pid, s_info.home_pid, s_info.tray_pid);
+ }
+
+ free(pkgname);
+
+ return 0;
+}
+
+
+int menu_daemon_get_volume_pid(void)
+{
+ return s_info.volume_pid;
+}
+
+
+static void _svoice_pkg_cb(keynode_t* node, void *data)
+{
+ if (s_info.svoice_pkg_name) free(s_info.svoice_pkg_name);
+
+ s_info.svoice_pkg_name = vconf_get_str(VCONFKEY_SVOICE_PACKAGE_NAME);
+ ret_if(NULL == s_info.svoice_pkg_name);
+
+ _SECURE_D("svoice pkg name is changed to [%s]", s_info.svoice_pkg_name);
+}
+
+
+
+const char *menu_daemon_get_svoice_pkg_name(void)
+{
+ return s_info.svoice_pkg_name;
+}
+
+
+
+static void _power_off_cb(keynode_t* node, void *data)
+{
+ int val = VCONFKEY_SYSMAN_POWER_OFF_NONE;
+ ret_if(vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val) != 0);
+
+ if (val == VCONFKEY_SYSMAN_POWER_OFF_DIRECT || val == VCONFKEY_SYSMAN_POWER_OFF_RESTART) {
+ s_info.power_off = 1;
+ } else s_info.power_off = 0;
+
+ _D("power off status : %d", s_info.power_off);
+}
+
+
+
+void menu_daemon_init(void *data)
+{
+ _D( "[MENU_DAEMON]menu_daemon_init is invoked");
+
+ aul_launch_init(NULL,NULL);
+
+ _check_home_screen_package();
+
+ create_key_window();
+ if (xmonitor_init() < 0) _E("cannot init xmonitor");
+
+ _launch_volume();
+
+ if (vconf_notify_key_changed(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, _pkg_changed, NULL) < 0)
+ _E("Failed to add the callback for package change event");
+
+ if (vconf_notify_key_changed(VCONFKEY_STARTER_SEQUENCE, _show_cb, NULL) < 0)
+ _E("Failed to add the callback for show event");
+
+ if (vconf_notify_key_changed("db/setting/accessibility/font_name", _font_cb, NULL) < 0)
+ _E("Failed to add the callback for font event");
+
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_CRADLE_STATUS, _cradle_status_cb, NULL) < 0)
+ _E("Failed to add the callback for cradle status");
+ _D("Cradle status : %d", menu_daemon_get_cradle_status());
+
+ if (vconf_notify_key_changed(VCONFKEY_PM_KEY_IGNORE, _pm_key_ignore_cb, NULL) < 0)
+ _E("Failed to add the callback for pm key ignore");
+ _pkg_changed(NULL, NULL);
+
+ if (vconf_notify_key_changed(VCONFKEY_SVOICE_PACKAGE_NAME, _svoice_pkg_cb, NULL) < 0)
+ _E("Failed to add the callback for svoice pkg");
+ _svoice_pkg_cb(NULL, NULL);
+
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb, NULL) < 0)
+ _E("Failed to add the callback for power-off");
+
+ // THIS ROUTINE IS FOR SAT.
+ vconf_set_int(VCONFKEY_IDLE_SCREEN_LAUNCHED, VCONFKEY_IDLE_SCREEN_LAUNCHED_TRUE);
+}
+
+
+
+void menu_daemon_fini(void)
+{
+ if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, _pkg_changed) < 0)
+ _E("Failed to ignore the callback for package change event");
+
+ if (vconf_ignore_key_changed(VCONFKEY_STARTER_SEQUENCE, _show_cb) < 0)
+ _E("Failed to ignore the callback for show event");
+
+ if (vconf_ignore_key_changed("db/setting/accessibility/font_name", _font_cb) < 0)
+ _E("Failed to ignore the callback for font event");
+
+ if (vconf_ignore_key_changed(VCONFKEY_SYSMAN_CRADLE_STATUS, _cradle_status_cb) < 0)
+ _E("Failed to ignore the callback for cradle status");
+
+ if (vconf_ignore_key_changed(VCONFKEY_PM_KEY_IGNORE, _pm_key_ignore_cb) < 0)
+ _E("Failed to ignore the callback for pm key ignore");
+
+ if (vconf_ignore_key_changed(VCONFKEY_SVOICE_PACKAGE_NAME, _svoice_pkg_cb) < 0)
+ _E("Failed to ignore the callback for svoice pkg");
+ if (s_info.svoice_pkg_name) free(s_info.svoice_pkg_name);
+
+ if (vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb) < 0)
+ _E("Failed to ignore the callback for power-off");
+
+ xmonitor_fini();
+ destroy_key_window();
+}
+
+
+
+// End of a file
diff --git a/src/pkg_event.c b/src/pkg_event.c
new file mode 100644
index 0000000..2eda1ee
--- /dev/null
+++ b/src/pkg_event.c
@@ -0,0 +1,313 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <ail.h>
+#include <errno.h>
+#include <Elementary.h>
+#include <Ecore.h>
+#include <Ecore_File.h>
+#include <stdio.h>
+#include <sys/inotify.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <vconf.h>
+
+#include "pkg_event.h"
+#include "util.h"
+
+
+#define CONF_FILE "/usr/share/install-info/desktop.conf"
+#define BUFSZE 1024
+
+
+extern int errno;
+struct inotify_path
+{
+ int wd;
+ char *path;
+};
+
+struct desktop_notifier s_desktop_notifier = {
+ .number = 0,
+ .ifd = 0,
+ .handler = NULL,
+};
+
+
+
+struct inotify_path paths[CONF_PATH_NUMBER];
+
+
+static Eina_Bool
+directory_notify(void* data, Ecore_Fd_Handler* fd_handler)
+{
+ char *buf;
+ ssize_t read_size, len, i = 0;
+ int fd;
+
+ fd = ecore_main_fd_handler_fd_get(fd_handler);
+ _D("There are some modification, ifd [%d]", fd);
+ if(fd < 0) {
+ _E("Failed to get fd");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (ioctl(fd, FIONREAD, &read_size) < 0) {
+ _E("Failed to get q size");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ if (read_size <= 0) {
+ _E("Buffer is not ready!!!");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ buf = malloc(read_size);
+ if (!buf) {
+ _E("Failed to allocate heap for event handling");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ memset(buf, 0, read_size);
+
+ len = read(fd, buf, read_size);
+ if (len < 0) {
+ free(buf);
+ // Stop monitoring about this invalid file descriptor
+ return ECORE_CALLBACK_CANCEL;
+ }
+ buf[read_size - 1] = '\0';
+
+ while (i < len) {
+ struct inotify_event* event = (struct inotify_event*) &buf[i];
+ char *str_potksed = "potksed.";
+ char *package = NULL;
+ ssize_t idx;
+ int nev_name;
+
+ // 1. check the extension of a file
+ nev_name = strlen(event->name) - 1;
+ for (idx = 0; nev_name >= 0 && str_potksed[idx]; idx++) {
+ if (event->name[nev_name] != str_potksed[idx]) {
+ break;
+ }
+ nev_name --;
+ }
+
+ if (str_potksed[idx] != '\0' || nev_name < 0) {
+ _SECURE_D("This is not a desktop file : %s", event->name);
+ i += sizeof(struct inotify_event) + event->len;
+ continue;
+ }
+
+ package = strdup(event->name);
+ break_if(NULL == package);
+
+ package[nev_name + 1] = '\0';
+ _SECURE_D("Package : %s", package);
+
+ // add & update
+ if (event->mask & IN_CLOSE_WRITE || event->mask & IN_MOVED_TO) { // for moving
+ ail_appinfo_h ai = NULL;
+ ail_error_e ret;
+
+ ret = ail_get_appinfo(package, &ai);
+ if (AIL_ERROR_OK == ret || AIL_ERROR_NO_DATA == ret) {
+ if (ai) ail_destroy_appinfo(ai);
+
+ if (AIL_ERROR_NO_DATA == ret) {
+ if (ail_desktop_add(package) < 0) {
+ _SECURE_D("Failed to add a new package (%s)", event->name);
+ }
+ } else if (AIL_ERROR_OK == ret) {
+ if (ail_desktop_update(package) < 0) {
+ _SECURE_D("Failed to add a new package (%s)", event->name);
+ }
+ }
+ } else {
+ _E("Failed to get appinfo");
+ }
+ } else if (event->mask & IN_DELETE) { // for deleting
+ if (ail_desktop_remove(package) < 0)
+ _SECURE_D("Failed to remove a package (%s)", event->name);
+ } else {
+ _D("this event is not dealt with inotify");
+ }
+
+ free(package);
+
+ i += sizeof(struct inotify_event) + event->len;
+ }
+
+ free(buf);
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+static inline char *_ltrim(char *str)
+{
+ retv_if(NULL == str, NULL);
+ while (*str && (*str == ' ' || *str == '\t' || *str == '\n')) str ++;
+ return str;
+}
+
+
+
+static inline int _rtrim(char *str)
+{
+ int len;
+
+ retv_if(NULL == str, 0);
+
+ len = strlen(str);
+ while (--len >= 0 && (str[len] == ' ' || str[len] == '\n' || str[len] == '\t')) {
+ str[len] = '\0';
+ }
+
+ return len;
+}
+
+
+
+static int _retrieve_conf_path(struct inotify_path* paths)
+{
+ char *line = NULL;
+ FILE *fp;
+ size_t size = 0;
+ ssize_t read;
+ int i = 0;
+
+ fp = fopen(CONF_FILE, "r");
+ if (NULL == fp) {
+ _E(CONF_FILE);
+ return -1;
+ }
+
+ while ((read = getline(&line, &size, fp)) != -1 && i < CONF_PATH_NUMBER - 1) {
+ char *begin;
+
+ if (size <= 0) break;
+
+ begin = _ltrim(line);
+ _rtrim(line);
+
+ if (*begin == '#' || *begin == '\0') continue;
+
+ paths[i].path = strdup(begin);
+ i++;
+ }
+
+ if (line) free(line);
+ paths[i].path = NULL;
+ fclose(fp);
+
+ return i;
+}
+
+
+
+static void _unretrieve_conf_path(struct inotify_path* paths, int number)
+{
+ register int i;
+
+ for (i = 0; i < number; i ++) {
+ if (paths[i].path) {
+ free(paths[i].path);
+ paths[i].path = NULL;
+ }
+ }
+}
+
+
+
+void pkg_event_init()
+{
+ int wd = 0;
+ int i;
+
+ s_desktop_notifier.ifd = inotify_init();
+ if (s_desktop_notifier.ifd == -1) {
+ _E("inotify_init error: %s", strerror(errno));
+ return;
+ }
+
+ s_desktop_notifier.number = _retrieve_conf_path(paths);
+
+ for (i = 0; i < CONF_PATH_NUMBER && paths[i].path; i++)
+ {
+ _D("Configuration file for desktop file monitoring [%s] is added", paths[i].path);
+ if (access(paths[i].path, R_OK) != 0)
+ {
+ ecore_file_mkpath(paths[i].path);
+ if (chmod(paths[i].path, 0777) == -1) {
+ _E("cannot chmod %s", paths[i].path);
+ }
+ }
+
+ wd = inotify_add_watch(s_desktop_notifier.ifd, paths[i].path, IN_CLOSE_WRITE | IN_MOVED_TO | IN_DELETE);
+ if (wd == -1) {
+ _E("inotify_add_watch error: %s", strerror(errno));
+ close(s_desktop_notifier.ifd);
+ return;
+ }
+
+ paths[i].wd = wd;
+ }
+
+ s_desktop_notifier.handler = ecore_main_fd_handler_add(s_desktop_notifier.ifd, ECORE_FD_READ, directory_notify, NULL, NULL, NULL);
+ if (!s_desktop_notifier.handler) {
+ // TODO: Handles me.. EXCEPTION!!
+ _E("cannot add handler for inotify");
+ }
+}
+
+
+
+void pkg_event_fini(void)
+{
+ register int i;
+
+ if (s_desktop_notifier.handler) {
+ ecore_main_fd_handler_del(s_desktop_notifier.handler);
+ }
+
+ for (i = 0; i < CONF_PATH_NUMBER; i ++) {
+ if (paths[i].wd) {
+ if (inotify_rm_watch(s_desktop_notifier.ifd, paths[i].wd) < 0) {
+ _E("Error: %s", strerror(errno));
+ }
+ paths[i].wd = 0;
+ }
+ }
+
+ _unretrieve_conf_path(paths, s_desktop_notifier.number);
+
+ if (s_desktop_notifier.ifd) {
+ close(s_desktop_notifier.ifd);
+ s_desktop_notifier.ifd = 0;
+ }
+}
+
+
+// End of a file
diff --git a/src/starter.c b/src/starter.c
new file mode 100644
index 0000000..1be63e4
--- /dev/null
+++ b/src/starter.c
@@ -0,0 +1,312 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Elementary.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <poll.h>
+#include <errno.h>
+#include <string.h>
+
+#include <vconf.h>
+#include <signal.h>
+
+#include "starter.h"
+#include "starter-util.h"
+#include "x11.h"
+#include "lockd-debug.h"
+#include "hw_key.h"
+#include "util.h"
+
+int errno;
+
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "org.tizen.starter"
+#endif
+
+#define DEFAULT_THEME "tizen"
+
+#define W_LAUNCHER_PKGNAME "org.tizen.w-launcher-app"
+#define W_LOCKSCREEN_PKGNAME "org.tizen.w-lockscreen"
+
+#ifdef FEATURE_TIZENW2
+#define SETUP_WIZARD_PKGNAME "org.tizen.b2-setup-wizard"
+#else
+#define SETUP_WIZARD_PKGNAME "org.tizen.b2-setup-wizard"
+#endif
+
+
+static void _signal_handler(int signum, siginfo_t *info, void *unused)
+{
+ _DBG("_signal_handler : Terminated...");
+ elm_exit();
+}
+
+int w_launch_app(char *pkgname, bundle *b)
+{
+ int r = AUL_R_OK;
+
+ _SECURE_D("w_launch_app:[%s]", pkgname);
+
+ r = aul_launch_app(pkgname, b);
+
+ if (r < 0) {
+ _ERR("launch failed [%s] ret=[%d]", pkgname, r);
+ }
+
+ return r;
+}
+
+static int _w_app_dead_cb(int pid, void *data)
+{
+ _DBG("app dead cb call! (pid : %d)", pid);
+
+ struct appdata *ad = (struct appdata *)data;
+
+ if (pid == ad->launcher_pid) {
+ _ERR("w-launcher-app (pid:%d) is destroyed.", pid);
+ ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
+ }
+
+ return 0;
+}
+
+static int _w_check_first_boot(void)
+{
+ int is_first = 0;
+ int ret = 0;
+
+#if 1 // NOT YET define vconfkey from setting "VCONFKEY_SETUP_WIZARD_FIRST_BOOT"
+ ret = vconf_get_bool(VCONFKEY_SETUP_WIZARD_FIRST_BOOT, &is_first);
+ if (ret < 0){
+ _ERR("can't get vconfkey value of [%s], ret=[%d]", VCONFKEY_SETUP_WIZARD_FIRST_BOOT, ret);
+ is_first = 0;
+ } else if (is_first == 1) {
+ _ERR("[%s] value is [%d], first booting..!!", VCONFKEY_SETUP_WIZARD_FIRST_BOOT, is_first);
+ }
+#endif
+
+ return is_first;
+}
+
+static Eina_Bool _w_starter_idler_cb(void *data)
+{
+ struct appdata *ad = (struct appdata *)data;
+
+ _DBG("%s, %d", __func__, __LINE__);
+
+ ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+#define TEMP_VCONFKEY_LOCK_TYPE "db/setting/lock_type"
+static void _w_wms_changed_cb(keynode_t* node, void *data)
+{
+ int wms_state = -1;
+ int lock_type = -1;
+ int test_mode = -1;
+ struct appdata *ad = (struct appdata *)data;
+
+ _DBG("%s, %d", __func__, __LINE__);
+
+ if (node) {
+ wms_state = vconf_keynode_get_bool(node);
+ } else {
+ if (vconf_get_bool(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_state) < 0) {
+ _ERR("Failed to get %s", VCONFKEY_WMS_WMANAGER_CONNECTED);
+ return;
+ }
+ }
+ _DBG("WMS key value:[%d], previous state:[%d]", wms_state, ad->wms_connected);
+
+ vconf_get_int(TEMP_VCONFKEY_LOCK_TYPE, &lock_type);
+ vconf_get_int(VCONFKEY_TESTMODE_SCREEN_LOCK, &test_mode);
+
+ if ((lock_type != 1) || (test_mode == VCONFKEY_TESTMODE_SCREEN_LOCK_DISABLE)) {
+ ad->wms_connected = wms_state;
+ return;
+ }
+
+ if (wms_state == FALSE) {
+ if (ad->wms_connected == TRUE) {
+ _ERR("WMS connect state is changed from [%d] to [%d]", ad->wms_connected, wms_state);
+ w_launch_app(W_LOCKSCREEN_PKGNAME, NULL);
+ }
+ }
+ ad->wms_connected = wms_state;
+
+ return;
+}
+
+static void _w_power_off_cb(keynode_t* node, void *data)
+{
+ int val = VCONFKEY_SYSMAN_POWER_OFF_NONE;
+
+ vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val);
+
+ if (val > VCONFKEY_SYSMAN_POWER_OFF_POPUP) {
+ _ERR("power off status : %d", val);
+ if (vconf_ignore_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, _w_wms_changed_cb) < 0)
+ _ERR("Failed to ignore the callback for [%s]", VCONFKEY_WMS_WMANAGER_CONNECTED);
+ exit(0);
+ }
+}
+
+static void _w_lang_changed_cb(keynode_t* node, void *data)
+{
+ char *locale = NULL;
+ _DBG("%s, %d", __func__, __LINE__);
+
+ locale = vconf_get_str(VCONFKEY_LANGSET);
+
+ if (locale != NULL) {
+ elm_language_set(locale);
+ }
+}
+
+//TO DO. later remove this definition after applying DB structure
+#define LAUNCHER_XML_PATH "/opt/usr/share/w-launcher"
+static void _init(struct appdata *ad)
+{
+ int r;
+ struct sigaction act;
+ char *file = NULL;
+ int first = -1;
+ int lock_type = -1;
+ int wms_state = -1;
+ int test_mode = -1;
+
+ memset(&act,0x00,sizeof(struct sigaction));
+ act.sa_sigaction = _signal_handler;
+ act.sa_flags = SA_SIGINFO;
+
+ int ret = sigemptyset(&act.sa_mask);
+ if (ret < 0) {
+ _ERR("Failed to sigemptyset[%s]", strerror(errno));
+ }
+ ret = sigaddset(&act.sa_mask, SIGTERM);
+ if (ret < 0) {
+ _ERR("Failed to sigaddset[%s]", strerror(errno));
+ }
+ ret = sigaction(SIGTERM, &act, NULL);
+ if (ret < 0) {
+ _ERR("Failed to sigaction[%s]", strerror(errno));
+ }
+
+ memset(ad, 0, sizeof(struct appdata));
+
+ gettimeofday(&ad->tv_start, NULL);
+ aul_launch_init(NULL,NULL);
+
+ aul_listen_app_dead_signal(_w_app_dead_cb, ad);
+
+ //TO DO. later remove this after applying DB structure
+ if (chmod(LAUNCHER_XML_PATH, 0777) < 0) {
+ _ERR("chmod: %s\n", strerror(errno));
+ }
+
+ if (vconf_notify_key_changed(VCONFKEY_LANGSET, _w_lang_changed_cb, NULL) < 0) {
+ _ERR("Failed to add the callback for [%s]", VCONFKEY_LANGSET);
+ }
+
+ if (vconf_notify_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, _w_wms_changed_cb, ad) < 0) {
+ _ERR("Failed to add the callback for %s changed", VCONFKEY_WMS_WMANAGER_CONNECTED);
+ }
+ if (vconf_get_bool(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_state) < 0) {
+ _ERR("Failed to get [%s]", VCONFKEY_WMS_WMANAGER_CONNECTED);
+ } else {
+ ad->wms_connected = wms_state;
+ _DBG("ad->wms_connected : [%d]", ad->wms_connected);
+ }
+
+ if (_w_check_first_boot() == TRUE) {
+ w_launch_app(SETUP_WIZARD_PKGNAME, NULL);
+ ecore_idler_add(_w_starter_idler_cb, ad);
+ } else {
+ _DBG("Not first booting, launch [%s]..!!", W_LAUNCHER_PKGNAME);
+
+ vconf_get_int(VCONFKEY_TESTMODE_SCREEN_LOCK, &test_mode);
+ vconf_get_int(TEMP_VCONFKEY_LOCK_TYPE, &lock_type);
+
+ if ((wms_state == FALSE) && (lock_type == 1) && (test_mode != VCONFKEY_TESTMODE_SCREEN_LOCK_DISABLE)) {
+ _ERR("BT disconneted and privacy lock is set");
+ w_launch_app(W_LOCKSCREEN_PKGNAME, NULL);
+ ecore_idler_add(_w_starter_idler_cb, ad);
+ } else {
+ ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
+ }
+ }
+
+ create_key_window();
+ init_hourly_alert(ad);
+
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, _w_power_off_cb, NULL) < 0)
+ _ERR("Failed to add the callback for [%s]", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+
+ return;
+}
+
+static void _fini(struct appdata *ad)
+{
+ struct timeval tv, res;
+
+ if (ad == NULL) {
+ fprintf(stderr, "Invalid argument: appdata is NULL\n");
+ return;
+ }
+
+ destroy_key_window();
+ fini_hourly_alert(ad);
+
+ gettimeofday(&tv, NULL);
+ timersub(&tv, &ad->tv_start, &res);
+ _DBG("Total time: %d.%06d sec\n", (int)res.tv_sec, (int)res.tv_usec);
+}
+
+int main(int argc, char *argv[])
+{
+ struct appdata ad;
+
+ WRITE_FILE_LOG("%s", "Main function is started in starter");
+ _DBG("starter is launched..!!");
+#if 0
+ set_window_scale(); /* not in loop */
+#endif
+
+ elm_init(argc, argv);
+
+ _init(&ad);
+
+ elm_run();
+
+ _fini(&ad);
+
+ elm_shutdown();
+
+ return 0;
+}
diff --git a/src/virtual_canvas.c b/src/virtual_canvas.c
new file mode 100644
index 0000000..bde26c3
--- /dev/null
+++ b/src/virtual_canvas.c
@@ -0,0 +1,139 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Elementary.h>
+#include <Ecore_Evas.h>
+#include <Ecore_X.h>
+#include <dlog.h>
+
+#include "util.h"
+#include "virtual_canvas.h"
+
+#define QUALITY_N_COMPRESS "quality=100 compress=1"
+
+
+
+Evas *virtual_canvas_create(int w, int h)
+{
+ Ecore_Evas *internal_ee;
+ Evas *internal_e;
+
+ // Create virtual canvas
+ internal_ee = ecore_evas_buffer_new(w, h);
+ if (!internal_ee) {
+ _D("Failed to create a new canvas buffer\n");
+ return NULL;
+ }
+
+ ecore_evas_alpha_set(internal_ee, EINA_TRUE);
+ ecore_evas_manual_render_set(internal_ee, EINA_TRUE);
+
+ // Get the "Evas" object from a virtual canvas
+ internal_e = ecore_evas_get(internal_ee);
+ if (!internal_e) {
+ ecore_evas_free(internal_ee);
+ _D("Faield to get Evas object\n");
+ return NULL;
+ }
+
+ return internal_e;
+}
+
+
+
+static bool _flush_data_to_file(Evas *e, char *data, const char *filename, int w, int h)
+{
+ Evas_Object *output;
+
+ output = evas_object_image_add(e);
+ if (!output) {
+ _D("Failed to create an image object\n");
+ return false;
+ }
+
+ evas_object_image_data_set(output, NULL);
+ evas_object_image_colorspace_set(output, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_alpha_set(output, EINA_TRUE);
+ evas_object_image_size_set(output, w, h);
+ evas_object_image_smooth_scale_set(output, EINA_TRUE);
+ evas_object_image_data_set(output, data);
+ evas_object_image_data_update_add(output, 0, 0, w, h);
+
+ if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
+ evas_object_del(output);
+ _SECURE_D("Faield to save a captured image (%s)\n", filename);
+ return false;
+ }
+
+ evas_object_del(output);
+
+ if (access(filename, F_OK) != 0) {
+ _SECURE_D("File %s is not found\n", filename);
+ return false;
+ }
+
+ return true;
+}
+
+
+
+bool virtual_canvas_flush_to_file(Evas *e, const char *filename, int w, int h)
+{
+ void *data;
+ Ecore_Evas *internal_ee;
+
+ internal_ee = ecore_evas_ecore_evas_get(e);
+ if (!internal_ee) {
+ _D("Failed to get ecore evas\n");
+ return false;
+ }
+
+ ecore_evas_manual_render(internal_ee);
+
+ // Get a pointer of a buffer of the virtual canvas
+ data = (void *) ecore_evas_buffer_pixels_get(internal_ee);
+ if (!data) {
+ _D("Failed to get pixel data\n");
+ return false;
+ }
+
+ return _flush_data_to_file(e, data, filename, w, h);
+}
+
+
+
+bool virtual_canvas_destroy(Evas *e)
+{
+ Ecore_Evas *ee;
+
+ ee = ecore_evas_ecore_evas_get(e);
+ if (!ee) {
+ _D("Failed to ecore evas object\n");
+ return false;
+ }
+
+ ecore_evas_free(ee);
+ return true;
+}
+
+
+
+// End of a file
diff --git a/src/x11.c b/src/x11.c
new file mode 100644
index 0000000..820f4a2
--- /dev/null
+++ b/src/x11.c
@@ -0,0 +1,114 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define DEFAULT_WINDOW_H 1280
+
+void prop_string_set(const char *name, const char *value)
+{
+ Display *d;
+ Atom a_name;
+ Atom a_UTF8;
+ XTextProperty xtp;
+
+ if (name == NULL || value == NULL || value[0] == '\0')
+ return;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_name = XInternAtom(d, name, False);
+ if (a_name == None)
+ goto exit;
+
+ a_UTF8 = XInternAtom(d, "UTF8_STRING", False);
+ if (a_UTF8 == None)
+ goto exit;
+
+ xtp.value = (unsigned char *)value;
+ xtp.format = 8;
+ xtp.encoding = a_UTF8;
+ xtp.nitems = strlen(value);
+
+ XSetTextProperty(d, DefaultRootWindow(d), &xtp, a_name);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+void prop_int_set(const char *name, unsigned int val)
+{
+ Display *d;
+ Atom a_name;
+
+ if (name == NULL)
+ return;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_name = XInternAtom(d, name, False);
+ if (a_name == None)
+ goto exit;
+
+ XChangeProperty(d, DefaultRootWindow(d), a_name, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&val, 1);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+void set_window_scale(void)
+{
+ double root_width = 0.0, root_height = 0.0;
+ char buf[128] = { 0, };
+ Display *disp;
+ int screen_num;
+
+ disp = XOpenDisplay(NULL);
+ if (disp == NULL)
+ return;
+
+ screen_num = DefaultScreen(disp);
+
+ root_width = DisplayWidth(disp, screen_num);
+ root_height = DisplayHeight(disp, screen_num);
+
+ XCloseDisplay(disp);
+
+ snprintf(buf, sizeof(buf), "%lf", root_height / DEFAULT_WINDOW_H);
+
+ if (root_width == 800 && root_height == 1280) {
+ snprintf(buf, sizeof(buf), "0.71");
+ }
+
+ setenv("ELM_SCALE", buf, 1);
+ setenv("SCALE_FACTOR", buf, 1);
+}
diff --git a/src/xmonitor.c b/src/xmonitor.c
new file mode 100644
index 0000000..c889798
--- /dev/null
+++ b/src/xmonitor.c
@@ -0,0 +1,332 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <ail.h>
+#include <aul.h>
+#include <dlog.h>
+#include <Ecore.h>
+#include <Ecore_X.h>
+#include <Evas.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/shm.h>
+#include <vconf.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/extensions/Xcomposite.h>
+#include <X11/extensions/XShm.h>
+
+#include "menu_daemon.h"
+#include "util.h"
+#include "virtual_canvas.h"
+#include "starter-util.h"
+#include "xmonitor.h"
+
+#define PACKAGE_LEN 1024
+
+
+
+static struct info {
+ Ecore_Event_Handler *create_handler;
+ Ecore_Event_Handler *destroy_handler;
+ Ecore_Event_Handler *focus_in_handler;
+ Ecore_Event_Handler *focus_out_handler;
+ Ecore_Timer *make_file_timer;
+ int is_top;
+} xmonitor_info = {
+ .create_handler = NULL,
+ .destroy_handler = NULL,
+ .focus_in_handler = NULL,
+ .focus_out_handler = NULL,
+ .make_file_timer = NULL,
+ .is_top = VCONFKEY_IDLE_SCREEN_TOP_FALSE,
+};
+
+
+
+int errno;
+
+
+
+static inline int _get_pid(Ecore_X_Window win)
+{
+ int pid;
+ Ecore_X_Atom atom;
+ unsigned char *in_pid = NULL;
+ int num;
+
+ atom = ecore_x_atom_get("X_CLIENT_PID");
+ if (ecore_x_window_prop_property_get(win, atom, ECORE_X_ATOM_CARDINAL,
+ sizeof(int), &in_pid, &num) == EINA_FALSE) {
+ if(in_pid != NULL) {
+ free(in_pid);
+ in_pid = NULL;
+ }
+ if (ecore_x_netwm_pid_get(win, &pid) == EINA_FALSE) {
+ _E("Failed to get PID from a window 0x%X", win);
+ return -EINVAL;
+ }
+ } else {
+ pid = *(int *)in_pid;
+ free(in_pid);
+ }
+
+ return pid;
+}
+
+
+
+#define VCONFKEY_IDLE_SCREEN_FOCUSED_PACKAGE "memory/idle-screen/focused_package"
+#define BUFSZE 1024
+bool _set_idlescreen_top(Ecore_X_Window win)
+{
+ int ret;
+
+ if (!win) win = ecore_x_window_focus_get();
+
+ int focused_pid;
+ focused_pid = _get_pid(win);
+ retv_if(focused_pid <= 0, false);
+
+ do { // Set the focused package into the vconf key.
+ char pkgname[BUFSZE];
+ if (AUL_R_OK == aul_app_get_pkgname_bypid(focused_pid, pkgname, sizeof(pkgname))) {
+ if (strcmp(APP_TRAY_PKG_NAME, pkgname)) {
+ ret = vconf_set_str(VCONFKEY_IDLE_SCREEN_FOCUSED_PACKAGE, pkgname);
+ _SECURE_D("Try to set the vconfkey[%s] as [%s]", VCONFKEY_IDLE_SCREEN_FOCUSED_PACKAGE, pkgname);
+ if (0 != ret) {
+ _E("cannot set string for FOCUSED_WINDOW");
+ }
+ }
+ } else _D("cannot get pkgname from pid[%d]", focused_pid);
+ } while (0);
+
+ do { // Set the vconf key whether the idle-screen is top or not.
+ int is_top;
+ is_top = menu_daemon_is_homescreen(focused_pid)?
+ VCONFKEY_IDLE_SCREEN_TOP_TRUE : VCONFKEY_IDLE_SCREEN_TOP_FALSE;
+ if (is_top != xmonitor_info.is_top) {
+ ret = vconf_set_int(VCONFKEY_IDLE_SCREEN_TOP, is_top);
+ retv_if(0 != ret, false);
+ xmonitor_info.is_top = is_top;
+ _D("set the key of idlescreen_is_top as %d", is_top);
+ }
+ } while (0);
+
+ return true;
+}
+
+
+
+#define TIMER_AFTER_LAUNCHING 5.0f
+static Eina_Bool _create_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Create *info = event;
+
+ _D("Create a window[%x]", info->win);
+
+ ecore_x_window_client_sniff(info->win);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _destroy_cb(void *data, int type, void *event)
+{
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _focus_in_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Focus_In *info = event;
+
+ _D("Focus in a window[%x]", info->win);
+
+ retv_if(false == _set_idlescreen_top(info->win), ECORE_CALLBACK_PASS_ON);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static Eina_Bool _focus_out_cb(void *data, int type, void *event)
+{
+ Ecore_X_Event_Window_Focus_Out *info = event;
+
+ _D("Focus out a window[%x]", info->win);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
+static inline void _sniff_all_windows(void)
+{
+ Ecore_X_Window root;
+ Ecore_X_Window ret;
+ struct stack_item *new_item;
+ struct stack_item *item;
+ Eina_List *win_stack = NULL;
+ struct stack_item {
+ Ecore_X_Window *wins;
+ int nr_of_wins;
+ int i;
+ };
+
+ root = ecore_x_window_root_first_get();
+ ecore_x_window_sniff(root);
+
+ new_item = malloc(sizeof(*new_item));
+ if (!new_item) {
+ _E("Error(%s)\n", strerror(errno));
+ return;
+ }
+
+ new_item->nr_of_wins = 0;
+ new_item->wins =
+ ecore_x_window_children_get(root, &new_item->nr_of_wins);
+ new_item->i = 0;
+
+ if (new_item->wins)
+ win_stack = eina_list_append(win_stack, new_item);
+ else
+ free(new_item);
+
+ while ((item = eina_list_nth(win_stack, 0))) {
+ win_stack = eina_list_remove(win_stack, item);
+
+ if (!item->wins) {
+ free(item);
+ continue;
+ }
+
+ while (item->i < item->nr_of_wins) {
+ ret = item->wins[item->i];
+
+ /*
+ * Now we don't need to care about visibility of window,
+ * just check whether it is registered or not.
+ * (ecore_x_window_visible_get(ret))
+ */
+ ecore_x_window_client_sniff(ret);
+
+ new_item = malloc(sizeof(*new_item));
+ if (!new_item) {
+ _E("Error %s\n", strerror(errno));
+ item->i++;
+ continue;
+ }
+
+ new_item->i = 0;
+ new_item->nr_of_wins = 0;
+ new_item->wins =
+ ecore_x_window_children_get(ret,
+ &new_item->nr_of_wins);
+ if (new_item->wins) {
+ win_stack =
+ eina_list_append(win_stack, new_item);
+ } else {
+ free(new_item);
+ }
+
+ item->i++;
+ }
+
+ free(item->wins);
+ free(item);
+ }
+
+ return;
+}
+
+
+
+int xmonitor_init(void)
+{
+ if (ecore_x_composite_query() == EINA_FALSE)
+ _D("====> COMPOSITOR IS NOT ENABLED");
+
+ xmonitor_info.create_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, _create_cb, NULL);
+ goto_if(NULL == xmonitor_info.create_handler, Error);
+
+ xmonitor_info.destroy_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _destroy_cb, NULL);
+ goto_if(NULL == xmonitor_info.destroy_handler, Error);
+
+ xmonitor_info.focus_in_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _focus_in_cb, NULL);
+ goto_if(NULL == xmonitor_info.focus_in_handler, Error);
+
+ xmonitor_info.focus_out_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _focus_out_cb, NULL);
+ goto_if(NULL == xmonitor_info.focus_out_handler, Error);
+
+ _sniff_all_windows();
+ if (false == _set_idlescreen_top(0)) _E("cannot set idlescreen_is_top");
+
+ return 0;
+
+Error:
+ if (xmonitor_info.create_handler) {
+ ecore_event_handler_del(xmonitor_info.create_handler);
+ xmonitor_info.create_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.destroy_handler) {
+ ecore_event_handler_del(xmonitor_info.destroy_handler);
+ xmonitor_info.destroy_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.focus_in_handler) {
+ ecore_event_handler_del(xmonitor_info.focus_in_handler);
+ xmonitor_info.focus_in_handler = NULL;
+ } else return -EFAULT;
+
+ if (xmonitor_info.focus_out_handler) {
+ ecore_event_handler_del(xmonitor_info.focus_out_handler);
+ xmonitor_info.focus_out_handler = NULL;
+ } else return -EFAULT;
+
+ return -EFAULT;
+}
+
+void xmonitor_fini(void)
+{
+ ecore_event_handler_del(xmonitor_info.create_handler);
+ xmonitor_info.create_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.destroy_handler);
+ xmonitor_info.destroy_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.focus_in_handler);
+ xmonitor_info.focus_in_handler = NULL;
+
+ ecore_event_handler_del(xmonitor_info.focus_out_handler);
+ xmonitor_info.focus_out_handler = NULL;
+}
+
+/* End of a file */
diff --git a/starter b/starter
new file mode 100644
index 0000000..be8ba25
--- /dev/null
+++ b/starter
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+CURRENT_RUNLEVEL=`basename $PWD`
+# CURRENT_RUNLEVEL could be "rc3.d" or "rc4.d"
+
+if [ x"$CURRENT_RUNLEVEL" == x"rc3.d" ]; then
+ while [ ! -f /tmp/.wm_ready ];
+ do
+ sleep 0.1
+ done
+fi
+
+/usr/bin/starter &
+
+
diff --git a/starter.desktop.in b/starter.desktop.in
new file mode 100644
index 0000000..f2a89f3
--- /dev/null
+++ b/starter.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@PROJECT_NAME@
+Exec=@BINDIR@/@PROJECT_NAME@
+Icon=elementary
+Terminal=false
+Type=Application
+Categories=Application;Utility;
+
diff --git a/starter.manifest b/starter.manifest
new file mode 100644
index 0000000..98ccdb5
--- /dev/null
+++ b/starter.manifest
@@ -0,0 +1,27 @@
+<manifest>
+ <define>
+ <domain name="starter"/>
+ <request>
+ <smack request="sys-assert::core" type="rwxat"/>
+ <smack request="system::homedir" type="rwxat"/>
+ <smack request="system::vconf" type="rwxat"/>
+ <smack request="system::media" type="rwxat"/>
+ <smack request="system::share" type="rwxat"/>
+ <smack request="pulseaudio" type="rwxat"/>
+ <smack request="alarm-server::alarm" type="w"/>
+ <smack request="aul::terminate" type="x"/>
+ <smack request="aul::launch" type="x"/>
+ </request>
+ <provide>
+ <label name="starter::vconf"/>
+ </provide>
+ </define>
+ <request>
+ <domain name="starter"/>
+ </request>
+ <assign>
+ <filesystem path="/usr/bin/starter" label="starter" exec_label="starter" />
+ <filesystem path="/etc/init.d/rd3starter" label="_" exec_label="none" />
+ <filesystem path="/etc/init.d/rd4starter" label="_" exec_label="none" />
+ </assign>
+</manifest>
diff --git a/starter.rule b/starter.rule
new file mode 100644
index 0000000..b2dfebf
--- /dev/null
+++ b/starter.rule
@@ -0,0 +1,6 @@
+starter system::homedir rwxat
+starter system::vconf rwxat
+starter system::media rwxat
+starter system::share rwxat
+starter pulseaudio rwxat
+dbus starter rx
diff --git a/test/get_entry.c b/test/get_entry.c
new file mode 100755
index 0000000..6a69348
--- /dev/null
+++ b/test/get_entry.c
@@ -0,0 +1,92 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+int main(int argc, char *argv[])
+{
+ unsigned char *prop_ret;
+ Atom type_ret;
+ unsigned long bytes_after, num_ret;
+ int format_ret;
+ unsigned int i;
+ int num;
+
+ Display *d;
+ Atom a_ac;
+ Atom a_ap;
+ Status r;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL) {
+ printf("Display open error\n");
+ return 1;
+ }
+
+ a_ac = XInternAtom(d, "ENLIGHTENMENT_AUTOCAPITAL_ALLOW", False);
+ if (a_ac == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetWindowProperty(d, DefaultRootWindow(d), a_ac, 0, 0x7fffffff,
+ False, XA_CARDINAL, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if (r != Success) {
+ printf("XGetWindowProperty error\n");
+ goto exit;
+ }
+
+ if (type_ret == XA_CARDINAL && format_ret == 32 && num_ret > 0
+ && prop_ret) {
+ printf("Auto capital: %lu\n", ((unsigned long *)prop_ret)[0]);
+ }
+ if (prop_ret)
+ XFree(prop_ret);
+
+ a_ap = XInternAtom(d, "ENLIGHTENMENT_AUTOPERIOD_ALLOW", False);
+ if (a_ap == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetWindowProperty(d, DefaultRootWindow(d), a_ap, 0, 0x7fffffff,
+ False, XA_CARDINAL, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if (r != Success) {
+ printf("XGetWindowProperty error\n");
+ goto exit;
+ }
+
+ if (type_ret == XA_CARDINAL && format_ret == 32 && num_ret > 0
+ && prop_ret) {
+ printf("Auto period: %lu\n", ((unsigned long *)prop_ret)[0]);
+ }
+ if (prop_ret)
+ XFree(prop_ret);
+
+ exit:
+ XCloseDisplay(d);
+ return 0;
+}
diff --git a/test/get_theme.c b/test/get_theme.c
new file mode 100755
index 0000000..afc4947
--- /dev/null
+++ b/test/get_theme.c
@@ -0,0 +1,59 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+int main(int argc, char *argv[])
+{
+ XTextProperty xtp;
+ Display *d;
+ Atom a_e17;
+ Status r;
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL) {
+ printf("Display open error\n");
+ return 1;
+ }
+
+ a_e17 = XInternAtom(d, "ENLIGHTENMENT_THEME", False);
+ if (a_e17 == None) {
+ printf("XInternAtom error\n");
+ goto exit;
+ }
+
+ r = XGetTextProperty(d, DefaultRootWindow(d), &xtp, a_e17);
+ if (!r) {
+ printf("XGetTextProperty error\n");
+ goto exit;
+ }
+
+ printf("THEME: [%s]\n", (char *)xtp.value);
+
+ XFree(xtp.value);
+
+ exit:
+ XCloseDisplay(d);
+ return 0;
+}
diff --git a/test/set_theme.c b/test/set_theme.c
new file mode 100755
index 0000000..3d45966
--- /dev/null
+++ b/test/set_theme.c
@@ -0,0 +1,65 @@
+/*
+ * starter
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+void set_elm_theme(void)
+{
+ char *theme;
+ Display *d;
+ Atom a_e17;
+ Atom a_UTF8;
+ XTextProperty xtp;
+
+ theme = "beat:kessler";
+
+ d = XOpenDisplay(NULL);
+ if (d == NULL)
+ return;
+
+ a_e17 = XInternAtom(d, "ENLIGHTENMENT_THEME", False);
+ if (a_e17 == None)
+ goto exit;
+
+ a_UTF8 = XInternAtom(d, "UTF8_STRING", False);
+ if (a_UTF8 == None)
+ goto exit;
+
+ xtp.value = (unsigned char *)theme;
+ xtp.format = 8;
+ xtp.encoding = a_UTF8;
+ xtp.nitems = strlen(theme);
+
+ XSetTextProperty(d, DefaultRootWindow(d), &xtp, a_e17);
+
+ exit:
+ XCloseDisplay(d);
+}
+
+int main(int argc, char *argv[])
+{
+ set_elm_theme();
+ return 0;
+}