Tizen 2.1 base
authorJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:38:36 +0000 (01:38 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:38:36 +0000 (01:38 +0900)
82 files changed:
AUTHORS [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
LICENSE.APLv2 [new file with mode: 0644]
NOTICE [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/usb-server.install.in [new file with mode: 0644]
debian/usb-server.postinst.in [new file with mode: 0644]
include/um_common.h [new file with mode: 0644]
include/um_customize.h [new file with mode: 0644]
include/um_data.h [new file with mode: 0644]
include/um_main.h [new file with mode: 0644]
include/um_usb_accessory_manager.h [new file with mode: 0644]
include/um_usb_connection_manager.h [new file with mode: 0644]
include/um_usb_host_manager.h [new file with mode: 0644]
include/um_usb_server.h [new file with mode: 0644]
packaging/usb-manager.spec [new file with mode: 0644]
packaging/usb-server.manifest [new file with mode: 0644]
po/CMakeLists.txt [new file with mode: 0644]
po/ar.po [new file with mode: 0755]
po/az.po [new file with mode: 0755]
po/bg.po [new file with mode: 0755]
po/ca.po [new file with mode: 0755]
po/cs.po [new file with mode: 0755]
po/da.po [new file with mode: 0755]
po/de_DE.po [new file with mode: 0755]
po/el_GR.po [new file with mode: 0755]
po/en.po [new file with mode: 0755]
po/en_PH.po [new file with mode: 0755]
po/en_US.po [new file with mode: 0755]
po/es_ES.po [new file with mode: 0755]
po/es_US.po [new file with mode: 0755]
po/et.po [new file with mode: 0755]
po/eu.po [new file with mode: 0755]
po/fi.po [new file with mode: 0755]
po/fr_CA.po [new file with mode: 0755]
po/fr_FR.po [new file with mode: 0755]
po/ga.po [new file with mode: 0755]
po/gl.po [new file with mode: 0755]
po/hi.po [new file with mode: 0755]
po/hr.po [new file with mode: 0755]
po/hu.po [new file with mode: 0755]
po/hy.po [new file with mode: 0755]
po/is.po [new file with mode: 0755]
po/it_IT.po [new file with mode: 0755]
po/ja_JP.po [new file with mode: 0755]
po/ka.po [new file with mode: 0755]
po/kk.po [new file with mode: 0755]
po/ko_KR.po [new file with mode: 0755]
po/lt.po [new file with mode: 0755]
po/lv.po [new file with mode: 0755]
po/mk.po [new file with mode: 0755]
po/nb.po [new file with mode: 0755]
po/nl_NL.po [new file with mode: 0755]
po/pl.po [new file with mode: 0755]
po/pt_BR.po [new file with mode: 0755]
po/pt_PT.po [new file with mode: 0755]
po/ro.po [new file with mode: 0755]
po/ru_RU.po [new file with mode: 0755]
po/sk.po [new file with mode: 0755]
po/sl.po [new file with mode: 0755]
po/sr.po [new file with mode: 0755]
po/sv.po [new file with mode: 0755]
po/tr_TR.po [new file with mode: 0755]
po/uk.po [new file with mode: 0755]
po/uz.po [new file with mode: 0755]
po/zh_CN.po [new file with mode: 0755]
po/zh_HK.po [new file with mode: 0755]
po/zh_SG.po [new file with mode: 0755]
po/zh_TW.po [new file with mode: 0755]
set_usb_debug.sh [new file with mode: 0755]
src/um_common.c [new file with mode: 0644]
src/um_customize.c [new file with mode: 0644]
src/um_main.c [new file with mode: 0644]
src/um_usb_accessory_manager.c [new file with mode: 0644]
src/um_usb_connection_manager.c [new file with mode: 0644]
src/um_usb_host_manager.c [new file with mode: 0644]
src/um_usb_server.c [new file with mode: 0644]
start_dr.sh [new file with mode: 0755]
udev-rules/91-usb-server.rules.in [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..f034086
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+Taeyoung Kim <ty317.kim at samsung dot com>\r
+Suchang Woo <suchang.woo at samsung dot com>\r
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1328ae9
--- /dev/null
@@ -0,0 +1,56 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(usb-server C)
+
+SET(SRCS
+       src/um_common.c
+       src/um_customize.c
+       src/um_main.c
+       src/um_usb_accessory_manager.c
+       src/um_usb_connection_manager.c
+       src/um_usb_host_manager.c
+       src/um_usb_server.c)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       appcore-common
+       ecore
+       vconf
+       heynoti
+       dlog
+       syspopup-caller
+       devman
+       pmapi
+       appsvc
+       libusb-1.0
+       )
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -g")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+MESSAGE("FLAGS: ${CMAKE_C_FLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+IF("${SIMULATOR}" STREQUAL "yes")
+       ADD_DEFINITIONS("-DSIMULATOR")
+ENDIF()
+
+SET(UDEV_RULES_PATH share/usb-server/udev-rules)
+SET(UDEV_RULES udev-rules/91-usb-server.rules)
+
+CONFIGURE_FILE(${UDEV_RULES}.in ${UDEV_RULES} @ONLY)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-ldl")
+
+INSTALL(FILES ${UDEV_RULES} DESTINATION ${UDEV_RULES_PATH})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/set_usb_debug.sh DESTINATION bin)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/start_dr.sh DESTINATION bin)
+ADD_SUBDIRECTORY(po)
diff --git a/LICENSE.APLv2 b/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 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 (file)
index 0000000..08a1d59
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, This software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..7e7e20d
--- /dev/null
@@ -0,0 +1,8 @@
+usb-manager (0.0.1-1) unstable; urgency=low
+
+  * modify obs spec file for devman_plugin
+  * Git: slp/pkgs/u/usb-manager
+  * Tag: usb-manager_0.0.1-1
+
+ -- Taeyoung Kim <ty317.kim@samsung.com>  Mon, 19 Mar 2012 11:00:59 +0900
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..e3e7c5b
--- /dev/null
@@ -0,0 +1,28 @@
+Source: usb-manager
+Section: tools
+Priority: extra
+Maintainer: Taeyoung Kim <ty317.kim@samsung.com> Taesoo Jun <steve.jun@samsung.com>
+Uploaders: Taeyoung Kim <ty317.kim@samsung.com> Taesoo Jun <steve.jun@samsung.com>
+Build-Depends: debhelper (>= 5),
+               libappcore-common-dev,
+               libecore-dev,
+               libheynoti-dev,
+               libslp-setting-dev,
+               libdevman-dev,
+               dlog-dev,
+               syspopup-caller-dev,
+               iniparser-dev,
+               libappsvc-dev
+Standards-Version: 3.7.2
+
+Package: usb-server
+Section: devel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: usb server package
+
+Package: usb-server-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, usb-server (= ${Source-Version})
+Description: usb server degug package
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..a57a869
--- /dev/null
@@ -0,0 +1,130 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+CXXFLAGS ?=  -Wall -g
+LDFLAGS ?= 
+PREFIX ?= /usr
+DATADIR ?= /opt
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+       CXXFLAGS += -O0
+else
+       CFLAGS += -O2
+       CXXFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+       $(MAKE)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) clean
+
+       rm -rf CMakeCache.txt
+       rm -rf CMakeFiles
+       rm -rf cmake_install.cmake
+       rm -rf Makefile
+       rm -rf install_manifest.txt
+       rm -rf *.so
+       rm -rf *.desktop
+       rm -rf po/CMakeCache.txt
+       rm -rf po/CMakeFiles
+       rm -rf po/cmake_install.cmake
+       rm -rf po/Makefile
+       rm -rf po/install_manifest.txt
+       rm -rf po/*.so
+       rm -rf udev-rules/*.rules
+
+
+       
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/tmp.
+       $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
+       ln -s ../init.d/usb-server.sh $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S36usb-server
+       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/
+       ln -s ../init.d/usb-server.sh $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S01usb-server
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs 
+       dh_installdocs
+       dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+#      dh_strip
+       dh_strip --dbg-package=usb-server-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/debian/usb-server.install.in b/debian/usb-server.install.in
new file mode 100644 (file)
index 0000000..cc1eb57
--- /dev/null
@@ -0,0 +1,6 @@
+/usr/bin/start_dr.sh
+/usr/bin/usb-server
+/usr/share/locale/*/LC_MESSAGES/usb-server.mo
+/usr/share/usb-server/udev-rules/91-usb-server.rules
+/etc/*
+/usr/bin/set_usb_debug.sh
diff --git a/debian/usb-server.postinst.in b/debian/usb-server.postinst.in
new file mode 100644 (file)
index 0000000..1680685
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+chown root:root /usr/bin/usb-server
+chown root:root /usr/bin/start_dr.sh
+chown root:root /usr/bin/set_usb_debug.sh
+vconftool set -t int memory/usb/mass_storage_status "0" -u 0 -i -f
+vconftool set -t int memory/usb/accessory_status "0" -u 5000 -i -f
+vconftool set -t int db/usb/keep_debug "0"
+
+heynotitool set device_usb_accessory
+heynotitool set device_host_chgdet
+heynotitool set device_storage_chgdet
+
+mkdir -p /etc/udev/rules.d
+if ! [ -L /etc/udev/rules.d/91-usb-server.rules ]; then
+       ln -s @PREFIX@/share/usb-server/udev-rules/91-usb-server.rules /etc/udev/rules.d/91-usb-server.rules
+fi
diff --git a/include/um_common.h b/include/um_common.h
new file mode 100644 (file)
index 0000000..9be76ed
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __UM_COMMON_H__
+#define __UM_COMMON_H__
+
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <appcore-common.h>
+#include <heynoti.h>
+#include <vconf.h>
+#include <devman.h>
+#include <sys/types.h>
+#include <glib.h>
+#include <syspopup_caller.h>
+#include <libusb.h>
+#include <sys/utsname.h>
+#include <pmapi.h>
+#include "um_data.h"
+
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#define SOCK_PATH "/tmp/usb_server_sock"
+#define ACC_SOCK_PATH "/tmp/usb_acc_sock"
+#define USB_ACCESSORY_NODE "/dev/usb_accessory"
+#define SOCK_STR_LEN 1542 /* 6 elements + 5 separators + 1 NULL terminator
+                               = 256 * 6 + 5 * 1 + 1 = 1542 */
+#define ACC_INFO_NUM 6
+#define HOST_INFO_NUM 5
+#define HOST_MAX_NUM 127
+
+#define VCONFKEY_SYSMAN_ADDED_STORAGE_UEVENT \
+               "memory/private/sysman/added_storage_uevent"
+#define VCONFKEY_SYSMAN_REMOVED_STORAGE_UEVENT \
+               "memory/private/sysman/removed_storage_uevent"
+
+#define PACKAGE "usb-server" /* for i18n */
+#define LOCALEDIR PREFIX"/share/locale"
+#define SYSPOPUP_PARAM_LEN 3
+#define USB_SYSPOPUP "usb-syspopup"
+
+#include <dlog.h>
+
+#define USB_TAG "USB_SERVER"
+
+#define USB_LOG(format, args...) \
+       LOG(LOG_DEBUG, USB_TAG, "[%s][Ln: %d] " format, (char*)(strrchr(__FILE__, '/')+1), __LINE__, ##args)
+
+#define USB_LOG_ERROR(format, args...) \
+       LOG(LOG_ERROR, USB_TAG, "[%s][Ln: %d] " format, (char*)(strrchr(__FILE__, '/')+1), __LINE__, ##args)
+
+#define __USB_FUNC_ENTER__ \
+                       USB_LOG("Entering: %s()\n", __func__)
+
+#define __USB_FUNC_EXIT__ \
+                       USB_LOG("Exit: %s()\n", __func__)
+
+#define FREE(arg) \
+       do { \
+               if(arg) { \
+                       free((void *)arg); \
+                       arg = NULL; \
+               } \
+       } while (0);
+
+#ifndef retv_if
+#define retv_if(expr, val) \
+       do { \
+               if(expr) { \
+                       return (val); \
+               } \
+       } while (0)
+#endif
+
+#define um_retvm_if(expr, val, fmt, arg...) \
+       do { \
+               if(expr) { \
+                       USB_LOG_ERROR(fmt, ##arg); \
+                       return (val); \
+               } \
+       } while (0);
+
+#define um_retm_if(expr, fmt, arg...) \
+       do { \
+               if(expr) { \
+                       USB_LOG_ERROR(fmt, ##arg); \
+                       return; \
+               } \
+       } while (0);
+
+int check_usbclient_connection();
+int check_usbhost_connection();
+int check_storage_connection();
+int launch_usb_syspopup(UmMainData *ad, POPUP_TYPE _popup_type);
+void load_system_popup(UmMainData *ad, POPUP_TYPE _popup_type);
+
+int ipc_request_server_init();
+int ipc_request_server_close(UmMainData *ad);
+int ipc_noti_server_init();
+int ipc_noti_server_close(int *sock_remote);
+bool is_emul_bin();
+
+#endif /* __UM_COMMON_H__ */
diff --git a/include/um_customize.h b/include/um_customize.h
new file mode 100644 (file)
index 0000000..068f874
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __USB_SETTING_CUSTOMIZE_H__
+#define __USB_SETTING_CUSTOMIZE_H__
+
+#include <string.h>
+#include <vconf.h>
+#include "um_common.h"
+
+#define CMD_DR_START \
+       "/usr/bin/start_dr.sh"
+#define DATA_ROUTER_PATH \
+       "/usr/bin/data-router"
+#define KERNEL_SET_PATH \
+       "/sys/devices/platform/usb_mode/UsbMenuSel"
+#define DRIVER_VERSION_PATH \
+       "/sys/class/usb_mode/version"
+#define DRIVER_VERSION_1_0 \
+       "1.0"
+#define DRIVER_VERSION_1_1 \
+       "1.1"
+#define USB_MODE_ENABLE \
+       "/sys/class/usb_mode/usb0/enable"
+#define USB_VENDOR_ID \
+       "/sys/class/usb_mode/usb0/idVendor"
+#define USB_PRODUCT_ID \
+       "/sys/class/usb_mode/usb0/idProduct"
+#define USB_FUNCTIONS \
+       "/sys/class/usb_mode/usb0/functions"
+#define USB_FUNCS_FCONF \
+       "/sys/class/usb_mode/usb0/funcs_fconf"
+#define USB_FUNCS_SCONF \
+       "/sys/class/usb_mode/usb0/funcs_sconf"
+#define USB_DEVICE_CLASS \
+       "/sys/class/usb_mode/usb0/bDeviceClass"
+#define USB_DEVICE_SUBCLASS \
+       "/sys/class/usb_mode/usb0/bDeviceSubClass"
+#define USB_DEVICE_PROTOCOL \
+       "/sys/class/usb_mode/usb0/bDeviceProtocol"
+#define DRIVER_VERSION_BUF_LEN  64
+#define FILE_PATH_BUF_SIZE      256
+#define KERNEL_SET_BUF_SIZE     3
+#define KERNEL_DEFAULT_MODE     0
+#define KERNEL_ETHERNET_MODE    4
+#define __STR_EMUL                             "emul"
+#define __LEN_STR_EMUL                 4
+#define BIN_INFO_FILE_PATH             "/etc/info.ini"
+#define USB_SERVER_MESSAGE_DOMAIN \
+       "usb-server"
+
+#define USB_NOTICE_SYSPOPUP_FAIL \
+       "USB system popup failed"
+#define TICKERNOTI_SYSPOPUP \
+       "tickernoti-syspopup"
+
+static int mode_set_driver_0_0(int mode);
+static int mode_set_driver_1_0(UmMainData *ad, int mode);
+static int mode_set_driver_1_1(UmMainData *ad, int mode);
+static Eina_Bool write_file(const char *filepath, char *content);
+
+int check_driver_version(UmMainData *ad);
+int mode_set_kernel(UmMainData *ad, int mode);
+void start_dr(UmMainData *ad);
+void load_connection_popup(UmMainData *ad, char *msg, int orientation);
+
+#endif
+
diff --git a/include/um_data.h b/include/um_data.h
new file mode 100644 (file)
index 0000000..7f9d692
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __UM_DATA_H__
+#define __UM_DATA_H__
+
+#include <Ecore.h>
+#include <unistd.h>
+#include <libusb.h>
+#define ACC_ELEMENT_LEN 256
+#define HOST_ELEMENT_LEN 256
+#define APP_ID_LEN 1024
+#define BUF_MAX 256
+
+typedef enum {
+       USB_HOST_CDC = 0x2,
+       USB_HOST_HID = 0x3,
+       USB_HOST_CAMERA = 0x6,
+       USB_HOST_PRINTER = 0x7,
+       USB_HOST_MASS_STORAGE = 0x8,
+       USB_HOST_HUB = 0x9
+} USB_HOST_CLASS_SUPPORTED;
+
+typedef enum {
+       HID_KEYBOARD = 1,
+       HID_MOUSE = 2
+} HID_PROTOCOL;
+
+typedef enum {
+       USB_DEVICE_HOST = 0,
+       USB_DEVICE_CLIENT,
+       USB_DEVICE_UNKNOWN
+} IS_HOST_OR_CLIENT;
+
+typedef enum {
+       USB_CLIENT_DISCONNECTED = 0,
+       USB_CLIENT_CONNECTED,
+       USB_HOST_DISCONNECTED,
+       USB_HOST_CONNECTED
+} USB_CONNECTION_STATUS;
+
+typedef enum {
+       TICKERNOTI_ORIENTATION_TOP = 0,
+       TICKERNOTI_ORIENTATION_BOTTOM
+} TICKERNOTI_ORIENTATION;
+
+typedef enum {
+       CHANGE_COMPLETE = 0,
+       IN_MODE_CHANGE
+} MODE_CHANGE;
+
+typedef enum {
+       SYSPOPUP_TYPE = 0,
+       MAX_NUM_SYSPOPUP_PARAM
+       /* When we need to deliver other parameters to USB-syspopup
+        * add the types of parameters */
+} SYSPOPUP_PARAM;
+
+typedef enum {
+       ERROR_POPUP = 0,
+       SELECT_PKG_FOR_ACC_POPUP,
+       SELECT_PKG_FOR_HOST_POPUP,
+       REQ_ACC_PERM_POPUP,
+       REQ_HOST_PERM_POPUP,
+       TEST_POPUP,
+       MAX_NUM_SYSPOPUP_TYPE
+       /* When we need to add other system popup,
+        * Write here the type of popup */
+} POPUP_TYPE;
+
+typedef enum {
+       IPC_ERROR = 0,
+       IPC_FAIL,
+       IPC_SUCCESS
+} IPC_SIMPLE_RESULT;
+
+typedef enum {
+       /* General */
+       ERROR_POPUP_OK_BTN = 0,
+       IS_EMUL_BIN,
+
+       /* for Accessory */
+       LAUNCH_APP_FOR_ACC = 20,
+       REQ_ACC_PERMISSION,
+       HAS_ACC_PERMISSION,
+       REQ_ACC_PERM_NOTI_YES_BTN,
+       REQ_ACC_PERM_NOTI_NO_BTN,
+       GET_ACC_INFO,
+
+       /* for Host */
+       LAUNCH_APP_FOR_HOST = 40,
+       REQ_HOST_PERMISSION,
+       HAS_HOST_PERMISSION,
+       REQ_HOST_PERM_NOTI_YES_BTN,
+       REQ_HOST_PERM_NOTI_NO_BTN,
+       REQ_HOST_CONNECTION
+} REQUEST_TO_USB_MANGER;
+
+typedef enum {
+       NOTPERMITTED = 0,
+       PERMITTED
+} HAS_PERM;
+
+typedef enum {
+       USB_DRIVER_0_0 = 0,
+       USB_DRIVER_1_0,
+       USB_DRIVER_1_1,
+       MAX_NUM_USB_DRIVER_VERSION
+       /* We can add kernel versions here */
+} USB_DRIVER_VERSION;
+
+typedef enum {
+       ACT_SUCCESS = 0x1000,
+       ACT_FAIL
+} ACTION_RESULT;
+
+typedef enum {
+       ACC_MANUFACTURER = 0,
+       ACC_MODEL,
+       ACC_DESCRIPTION,
+       ACC_VERSION,
+       ACC_URI,
+       ACC_SERIAL,
+       HOST_CLASS = 11,
+       HOST_SUBCLASS,
+       HOST_PROTOCOL,
+       HOST_IDVENDOR,
+       HOST_IDPRODUCT
+} USB_DEVICE_ELEMENT;
+
+typedef struct _UsbAccessory {
+       char *manufacturer;
+       char *model;
+       char *description;
+       char *version;
+       char *uri;
+       char *serial;
+} UsbAccessory;
+
+typedef struct _UsbHost {
+       char                                    *permittedAppId;
+       int                                             deviceClass;
+       int                                             deviceSubClass;
+       int                                             deviceProtocol;
+       int                                             idVendor;
+       int                                             idProduct;
+       int                                             bus;
+       int                                             deviceAddress;
+} UsbHost;
+
+typedef struct _UmMainData {
+       Ecore_Fd_Handler                *ipcRequestServerFdHandler;
+       int                                             server_sock_local;
+       int                                             server_sock_remote;
+
+       int                                             usb_noti_fd;
+       int                                     acc_noti_fd;
+       int                                     host_add_noti_fd;
+       int                                             host_remove_noti_fd;
+       int                                     keyboard_add_noti_fd;
+       int                                             keyboard_remove_noti_fd;
+       int                                             mouse_add_noti_fd;
+       int                                             mouse_remove_noti_fd;
+       int                                             camera_add_noti_fd;
+       int                                             camera_remove_noti_fd;
+
+       UsbAccessory                    *usbAcc;
+       UsbHost                                 *usbHost;
+       char                                    *permittedPkgForAcc;
+       char                                    *launchedApp;
+
+       libusb_context                  *usbctx;
+       GList                                   *devList;
+       GList                                   *defaultDevList;
+
+       /* System status */
+       USB_DRIVER_VERSION              driverVersion;
+       int                                             isHostOrClient;
+
+       /* USB connection */
+#ifndef SIMULATOR
+       bool                            curDebugMode;
+       bool                            prevDebugMode;
+#endif
+
+} UmMainData;
+
+#endif /* __UM_DATA_H__ */
diff --git a/include/um_main.h b/include/um_main.h
new file mode 100644 (file)
index 0000000..849eaa5
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __UM_MAIN_H__
+#define __UM_MAIN_H__
+
+#include "um_usb_server.h"
+
+#endif /* __UM_MAIN_H__ */
diff --git a/include/um_usb_accessory_manager.h b/include/um_usb_accessory_manager.h
new file mode 100644 (file)
index 0000000..a028ef2
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_customize.h"
+#include <vconf.h>
+#include <appsvc.h>
+
+#define USB_ACCESSORY_GET_MANUFACTURER _IOW('M', 1, char[256])
+#define USB_ACCESSORY_GET_MODEL                        _IOW('M', 2, char[256])
+#define USB_ACCESSORY_GET_DESCRIPTION  _IOW('M', 3, char[256])
+#define USB_ACCESSORY_GET_VERSION              _IOW('M', 4, char[256])
+#define USB_ACCESSORY_GET_URI                  _IOW('M', 5, char[256])
+#define USB_ACCESSORY_GET_SERIAL               _IOW('M', 6, char[256])
+
+int getAccessoryInfo(UsbAccessory *usbAcc);
+int connectAccessory(UmMainData *ad);
+int disconnectAccessory(UmMainData *ad);
+void getCurrentAccessory();
+void umAccInfoInit(UmMainData *ad);
diff --git a/include/um_usb_connection_manager.h b/include/um_usb_connection_manager.h
new file mode 100644 (file)
index 0000000..6897965
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_customize.h"
+
+#define SDBD_START "/etc/init.d/sdbd start"
+#define SDBD_STOP  "/etc/init.d/sdbd stop"
+#define SET_USB0_IP \
+                       "/sbin/ifconfig usb0 192.168.129.3 up"
+#define UNSET_USB0_IP \
+                       "/sbin/ifconfig usb0 down"
+#define ADD_DEFAULT_GW \
+                       "/sbin/route add -net 192.168.129.0 netmask 255.255.255.0 dev usb0"
+#define OPENSSHD_START \
+                       "/etc/init.d/ssh start"
+#define OPENSSHD_STOP \
+                       "/etc/init.d/ssh stop"
+
+int action_clean(UmMainData *ad, int mode);
+int call_cmd(char* cmd);
+int connectUsbClient(UmMainData *ad);
+int disconnectUsbClient(UmMainData *ad);
+void debug_mode_cb(keynode_t* in_key, void *data);
+void change_mode_cb(keynode_t* in_key, void *data);
+void change_hotspot_status_cb(keynode_t* in_key, void *data);
+static int check_mobile_hotspot_status();
+static int run_core_action(UmMainData *ad, int mode);
+int set_USB_mode(UmMainData *ad, int mode);
+void change_hotspot_status_cb(keynode_t* in_key, void *data);
+void usb_connection_selected_btn(UmMainData *ad, int input);
+
diff --git a/include/um_usb_host_manager.h b/include/um_usb_host_manager.h
new file mode 100644 (file)
index 0000000..98a7235
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vconf.h>
+#include <sys/mount.h>
+#include <mntent.h>
+#include <string.h>
+#include "um_customize.h"
+
+#define MTAB_FILE       "/etc/mtab"
+#define MOUNT_POINT     "/opt/storage/usb"
+
+
+
+int umGetDeviceInfo(UmMainData *ad);
+void destroy_device(gpointer data);
+int umReleaseAllDevice(UmMainData *ad);
+void usb_host_added_cb(UmMainData *ad);
+void usb_host_removed_cb(UmMainData *ad);
+int find_host_fd(UmMainData *ad, char *appId);
+int grantHostPermission(UmMainData *ad, char *appId, int vendor, int product);
+int launch_host_app(char *appId);
+Eina_Bool hasHostPermission(UmMainData *ad, char *appId, int vendor, int product);
+int show_all_usb_devices(GList *devList, int option);
+void free_func(gpointer data);
+static int um_usb_storage_added();
+static int um_usb_storage_removed();
+int disconnectUsbHost(UmMainData *ad);
+
+void add_host_noti_cb(void *data);
+void remove_host_noti_cb(void *data);
+void add_mass_storage_cb(keynode_t *in_key, void *data);
+void remove_mass_storage_cb(keynode_t *in_key, void *data);
diff --git a/include/um_usb_server.h b/include/um_usb_server.h
new file mode 100644 (file)
index 0000000..312c41a
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vconf.h>
+#include "um_main.h"
+#include "um_usb_accessory_manager.h"
+#include "um_usb_connection_manager.h"
+#include "um_usb_host_manager.h"
+
+void um_signal_init();
+int um_usb_server_init();
+Eina_Bool answer_to_ipc(void *data, Ecore_Fd_Handler *fd_handler);
diff --git a/packaging/usb-manager.spec b/packaging/usb-manager.spec
new file mode 100644 (file)
index 0000000..89643a5
--- /dev/null
@@ -0,0 +1,69 @@
+Name:       usb-server
+Summary:    USB server
+Version:    0.0.11
+Release:    1
+Group:      framework-system
+License:    APLv2
+Source0:    usb-server-%{version}.tar.gz
+Source1:    usb-server.manifest
+
+BuildRequires:  cmake
+BuildRequires:  libattr-devel
+BuildRequires:  gettext-devel
+BuildRequires:  pkgconfig(appcore-common)
+BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(heynoti)
+BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(devman)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(syspopup-caller)
+BuildRequires:  pkgconfig(pmapi)
+BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(libusb-1.0)
+BuildRequires:  pkgconfig(capi-system-usb-accessory)
+
+%description
+Description: USB server
+
+
+%prep
+%setup -q
+
+%if 0%{?simulator}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DSIMULATOR=yes
+%else
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DSIMULATOR=no
+%endif
+
+
+%build
+cp %{SOURCE1} .
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post 
+
+vconftool set -t int memory/usb/mass_storage_status "0" -u 0 -i -f
+vconftool set -t int memory/usb/accessory_status "0" -u 5000 -i -f
+vconftool set -t int db/usb/keep_ethernet "0" -f
+vconftool set -t int memory/usb/libusb_status "0" -f
+
+heynotitool set device_usb_accessory
+
+mkdir -p /etc/udev/rules.d
+if ! [ -L /etc/udev/rules.d/91-usb-server.rules ]; then
+       ln -s /usr/share/usb-server/udev-rules/91-usb-server.rules /etc/udev/rules.d/91-usb-server.rules
+fi
+
+
+%files
+%manifest usb-server.manifest
+%defattr(540,root,root,-)
+/usr/bin/start_dr.sh
+/usr/bin/usb-server
+%attr(440,root,root) /usr/share/locale/*/LC_MESSAGES/usb-server.mo
+%attr(440,root,root) /usr/share/usb-server/udev-rules/91-usb-server.rules
+/usr/bin/set_usb_debug.sh
diff --git a/packaging/usb-server.manifest b/packaging/usb-server.manifest
new file mode 100644 (file)
index 0000000..3486111
--- /dev/null
@@ -0,0 +1,20 @@
+<manifest>
+<define>
+    <domain name="usb-server" policy="restrict" plist="com.samsung.usb-syspopup,com.samsung.setting,system-server"/>
+       <provide>
+               <label name="usb-server::usb-rx"/>
+               <label name="usb-server::usb-r"/>
+               <label name="usb-server::usb-rw"/>
+       </provide>
+</define>
+<assign>
+       <filesystem path="/usr/bin/start_dr.sh"                                     label="usb-server::usb-rx"/>
+       <filesystem path="/usr/bin/set_usb_debug.sh"                                label="usb-server::usb-rx"/>
+       <filesystem path="/usr/bin/usb-server"                                      label="usb-server::usb-rx"/>
+       <filesystem path="/usr/share/usb-server/udev-rules/91-usb-server.rules"     label="usb-server::usb-r"/>
+       <filesystem path="/opt/share/noti/device_usb_accessory"                     label="usb-server::usb-rw"/>
+</assign>
+<request>
+       <domain name="usb-server"/>
+</request>
+</manifest>
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644 (file)
index 0000000..54b356a
--- /dev/null
@@ -0,0 +1,23 @@
+# for i18n
+#SET(POFILES en_US.po en_GB.po ja.po ko.po zh_CN.po)
+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 et.po eu.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 share/locale/${lang}/LC_MESSAGES RENAME usb-server.mo)
+       SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po_usb_server ALL DEPENDS ${moFiles})
diff --git a/po/ar.po b/po/ar.po
new file mode 100755 (executable)
index 0000000..4b2c798
--- /dev/null
+++ b/po/ar.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "متصل بجهاز HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB متصل"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "تم تفعيل تقييد USB"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "تصحيح USB متصل"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "متصل كملحق USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "تم توصيل الطابعة"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "تم توصيل موصل USB"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "تم فصل موصل USB"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "تم توصيل لوحة المفاتيح"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "تم توصيل الماوس"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "تم توصيل الكاميرا"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "وحدة تخزين USB كبيرة السعة‬ متصلة"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "تم توصيل جهاز USB غير معروف"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "تمت إزالة جهاز USB بأمان"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "تمت إزالة وحدة تخزين USB كبيرة السعة بشكل غير متوقع"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "يتعذر استخدام ‏‫ وحدة تخزين USB‬ كوحدة تخزين USB كبيرة السعة‬. حدث خطأ"
+
diff --git a/po/az.po b/po/az.po
new file mode 100755 (executable)
index 0000000..b5ce7f8
--- /dev/null
+++ b/po/az.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID cihazına qoşulmuşdur"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB qoşuldu"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB bağlanma aktivdir"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB sazlanması qoşulub"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB aksesuarına qoşuldu"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer qoşuldu"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB konnektoru qoşuldu"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB konnektoru ilə əlaqə kəsildi"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klaviatura qoşuldu"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Siçan ilə əlaqə yaradıldı"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera qoşuldu"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB yaddaşla əlaqə yaradıldı"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Naməlum USB cihazı qoşulmuşdur"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB cihazı təhlükəsiz şəkildə çıxarıldı"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB kütləvi yaddaşı gözlənilmədən çıxarıldı"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB kütləvi yaddaşında USB yaddaşdan istifadə etmək mümkün deyil. Səhv baş verdi"
+
diff --git a/po/bg.po b/po/bg.po
new file mode 100755 (executable)
index 0000000..18d93c7
--- /dev/null
+++ b/po/bg.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Свързан с HID устройство"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB устройството е свързано"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB привързването е активирано"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB поправките свързани"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Свързан с USB аксесоар"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Принтерът е свързан"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB съединителят е свързан"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB съединителят е изваден"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Клавиатурата е свързана"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Мишката е свързана"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Камерата е свързана"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB запамет. у-во е свързано"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Свързано е неизвестно USB устройство"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB устройството е извадено безопасно"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB запаметяващото устройство за е извадено неочаквано"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Не може да се използва USB устройството като USB запаметяващо устройство. Възникна грешка"
+
diff --git a/po/ca.po b/po/ca.po
new file mode 100755 (executable)
index 0000000..374ceb0
--- /dev/null
+++ b/po/ca.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connectat a un dispositiu HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB connectada"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Tethering USB habilitat"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depuració USB connectada"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connectat a un accessori USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impressora connectada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Connector USB connectat"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Connector USB desconnectat"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclat connectat"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Ratolí connectat"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Càmera connectada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Emmagat USB massiu connectat"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositiu USB desconegut connectat"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositiu USB retirat amb seguretat"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "L'emmagatzematge massiu USB s'ha retirat de forma inesperada"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "No es pot utilitzar l'emmagatzematge USB com a emmagatzematge USB massiu. S'ha produït un error"
+
diff --git a/po/cs.po b/po/cs.po
new file mode 100755 (executable)
index 0000000..326cfdb
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Připojeno k zařízení HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB připojeno"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Sdílení připojení USB zapnuto"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Ladění USB bylo připojeno"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Připojeno k příslušenství USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Tiskárna byla připojena"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Konektor USB byl připojen"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Konektor USB byl odpojen"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klávesnice byla připojena"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Myš byla připojena"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera byla připojena"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Velk. paměť USB byla připojena"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Bylo připojeno neznámé zařízení USB"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Zařízení USB bylo bezpečně odebráno"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Velkokapacitní paměťové zařízení USB bylo neočekávaně odebráno"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Paměť USB nelze použít jako velkokapacitní paměťové zařízení USB. Došlo k chybě"
+
diff --git a/po/da.po b/po/da.po
new file mode 100755 (executable)
index 0000000..f3d9441
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Tilsluttet HID-enhed"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB tilsluttet"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-binding aktiveret"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-fejlsøgning tilsluttet"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Tilsluttet til USB-tilbehør"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer tilsluttet"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Intet USB-stik tilsluttet"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-stik frakoblet"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatur tilsluttet"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mus tilsluttet"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera tilsluttet"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-masselager tilsluttet"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Ukendt USB-enhed tilsluttet"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-enhed fjernet sikkert"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-masselageret blev fjernet uventet"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Kan ikke bruge USB-lagring som USB-masselager. Fejl opstod"
+
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100755 (executable)
index 0000000..8c662b4
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Mit HID-Gerät verbunden"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB verbunden"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-Tethering aktiviert"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-Debugging verbunden"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Mit USB-Gerät verbunden"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Drucker verbunden"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-Connector verbunden."
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-Connector getrennt."
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatur verbunden"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Maus verbunden"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera verbunden"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-Massenspeicher verbunden"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Unbekanntes USB-Gerät verbunden."
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-Gerät sicher entfernt."
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-Massenspeicher unerwartet entfernt"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB-Speicher kann nicht als USB-Massenspeicher verwendet werden. Es ist ein Fehler aufgetreten."
+
diff --git a/po/el_GR.po b/po/el_GR.po
new file mode 100755 (executable)
index 0000000..22c12b3
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Συνδέθηκε σε συσκευή HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Το USB συνδέθηκε"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Ενεργοποιήθηκε το tethering USB"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Εντοπισμός σφαλμάτων USB"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Συνδέθηκε σε αξεσουάρ αποθήκευσης USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Συνδέθηκε εκτυπωτής"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Συνδέθηκε ο προσαρμογέας USB"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Ο προσαρμογέας USB αποσυνδέθηκε"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Συνδέθηκε πληκτρολόγιο"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Συνδέθηκε ποντίκι"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Η κάμερα συνδέθηκε"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Συνδ. συσκ. μαζικής αποθ. USB"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Συνδέθηκε άγνωστη συσκευή USB"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Η συσκευή USB καταργήθηκε με ασφάλεια"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Η συσκευή μαζικής αποθήκευσης USB αφαιρέθηκε απρόσμενα"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Δεν είναι δυνατή η χρήση της συσκευής USB ως συσκευής μαζικής αποθήκευσης USB. Προέκυψε ένα σφάλμα"
+
diff --git a/po/en.po b/po/en.po
new file mode 100755 (executable)
index 0000000..4d43667
--- /dev/null
+++ b/po/en.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connected to HID device"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB connected"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB tethering enabled"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB debugging connected"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connected to a USB accessory"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB connector connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB connector disconnected"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Keyboard connected"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse connected"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Camera connected"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB mass storage connected"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Unknown USB device connected"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB device safely removed"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB mass storage unexpectedly removed"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Unable to use USB storage as USB mass storage. Error occurred"
+
diff --git a/po/en_PH.po b/po/en_PH.po
new file mode 100755 (executable)
index 0000000..3ba246e
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connected to HID device"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB connected"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB tethering enabled"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB debugging connected"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connected to a USB accessory"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB connector connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB connector disconnected"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Keyboard connected"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse connected"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Camera connected"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB mass storage connected"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Unknown USB device connected"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB device is safely removed"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB mass storage unexpectedly removed"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Unable to use USB storage as USB mass storage. Error occurred"
+
diff --git a/po/en_US.po b/po/en_US.po
new file mode 100755 (executable)
index 0000000..4d43667
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connected to HID device"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB connected"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB tethering enabled"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB debugging connected"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connected to a USB accessory"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB connector connected"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB connector disconnected"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Keyboard connected"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse connected"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Camera connected"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB mass storage connected"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Unknown USB device connected"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB device safely removed"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB mass storage unexpectedly removed"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Unable to use USB storage as USB mass storage. Error occurred"
+
diff --git a/po/es_ES.po b/po/es_ES.po
new file mode 100755 (executable)
index 0000000..4b37117
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Conectado a dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB conectado"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Anclaje a red USB activado"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depuración USB conectada"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Conectado a un accesorio USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impresora conectada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conector USB conectado"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conector USB desconectado"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclado conectado"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Ratón conectado"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Cámara conectada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Almacenam masivo USB conectado"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB desconocido conectado"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB extraído correctamente"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Almacenamiento masivo USB extraído de forma inesperada"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "No se puede utilizar el almacenamiento USB como almacenamiento masivo USB. Se ha producido un error"
+
diff --git a/po/es_US.po b/po/es_US.po
new file mode 100755 (executable)
index 0000000..0bc857f
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Conectado a dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB conectado"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Redirección de USB activada"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depuración de USB conectada"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Conectado a un accesorio USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impresora conectada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conector USB conectado"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conector USB desconectado"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclado conectado"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse conectado"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Cámara conectada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Almacen. masivo USB conectado"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB desconocido conectado"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB extraído correctamente"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Almacenamiento masivo USB retirado de forma inesperada"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "No se puede utilizar el almacenamiento USB como almacenamiento masivo USB. Se ha producido un error"
+
diff --git a/po/et.po b/po/et.po
new file mode 100755 (executable)
index 0000000..cb9e7ef
--- /dev/null
+++ b/po/et.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID-seadmega ühendatud"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB on ühendatud"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB modem on aktiveeritud"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-silumine on ühendatud"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Ühendatud USB-tarvikuga"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer on ühendatud"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-pistik on ühendatud"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-pistiku ühendus on katkestatud"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klaviatuur on ühendatud"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Hiir on ühendatud"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kaamera on ühendatud"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-massmälu on ühendatud"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Tundmatu USB-seade on ühendatud"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-seade on ohutult eemaldatud"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-massmälu on ootamatult eemaldatud"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB-mälu ei saa kasutada USB-massmäluna. Ilmnes tõrge"
+
diff --git a/po/eu.po b/po/eu.po
new file mode 100755 (executable)
index 0000000..3fa9e34
--- /dev/null
+++ b/po/eu.po
@@ -0,0 +1,49 @@
+
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID gailura konektatuta"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB konektatua"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB ainguraketa gaituta"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB arazketa konektatuta"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Konektatu USB osagarri batera"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Inprimagailua konektatuta"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB konektorea konektatua"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB konektorea deskonektatuta"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teklatua konektatuta"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Sagua konektatuta"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera konektatuta"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB biltegiratze masiboa konektatuta"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "USB gailu ezezaguna konektatuta"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB gailua segurtasunez kendu da"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB biltegiratze masiboa ezustean kendu da"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Ezin da USB memoria erabili USB biltegiratze masio. Errorea gertatu da"
+
diff --git a/po/fi.po b/po/fi.po
new file mode 100755 (executable)
index 0000000..cc5ce1f
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Yhdistetty HID-laitteeseen"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB yhdistetty"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-yhteys käytössä"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-virheenkorjaus on yhdistetty"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Liitetty USB-lisälaitteena"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Tulostin kytketty"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-liitin kytketty"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-liitin irrotettu"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Näppäimistö kytketty"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Hiiri kytketty"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera kytketty"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-massamuisti kytketty"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Tuntematon USB-laite yhdistetty"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-laite on turvallisesti poistettu"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-massamuisti on poistettu odottamattomasti"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB-muistia ei voi käyttää USB-massamuistina. Tapahtui virhe"
+
diff --git a/po/fr_CA.po b/po/fr_CA.po
new file mode 100755 (executable)
index 0000000..6d21dcf
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connecté au périphérique HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB branché"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Modem USB activé"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Débogage USB connecté"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connecté à un accessoire USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Imprimante connectée"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Connecteur USB branché"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Connecteur USB débranché"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Clavier connecté"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Souris connectée"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Appareil photo connecté"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Stockage de masse USB connecté"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Périphérique USB inconnu connecté"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Périphérique USB retiré en toute sécurité"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Stockage de masse USB retiré de manière inattendue"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Impossible d'utiliser le stockage USB en tant que stockage de masse USB. Une erreur est survenue"
+
diff --git a/po/fr_FR.po b/po/fr_FR.po
new file mode 100755 (executable)
index 0000000..770d975
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connecté au périphérique HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB branché"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Modem USB activé"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Débogage USB connecté"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connecté à un accessoire USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Imprimante connectée"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB connecté"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB déconnecté"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Clavier connecté"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Souris connectée"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Appareil photo connecté"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Stockage de masse USB connecté"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Périphérique USB inconnu connecté"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Périphérique USB retiré en toute sécurité"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Stockage de masse USB retiré de manière inattendue"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Impossible d'utiliser le stockage USB en tant que stockage de masse USB. Une erreur est survenue"
+
diff --git a/po/ga.po b/po/ga.po
new file mode 100755 (executable)
index 0000000..0c51020
--- /dev/null
+++ b/po/ga.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Nasctha le gléas HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB ceangailte"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Nascaireacht USB cumasaithe"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Dífhabhtú USB casta air"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Nasctha le hoiriúint USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printéir ceangailte"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Nascóir USB nasctha"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Nascóir USB dínasctha"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Eochairchlár ceangailte"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Luchóg ceangailte"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Ceamara ceangailte"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Ollstóras USB ceangailte"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Gléas USB anaithnid nasctha"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Stóras USB bainte go sábháilte"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Ollstóras USB bainte gan choinne"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Ní féidir stóras USB a úsáid mar ollstóras USB. Tharla earráid"
+
diff --git a/po/gl.po b/po/gl.po
new file mode 100755 (executable)
index 0000000..85f4a50
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Conectado ao dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB conectado"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Ancoraxe á rede USB activada"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Eliminación de fallos do USB conectado"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Conectado a un accesorio USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impresora conectada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conectador USB conectado"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conectador USB desconectado"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclado conectado"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Rato conectando"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Cámara conectada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Almac. masivo USB conectado"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB descoñecido conectado"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB extraído con seguridade"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Almacenamento masivo USB extraído inesperadamente"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Non se pode empregar o almacenamento USB como almacenamento masivo USB. Produciuse un erro"
+
diff --git a/po/hi.po b/po/hi.po
new file mode 100755 (executable)
index 0000000..813b308
--- /dev/null
+++ b/po/hi.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID डिवाइस से जोड़ा गया"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB कनेक्ट किया गया"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB तेथरिंग सक्षम किया गया"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB डिबगिंग कनेक्‍ट किया हुआ"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB उपसाधन से कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "प्रिंटर कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB कनेक्‍टर कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB कनेक्‍टर डिसकनेक्ट किया गया"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "कीबोर्ड कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "माउस कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "कैमरा कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB मास स्‍टोरेज कनेक्ट किया गया"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "अज्ञात USB डिवाइस कनेक्ट किया गया"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "यूएसबी डिवाइस सुरक्षित रूप से निकाला गया"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB मास स्टोरेज को अप्रत्याशित रूप से निकाला गया"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB मास स्‍टोरेज के रूप में USB स्टोरेज का उपयोग करने में अक्षम। त्रुटि पाई गई"
+
diff --git a/po/hr.po b/po/hr.po
new file mode 100755 (executable)
index 0000000..41fe209
--- /dev/null
+++ b/po/hr.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Spojen na HID uređaj"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB spojen"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB dijeljenje uključeno"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB ispravljanje grešaka spojeno"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Spojen na USB priključak"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Pisač spojen"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB kabel spojen"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB kabel odspojen"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tipkovnica spojena"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Miš spojen"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera spojena"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB memorija spojena"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Nepoznati USB uređaj spojen"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB uređaj sigurno izvađen"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB memorija neočekivano izvađena"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Nemoguće koristiti USB memoriju za USB spremanje podataka. Greška"
+
diff --git a/po/hu.po b/po/hu.po
new file mode 100755 (executable)
index 0000000..fe79160
--- /dev/null
+++ b/po/hu.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID-eszközhöz csatlakoztatva"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB csatlakoztatva"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-internetmegosztás engedélyezve"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-hibakeresés csatlakoztatva"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB-tartozékhoz kapcsolódva"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Nyomtató csatlakoztatva"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-csatlakozó csatlakoztatva"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-csatlakozó leválasztva"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Billentyűzet csatlakoztatva"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Egér csatlakoztatva"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Fényképező csatlakoztatva"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-háttértár csatlakoztatva"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Ismeretlen USB-eszköz csatlakoztatva"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-eszköz biztonságosan eltávolítva"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Az USB-háttértárat váratlanul eltávolították"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Az USB-tároló nem használható USB-háttértárként. Hiba történt"
+
diff --git a/po/hy.po b/po/hy.po
new file mode 100755 (executable)
index 0000000..060b96e
--- /dev/null
+++ b/po/hy.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Միացված է HID սարքին"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB-ն միացված է"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB տեղակապումն ընձեռված է"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB վրիպազերծումը միացված է"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Միացել է USB լրասարքին"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Տպիչը միացված է"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB միակցիչը կապակցվել է"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB միակցիչն անջատվել է"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Ստեղնաշարը միացված է"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Մկնիկը միացված է"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Խցիկը միացված է"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB զանգված. պահոցը միացված է"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Անհայտ USB սարքը միացվեց"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB սարքն ապահով հեռացվեց"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB զանգվածային պահոցն անսպասելիորեն հեռացվեց"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Անհնար է օգտագործել USB պահոցը որպես USB զանգվածային պահոց. սխալ է տեղի ունեցել"
+
diff --git a/po/is.po b/po/is.po
new file mode 100755 (executable)
index 0000000..95097b3
--- /dev/null
+++ b/po/is.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID-tæki tengt"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB er tengt"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-tjóðrun virk"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-kembing tengd"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Tengt við USB-aðgang"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Prentari tengdur"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-tengi tengt"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-tengi er aftengt"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Lyklaborð tengt"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mús tengd"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Myndavél tengd"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-gagnageymsla tengd"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Óþekkt USB-tæki tengt"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-tæki var fjarlægt"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-gagnageymsla var óvænt fjarlægð"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Ekki er hægt að nota USB-geymslu sem USB-gagnageymslu. Villa kom upp"
+
diff --git a/po/it_IT.po b/po/it_IT.po
new file mode 100755 (executable)
index 0000000..317b2d1
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Connetti a dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB connesso"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Tethering USB attivato"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Debug USB connesso"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Connesso ad accessorio USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Stampante connessa"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Connettore USB connesso"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Connettore USB disconnesso"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastiera connessa"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse connesso"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Fotocamera collegata"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Memoria di massa USB connessa"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB sconosciuto connesso"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB rimosso in sicurezza"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Memoria di massa USB rimossa in modo imprevisto"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Impossibile utilizzare la memoria USB come memoria di massa USB. Si è verificato un errore"
+
diff --git a/po/ja_JP.po b/po/ja_JP.po
new file mode 100755 (executable)
index 0000000..7c6d354
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HIDデバイスに接続されています。"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USBが接続されました。"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB​テザリング​が​有効​です。"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USBデバッグが接続されました。"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USBアクセサリに接続"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "プリンターが接続されました。"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "デバイスが接続されました。"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "デバイスが取り外されました。"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "キーボードが接続されました。"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "マウスが接続されました。"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "カメラ​が​接続​され​ました。"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB大容量ストレージが接続されました。"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "不明なUSBデバイスが接続されました。"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "デバイスは安全に取り外されました。"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB大容量ストレージが​​​​予期せず​​​​取り外されました。"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB大容量ストレージとしてユーザーメモリ(本体)を使用できません。エラーが発生しました。"
+
diff --git a/po/ka.po b/po/ka.po
new file mode 100755 (executable)
index 0000000..ed36d9f
--- /dev/null
+++ b/po/ka.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "დაკავშირებულია HID მოწყობილობასთან"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB დაკავშირდა"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB მობილური ინტერნეტი გააქტიურებულია"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB შეცდომების გასწორება დაკავშირებულია"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "დაკავშირებულია USB აქსესუართან"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "პრინტერი დაკავშირებულია"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB დამაკავშირებელი დაკავშირებულია"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB დამაკავშირებელი გათიშულია"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "კლავიატურა დაკავშირებულია"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "თაგუნა დაკავშირებულია"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "კამერა დაკავშირებულია"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB მეხსიერება დაკავშირებულია"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "დაკავშირებულია უცნობი USB მოწყობილობა"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB მოწყობილობა უსაფრთხოდ მოცილდა"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB მასიური მეხსიერება მოულოდნელად გაითიშა"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "ტელეფონის შიდა მეხსიერებას ვერ გამოიყენებთ, როგორც USB მასიურ მეხსიერებას. შეცდომა მოხდა"
+
diff --git a/po/kk.po b/po/kk.po
new file mode 100755 (executable)
index 0000000..7131d8f
--- /dev/null
+++ b/po/kk.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID құрылғысына қосылған"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB қосылған"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB байланыстыру қосылды"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB жөндеу жүйесі қосылған"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB аксессуарына қосылды"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Принтер қосылды"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB коннекторы қосылған"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB коннекторы ажыратылған"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Пернетақта қосылды"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Тінтуір қосылды"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Камера қосылды"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB жалпы жады қосылды"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Белгісіз USB құрылғысы қосылған"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB құрылғысы қауіпсіз алынды"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB сақтау құрылғысы байқаусызда алынды"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Ішкі телефон жадын USB жалпы сақтау құралы ретінде пайдалану мүмкін емес. Қате пайда болды"
+
diff --git a/po/ko_KR.po b/po/ko_KR.po
new file mode 100755 (executable)
index 0000000..cfbe683
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID 기기에 연결되었습니다"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB가 연결되었습니다"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB 테더링이 실행되었습니다"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB 디버깅이 실행되었습니다"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB 액세서리에 연결됨"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "프린터가 연결되었습니다"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB 커넥터가 연결되었습니다"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB 커넥터가 연결 해제되었습니다"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "키보드가 연결되었습니다"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "마우스가 연결되었습니다"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "카메라가 연결되었습니다"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB 대용량 저장소가 연결되었습니다"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "알 수 없는 USB 기기가 연결되었습니다"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB 기기가 안전하게 제거되었습니다"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB 대용량 저장소가 예상치 않게 제거되었습니다"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "오류가 발생하여 내장 메모리를 USB 대용량 저장소로 사용할 수 없습니다"
+
diff --git a/po/lt.po b/po/lt.po
new file mode 100755 (executable)
index 0000000..955c53e
--- /dev/null
+++ b/po/lt.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Prisijungta prie HID įrenginio"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Prijungtas USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB siejimas įjungtas"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB derinimas prijungtas"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Prisijungta prie USB priedo"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Prijungtas spausdintuvas"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB jungtis prijungta"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB jungtis atjungta"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Prijungta klaviatūra"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Prijungta pelė"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Fotoaparatas prijungtas"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB laikmena prijungta"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Prijungtas nežinomas USB įrenginys"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB įrenginys pašalintas saugiai"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB atmintinė netikėtai atjungta"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Neįmanoma naudoti USB vidinės telefono atminties kaip USB duomenų saugyklos. Įvyko klaida"
+
diff --git a/po/lv.po b/po/lv.po
new file mode 100755 (executable)
index 0000000..34161d8
--- /dev/null
+++ b/po/lv.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Pievienots HID ierīcei"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB ir pievienots"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB piesaiste aktivizēta"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB atkļūdošana pievienota"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Izveidots savienojums ar USB piederumu"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printeris pievienots"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB savienotājs ir pievienots"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB savienotājs ir atvienots"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatūra pievienota"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Pele pievienota"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera pievienota"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB lielapj. atmiņa pievienota"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Pievienota nezināma USB ierīce"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB ierīce droši noņemta"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB lielapjoma atmiņa tika negaidīti noņemta"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Nevar lietot tālruņa iekšējo atmiņu kā USB lielapjoma atmiņu. Radās kļūda"
+
diff --git a/po/mk.po b/po/mk.po
new file mode 100755 (executable)
index 0000000..b27fd00
--- /dev/null
+++ b/po/mk.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Поврзано со уред HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Поврзано е USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Овозможено е делење преку USB"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Дебагирањето на USB е поврзано"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Поврзано со USB-додаток"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Поврзан е печатач"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Приклучокот за USB е поврзан"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Приклучокот за USB е откачен"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Поврзана е тастатура"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Поврзано е глувче"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Камерата е поврзана"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Поврзана е меморија USB"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Поврзан е непознат уред USB"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Уредот USB е безбедно отстранет"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Меморијата USB е извадена неочекувано"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Не може да се користи меморијата USB како мемориски уред USB. Дојде до грешка"
+
diff --git a/po/nb.po b/po/nb.po
new file mode 100755 (executable)
index 0000000..fbe62fa
--- /dev/null
+++ b/po/nb.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Tilkoblet til HID-enhet"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB tilkoblet"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-internettdeling aktivert"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-feilsøking tilkoblet"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Koblet til et USB-tilbehør"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Skriver tilkoblet"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-kontakt tilkoblet"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-kontakt frakoblet"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatur tilkoblet"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mus tilkoblet"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera tilkoblet"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-masselagringsenh. tilkobl."
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Ukjent USB-enhet tilkoblet"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-enhet trygt fjernet"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-masselagring ble uventet fjernet"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Kan ikke bruke USB-lagring som USB-masselagring. Det oppstod en feil"
+
diff --git a/po/nl_NL.po b/po/nl_NL.po
new file mode 100755 (executable)
index 0000000..9796faa
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Aangesloten op HID-apparaat"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB verbonden"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB-tethering ingeschakeld"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-foutopsporing aangesloten"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Verbonden met een USB-accessoire"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer aangesloten"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-connector aangesloten"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-connector losgekoppeld"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Toetsenbord aangesloten"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Muis aangesloten"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Camera aangesloten"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-massaopslag aangesloten"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Onbekend USB-apparaat aangesloten"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-apparaat veilig verwijderd"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-apparaat voor massaopslag onverwacht verwijderd"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Kan USB-opslag niet gebruiken als USB-massaopslag. Fout geretourneerd"
+
diff --git a/po/pl.po b/po/pl.po
new file mode 100755 (executable)
index 0000000..d95e7c7
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Podłączono do urządzenia HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Podłączono USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Udostępnianie USB włączone"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Debugowanie USB włączone"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Podłączono do akcesoria USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Drukarka podłączona"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Podłączono złącze USB"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Odłączono złącze USB"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klawiatura podłączona"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mysz podłączona"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Aparat podłączony"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Pamięć masowa USB podłączona"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Podłączono nieznane urządzenie USB"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Bezpiecznie usunięto urządzenie USB"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Niespodziewanie wyjęto pamięć masową USB"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Nie można użyć pamięci USB jako pamięci masowej USB. Wystąpił błąd"
+
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100755 (executable)
index 0000000..5f41d13
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Conectado a dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB conectado"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Compartilhamento de rede via USB ativado"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depuração de USB conectada"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Conectado a um acessório USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impressora conectada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conector USB ligado"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conector USB desligado"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclado conectado"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse conectado"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Câmera conectada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Armazen. massa USB conectado"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB desconhecido conectado"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB removido de forma segura"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Armazenamento USB removido inesperadamente"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Impossível utilizar armazenamento USB como armazenamento de massa USB. Ocorreu um erro"
+
diff --git a/po/pt_PT.po b/po/pt_PT.po
new file mode 100755 (executable)
index 0000000..17ba5a5
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Ligado a dispositivo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB ligada"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Ancoragem USB activada"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depuração de USB ligada"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Ligado a um acessório USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Impressora ligada"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conector USB ligado"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conector USB desligado"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Teclado ligado"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Rato ligado"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Câmara ligada"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Armazenamento massa USB ligado"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispositivo USB desconhecido ligado"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispositivo USB removido de forma segura"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Armazenamento de massa USB removido inesperadamente"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Impossível utilizar armazenamento USB como armazenamento de massa USB. Ocorreu um erro"
+
diff --git a/po/ro.po b/po/ro.po
new file mode 100755 (executable)
index 0000000..a9a5c41
--- /dev/null
+++ b/po/ro.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Conectat la dispozitivul HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Dispozitiv USB conectat"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Furnizarea de acces la Internet prin USB a fost activată"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Depanare USB conectată"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Conectat la un accesoriu USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Imprimantă conectată"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Conector USB conectat"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Conector USB deconectat"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatură conectată"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Mouse conectat"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Cameră conectată"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Memorie USB conectată"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Dispozitiv USB necunoscut conectat"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Dispozitiv USB eliminat în siguranţă"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Spaţiul de stocare în masă USB a fost eliminat în mod neaşteptat"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Imposibil de utilizat spaţiul de stocare USB ca spaţiu de stocare în masă USB. S-a produs o eroare"
+
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100755 (executable)
index 0000000..892ae42
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Подключено к устройству HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Подключено через USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Модем USB включен"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Отладка USB подключена"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Подключено к USB-аксессуару"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Принтер подключен"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Подключен USB-кабель"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-кабель отключен"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Клавиатура подключена"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Мышь подключена"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Камера подключена"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-носитель подключен"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Подключено неизвестное USB-устройство"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-устройство безопасно извлечено"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-носитель неожиданно извлечен"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Невозможно использовать внутреннюю память в качестве съемного USB-носителя. Произошла ошибка"
+
diff --git a/po/sk.po b/po/sk.po
new file mode 100755 (executable)
index 0000000..f967749
--- /dev/null
+++ b/po/sk.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Pripojené k zariadeniu HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB pripojené"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Zdieľanie pripojenia USB je povolené"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Ladenie USB pripojené"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Pripojené k príslušenstvu USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Tlačiareň je pripojená"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Konektor USB je pripojený"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Konektor USB je odpojený"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klávesnica je pripojená"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Myš je pripojená"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Fotoaparát je pripojený"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Veľk. pamäť USB je pripojená"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Pripojené je neznáme zariadenie USB"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Zariadenie USB bolo bezpečne odstránené"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Veľkokapacitný úložný priestor USB bol neočakávane odstránený"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Ukladací priestor USB sa nedá použiť ako veľkokapacitný ukladací priestor USB. Vyskytla sa chyba"
+
diff --git a/po/sl.po b/po/sl.po
new file mode 100755 (executable)
index 0000000..2859a80
--- /dev/null
+++ b/po/sl.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Vzpostavljena povezava z napravo HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Povezava USB je vzpostavljena"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Uporaba vmesnika USB v telefonu kot modem omogočena"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB iskanje napak je povezano"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Povezan z dodatkom USB"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Tiskalnik je povezan"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "Priključek USB je povezan"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "Priključek USB ni povezan"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tipkovnica je povezana"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Miška je povezana"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera je povezana"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "Pomnilnik USB je povezan"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Neznana naprava USB je povezana"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "Naprava USB je bil varno odstranjena"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "Pomnilnik USB je bil nepričakovano odstranjen"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Pomnilnika USB ni mogoče uporabiti kot napravo USB za shranjevanje. Prišlo je do napake"
+
diff --git a/po/sr.po b/po/sr.po
new file mode 100755 (executable)
index 0000000..887efdf
--- /dev/null
+++ b/po/sr.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Povezan na HID uređaj"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB priključen"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB vezivanje je omogućeno"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Uključeno otkrivanje grešaka putem USB-a"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Povezan na USB pribor"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Štampač je priključen"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB priključak je povezan"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB priključak je isključen"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tastatura je priključena"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Miš je priključen"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera je priključena"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB mas. memorija je priključ."
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Priključen je nepoznati USB uređaj"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB uređaj je bezbedno uklonjen"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB masovna memorija je neočekivano uklonjena"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Nije moguće koristiti USB memoriju kao USB masovnu memoriju. Došlo je do greške"
+
diff --git a/po/sv.po b/po/sv.po
new file mode 100755 (executable)
index 0000000..71563a6
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Ansluten till HID-enhet"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB har anslutits"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Internetdelning via USB är aktiverat"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB-felsökning har anslutits"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Ansluten till USB-utrustning"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Skrivare ansluten"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-koppling ansluten"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-koppling frånkopplad"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Tangentbord anslutet"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Musen har anslutits"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera ansluten"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-masslagring ansluten"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Okänd USB-enhet ansluten"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-enhet bortkopplad"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-masslagringen togs oväntat bort"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Det går inte att använda USB-lagring som USB-masslagring. Ett fel inträffade"
+
diff --git a/po/tr_TR.po b/po/tr_TR.po
new file mode 100755 (executable)
index 0000000..c71ea17
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID cihazına bağlandı"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB bağlandı"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB bağlanma etkin"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB hata ayıklama bağlandı"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Bir USB aksesuarına bağlandı"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Yazıcı bağlı"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB bağlayıcı takıldı"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB bağlayıcı çıkartıldı"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klavye bağlandı"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Fare bağlı"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera takılı"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB yığın depolama bağlı"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Bilinmeyen USB cihazı takıldı"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB aygıtı güvenli bir şekilde çıkartıldı"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB yığın depolama beklenmedik şekilde çıkarıldı"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB belleği USB yığın bellek olarak kullanılamıyor. Hata oluştu"
+
diff --git a/po/uk.po b/po/uk.po
new file mode 100755 (executable)
index 0000000..7a6cffd
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "Підключено до пристрою HID"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "Підключено USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "Прив’язку USB ввімкнено"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "Налагодження USB підключено"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "Підключено до USB-пристрою"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Принтер підключено"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "З’єднувач USB підключено"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "З’єднувач USB від’єднано"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Клавіатуру підключено"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Мишу підключено"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Камеру підключено"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-накопичувач підключено"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Невідомий USB-пристрій підключено"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB-пристрій безпечно видалено"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-накопичувач неочікувано вийнято"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "Неможливо використати внутрішню пам’ять як USB-накопичувач. Сталася помилка"
+
diff --git a/po/uz.po b/po/uz.po
new file mode 100755 (executable)
index 0000000..73877e7
--- /dev/null
+++ b/po/uz.po
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "HID qurilmaga ulandi"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB ulangan"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB bog‘lanish yoqilgan"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB vositalari ulandi"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "USB aksessuariga ulandi"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "Printer ulandi"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "USB-ulash vositasi ulandi"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "USB-ulash vositasi uzildi"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "Klaviatura ulandi"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "Sichqoncha ulandi"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "Kamera ulandi"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB-katta hajmli xotira ulandi"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "Noma’lum USB-qurilma ulandi"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "USB qurilma xavfsiz chiqarib olindi"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB-katta hajmli xotira kutilmaganda chiqarib olindi"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "USB-ichki xotiradan katta hajmli xotira sifatida foydalanib bo‘lmaydi. Xato yuzaga keldi"
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100755 (executable)
index 0000000..9384d56
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "已连接到HID设备"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "已连接USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB tethering 已启用"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB调试已连接"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "已连接至 USB 附件"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "打印机已连接"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "已连接USB连接器"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "已断开USB连接器"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "键盘已连接"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "鼠标已连接"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "摄像头已连接"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB 大容量存储已连接"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "已连接未知USB设备"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "已安全移除USB设备"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB 大容量存储已意外移除"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "无法使用USB存储为USB大容量存储。出现错误"
+
diff --git a/po/zh_HK.po b/po/zh_HK.po
new file mode 100755 (executable)
index 0000000..5a2a3bf
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "已連接至 HID 裝置"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB 已連接"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "已啟用 USB 網絡共享"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "已連接USB除錯"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "已連接至 USB 配件"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "打印機已連接"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "已連接 USB 連接器"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "已中斷 USB 連接器連接"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "鍵盤已連接"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "滑鼠已連接"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "相機已連接"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB 大容量儲存裝置已連接"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "未知 USB 裝置已連接"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "已安全移除 USB 裝置"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB 大容量儲存裝置被意外移除"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "無法使用 USB 儲存裝置為 USB 大容量儲存裝置。發生錯誤"
+
diff --git a/po/zh_SG.po b/po/zh_SG.po
new file mode 100755 (executable)
index 0000000..9a6fea3
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "已连接到HID设备"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "已连接USB"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "USB网络分享已启用"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB调试已连接"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "已连接至 USB 附件"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "打印机已连接"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "已连接USB连接器"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "已断开USB连接器"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "键盘已连接"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "鼠标已连接"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "摄像头已连接"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB 大容量存储已连接"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "已连接未知USB设备"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "已安全移除USB设备"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB 大容量存储已意外移除"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "无法使用USB存储为USB大容量存储。出现错误"
+
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100755 (executable)
index 0000000..6ef3c23
--- /dev/null
@@ -0,0 +1,48 @@
+msgid "IDS_BT_POP_CONNECTED_TO_HID_DEVICE"
+msgstr "連接HID設備"
+
+msgid "IDS_COM_BODY_USB_CONNECTED"
+msgstr "USB 已連接"
+
+msgid "IDS_ST_HEADER_USB_TETHERING_ENABLED"
+msgstr "已啟用 USB 網路共享"
+
+msgid "IDS_HS_HEADER_USB_DEBUGGING_CONNECTED"
+msgstr "USB偵錯已連結"
+
+msgid "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY"
+msgstr "已連接至 USB 配件"
+
+msgid "IDS_COM_POP_PRINTER_CONNECTED_ABB2"
+msgstr "印表機已連接"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_CONNECTED"
+msgstr "已連接 USB 連接器"
+
+msgid "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED"
+msgstr "已中斷 USB 連接器連接"
+
+msgid "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"
+msgstr "鍵盤已連接"
+
+msgid "IDS_COM_POP_MOUSE_CONNECTED_ABB2"
+msgstr "滑鼠已連接"
+
+msgid "IDS_COM_POP_CAMERA_CONNECTED_ABB2"
+msgstr "相機已連接"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2"
+msgstr "USB 大容量儲存裝置已連接"
+
+msgid "IDS_COM_POP_UNKNOWN_USB_DEVICE_CONNECTED"
+msgstr "未知的 USB 裝置已連接"
+
+msgid "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED"
+msgstr "已安全移除 USB 裝置"
+
+msgid "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED"
+msgstr "USB 大量儲存裝置被意外移除"
+
+msgid "IDS_COM_BODY_UNABLE_TO_USE_USB_STORAGE_AS_USB_MASS_STORAGE_ERROR_OCCURRED"
+msgstr "無法將 USB 儲存裝置做為 USB 大容量儲存裝置使用。發生錯誤"
+
diff --git a/set_usb_debug.sh b/set_usb_debug.sh
new file mode 100755 (executable)
index 0000000..4872d37
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+if [ "$1" = "--set" ]
+then
+       vconftool set -t bool db/setting/debug_mode "1" -f
+       echo "Debug mode is loaded"
+
+elif [ "$1" = "--unset" ]
+then
+       vconftool set -t bool db/setting/debug_mode "0" -f
+       echo "USB default mode is loaded"
+
+elif [ "$1" = "--debug" ]
+then
+       vconftool set -t bool db/setting/debug_mode "1" -f
+       echo "Debug mode is loaded"
+       vconftool set -t int db/setting/lcd_backlight_normal "600" -f
+       echo "The backlight time of the display is set to 10 minutes"
+       vconftool set -t bool db/setting/brightness_automatic "1" -f
+       echo "Brightness is set automatic"
+
+elif [ "$1" = "--sshon" ]
+then
+       vconftool set -t int memory/setting/usb_sel_mode "3" -f
+       vconftool set -t int db/usb/keep_ethernet "1" -f
+       echo "SSH is enabled"
+
+elif [ "$1" = "--sshoff" ]
+then
+       vconftool set -t int memory/setting/usb_sel_mode "0" -f
+       vconftool set -t int db/usb/keep_ethernet "0" -f
+       echo "SSH is disabled"
+
+
+elif [ "$1" = "--help" ]
+then
+       echo "set_usb_debug.sh: usage:"
+       echo "    --help      this message "
+       echo "    --set       load Debug mode"
+       echo "    --unset     unload Debug mode"
+       echo "    --debug     load debug mode with 10 minutes backlight time and automatic brightness"
+       echo "    --sshon     load SSH mode"
+       echo "    --sshoff    unload SSH mode"
+
+else
+       echo "Wrong parameters. Please use option --help to check options "
+
+fi
diff --git a/src/um_common.c b/src/um_common.c
new file mode 100644 (file)
index 0000000..93281c8
--- /dev/null
@@ -0,0 +1,314 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vconf.h>
+#include <devman.h>
+#include "um_common.h"
+
+int check_usbclient_connection()
+{
+       __USB_FUNC_ENTER__ ;
+       int status = -1;
+       int ret = -1;
+       ret = vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, &status);
+       if(0 == ret && VCONFKEY_SYSMAN_USB_AVAILABLE == status) {
+               USB_LOG("USB connection status: %d", status);
+               __USB_FUNC_EXIT__ ;
+               return USB_CLIENT_CONNECTED;
+       }
+       __USB_FUNC_EXIT__ ;
+       return USB_CLIENT_DISCONNECTED;
+}
+
+int check_usbhost_connection()
+{
+       __USB_FUNC_ENTER__ ;
+       int status = -1;
+       int ret = -1;
+       ret = vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &status);
+       if(0 == ret && VCONFKEY_SYSMAN_USB_HOST_CONNECTED == status) {
+               USB_LOG("USB connection status: %d", status);
+               __USB_FUNC_EXIT__ ;
+               return USB_HOST_CONNECTED;
+       }
+       __USB_FUNC_EXIT__ ;
+       return USB_HOST_DISCONNECTED;
+}
+
+int launch_usb_syspopup(UmMainData *ad, POPUP_TYPE _popup_type)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       int ret = -1;
+       char syspopup_key[SYSPOPUP_PARAM_LEN];
+       char syspopup_value[ACC_ELEMENT_LEN];
+
+       bundle *b = NULL;
+       b = bundle_create();
+       um_retvm_if (!b, -1, "FAIL: bundle_create()\n");
+
+       snprintf(syspopup_key, SYSPOPUP_PARAM_LEN, "%d", SYSPOPUP_TYPE);
+       snprintf(syspopup_value, ACC_ELEMENT_LEN, "%d", _popup_type);
+       ret = bundle_add(b, syspopup_key, syspopup_value);
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       if (SELECT_PKG_FOR_ACC_POPUP == _popup_type) {
+               int i;
+               char device[ACC_INFO_NUM][ACC_ELEMENT_LEN];
+               snprintf(device[ACC_MANUFACTURER], ACC_ELEMENT_LEN, "%s", ad->usbAcc->manufacturer);
+               snprintf(device[ACC_MODEL], ACC_ELEMENT_LEN, "%s", ad->usbAcc->model);
+               snprintf(device[ACC_DESCRIPTION], ACC_ELEMENT_LEN, "%s", ad->usbAcc->description);
+               snprintf(device[ACC_VERSION], ACC_ELEMENT_LEN, "%s", ad->usbAcc->version);
+               snprintf(device[ACC_URI], ACC_ELEMENT_LEN, "%s", ad->usbAcc->uri);
+               snprintf(device[ACC_SERIAL], ACC_ELEMENT_LEN, "%s", ad->usbAcc->serial);
+               for ( i = 0; i < ACC_INFO_NUM ; i++) {
+                       snprintf(syspopup_key, SYSPOPUP_PARAM_LEN, "%d", 1 + i);
+                       snprintf(syspopup_value, ACC_ELEMENT_LEN, "%s", device[i]);
+                       USB_LOG("key: %s, value: %s\n", syspopup_key, syspopup_value);
+                       ret = bundle_add(b, syspopup_key, syspopup_value);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: bundle_add()\n");
+                               if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+                               return -1;
+                       }
+               }
+       }
+
+       ret = syspopup_launch(USB_SYSPOPUP, b);
+       if (0 > ret) {
+               USB_LOG("FAIL: syspopup_launch() returns %d\n", ret);
+               if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = bundle_free(b);
+       um_retvm_if (0 != ret, -1, "FAIL: bundle_free()\n");
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+void load_system_popup(UmMainData *ad, POPUP_TYPE _popup_type)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return ;
+       int ret = -1;
+       ret = launch_usb_syspopup(ad, _popup_type);
+       if (0 != ret) {
+               USB_LOG("FAIL: launch_usb_syspopup(_popup_type)\n");
+       }
+       __USB_FUNC_EXIT__ ;
+}
+
+int load_system_popup_with_deviceinfo(UmMainData *ad,
+                                                                               POPUP_TYPE _popup_type,
+                                                                               int class,
+                                                                               int subClass,
+                                                                               int protocol,
+                                                                               int vendor,
+                                                                               int product)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       int ret = -1;
+       char syspopup_key[SYSPOPUP_PARAM_LEN];
+       char syspopup_value[ACC_ELEMENT_LEN];
+
+       bundle *b = NULL;
+       b = bundle_create();
+       um_retvm_if (!b, -1, "FAIL: bundle_create()\n");
+
+       snprintf(syspopup_key, SYSPOPUP_PARAM_LEN, "%d", SYSPOPUP_TYPE);
+       snprintf(syspopup_value, ACC_ELEMENT_LEN, "%d", _popup_type);
+       ret = bundle_add(b, syspopup_key, syspopup_value);
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       if (SELECT_PKG_FOR_HOST_POPUP == _popup_type) {
+               if (ad->devList != NULL) {
+                       int i;
+                       char device[HOST_INFO_NUM][HOST_ELEMENT_LEN];
+                       snprintf(device[HOST_CLASS - HOST_CLASS], HOST_ELEMENT_LEN, "%d", class);
+                       snprintf(device[HOST_SUBCLASS - HOST_CLASS], HOST_ELEMENT_LEN, "%d", subClass);
+                       snprintf(device[HOST_PROTOCOL - HOST_CLASS], HOST_ELEMENT_LEN, "%d", protocol);
+                       snprintf(device[HOST_IDVENDOR - HOST_CLASS], HOST_ELEMENT_LEN, "%d", vendor);
+                       snprintf(device[HOST_IDPRODUCT - HOST_CLASS], HOST_ELEMENT_LEN, "%d", product);
+                       for (i = 0; i < HOST_INFO_NUM ; i++) {
+                               snprintf(syspopup_key, SYSPOPUP_PARAM_LEN, "%d", HOST_CLASS + i);
+                               snprintf(syspopup_value, ACC_ELEMENT_LEN, "%s", device[i]);
+                               ret = bundle_add(b, syspopup_key, syspopup_value);
+                               if (0 != ret) {
+                                       USB_LOG("FAIL: bundle_add()\n");
+                                       if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+                                       return -1;
+                               }
+                       }
+               }
+       }
+
+       ret = syspopup_launch(USB_SYSPOPUP, b);
+       if (0 > ret) {
+               USB_LOG("FAIL: syspopup_launch() returns %d\n", ret);
+               if (0 != bundle_free(b)) USB_LOG("FAIL: bundle_free()\n");
+               return -1;
+       }
+
+       ret = bundle_free(b);
+       um_retvm_if (0 != ret, -1, "FAIL: bundle_free()\n");
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+int ipc_request_server_init()
+{
+       __USB_FUNC_ENTER__ ;
+       int len, t;
+       int sockFd = -1;
+       struct sockaddr_un local;
+
+       if ((sockFd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+               perror("socket");
+               USB_LOG("FAIL: socket(AF_UNIX, SOCK_STREAM, 0)");
+               return -1;
+       }
+       local.sun_family = AF_UNIX;
+       strncpy(local.sun_path, SOCK_PATH, strlen(SOCK_PATH)+1);
+       unlink(local.sun_path);
+       len = strlen(local.sun_path) + sizeof(local.sun_family);
+
+       if (bind(sockFd, (struct sockaddr *)&local, len) == -1) {
+               perror("bind");
+               USB_LOG("FAIL: bind((*sock_local), (struct sockaddr *)&local, len)");
+               close(sockFd);
+               return -1;
+       }
+       chown(SOCK_PATH, 5000, 5000);
+       chmod(SOCK_PATH, 0777);
+       if (listen(sockFd, 5) == -1) {
+               perror("listen");
+               USB_LOG("FAIL: listen((*sock_local), 5)");
+               close(sockFd);
+               return -1;
+       }
+       __USB_FUNC_EXIT__ ;
+       return sockFd;
+}
+
+int ipc_request_server_close(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if (ad->server_sock_local > 0)
+               close(ad->server_sock_local);
+       if (ad->server_sock_remote > 0)
+               close(ad->server_sock_remote);
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+
+/* This function initializes socket for ipc with usb-server */
+int ipc_noti_server_init()
+{
+       __USB_FUNC_ENTER__ ;
+       int len;
+       int sock_remote;
+       struct sockaddr_un remote;
+       if ((sock_remote = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+               perror("socket");
+               USB_LOG("FAIL: socket(AF_UNIX, SOCK_STREAM, 0)");
+               return -1;
+       }
+       remote.sun_family = AF_UNIX;
+       strncpy(remote.sun_path, ACC_SOCK_PATH, strlen(SOCK_PATH)+1);
+       len = strlen(remote.sun_path) + sizeof(remote.sun_family);
+
+       if (connect(sock_remote, (struct sockaddr *)&remote, len) == -1) {
+               perror("connect");
+               USB_LOG("FAIL: connect(sock_remote, (struct sockaddr *)&remote, len)");
+               close(sock_remote);
+               return -1;
+       }
+       __USB_FUNC_EXIT__ ;
+       return sock_remote;
+}
+
+/* This function closes socket for ipc with usb-server */
+int ipc_noti_server_close(int *sock_remote)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!sock_remote) return -1;
+       close (*sock_remote);
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+/* This function notices something to client app by ipc with socket and gets the results */
+int notice_to_client_app(int sock_remote, int request, char *answer)
+{
+       __USB_FUNC_ENTER__ ;
+       int t;
+       char str[SOCK_STR_LEN];
+       USB_LOG("notice: %d\n", request);
+       snprintf(str, SOCK_STR_LEN, "%d", request);
+       if (send (sock_remote, str, strlen(str)+1, 0) == -1) {
+               USB_LOG("FAIL: send (sock_remote, str, strlen(str)+1, 0)\n");
+               return -1;
+       }
+       if ((t = recv(sock_remote, answer, SOCK_STR_LEN, 0)) > 0) {
+               if (t < SOCK_STR_LEN) {
+                       answer[t] = '\0';
+               } else { /* t == SOCK_STR_LEN */
+                       answer[SOCK_STR_LEN-1] = '\0';
+               }
+               USB_LOG("[CLIENT] Received value: %s\n", answer);
+       } else {
+               USB_LOG("FAIL: recv(sock_remote, str, SOCK_STR_LEN, 0)\n");
+               return -1;
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+bool is_emul_bin()
+{
+       __USB_FUNC_ENTER__ ;
+       int ret = -1;
+       struct utsname name;
+       ret = uname(&name);
+       if (ret < 0) {
+               __USB_FUNC_EXIT__ ;
+               return true;
+       } else {
+               USB_LOG("Machine name: %s", name.machine);
+               if (strcasestr(name.machine, "emul")) {
+                       __USB_FUNC_EXIT__ ;
+                       return true;
+               } else {
+                       __USB_FUNC_EXIT__ ;
+                       return false;
+               }
+       }
+}
+
diff --git a/src/um_customize.c b/src/um_customize.c
new file mode 100644 (file)
index 0000000..5b52b78
--- /dev/null
@@ -0,0 +1,603 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_customize.h"
+
+/* If other kernel versions are added, we should modify this function */
+int check_driver_version(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+
+       if(!ad) return -1;
+       char buffer[DRIVER_VERSION_BUF_LEN];
+
+       FILE *fp = NULL;
+
+       if (access(DRIVER_VERSION_PATH, F_OK) != 0) {
+               USB_LOG("This kernel is for C210\n");
+               ad->driverVersion = USB_DRIVER_0_0;
+       } else {
+               fp = fopen(DRIVER_VERSION_PATH, "r");
+               um_retvm_if(fp == NULL, -1, "FAIL: fopen(%s)\n", DRIVER_VERSION_PATH);
+
+               if (fgets(buffer, DRIVER_VERSION_BUF_LEN, fp) == NULL) {
+                       USB_LOG("FAIL: fgets(%s)\n", DRIVER_VERSION_PATH);
+                       if (fclose(fp) != 0) {
+                               USB_LOG("FAIL: fclose(fp)\n");
+                       }
+                       return -1;
+               }
+
+               if (fclose(fp) != 0) {
+                       USB_LOG("FAIL: fclose(fp)\n");
+                       return -1;
+               }
+
+               if (strncmp(buffer, DRIVER_VERSION_1_0, strlen(DRIVER_VERSION_1_0)) == 0 ) {
+                       USB_LOG("The driver version is 1.0 \n");
+                       ad->driverVersion = USB_DRIVER_1_0;
+               } else if (strncmp(buffer, DRIVER_VERSION_1_1, strlen(DRIVER_VERSION_1_1)) == 0) {
+                       USB_LOG("The driver version is 1.1 \n");
+                       ad->driverVersion = USB_DRIVER_1_1;
+               } else {
+                       USB_LOG("This kernel version is unknown\n");
+                       return -1;
+               }
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+int mode_set_kernel(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       int ret = -1;
+       switch(ad->driverVersion) {
+       case USB_DRIVER_0_0:
+               USB_LOG("USB driver version is 0.0");
+               ret = mode_set_driver_0_0(mode);
+               um_retvm_if (0 != ret, -1, "FAIL: mode_set_driver_0_0(mode)\n");
+               break;
+       case USB_DRIVER_1_0:
+               USB_LOG("USB driver version is 1.0");
+               ret = mode_set_driver_1_0(ad, mode);
+               um_retvm_if (0 != ret, -1, "FAIL: mode_set_driver_1_0(mode)\n");
+               break;
+       case USB_DRIVER_1_1:
+               USB_LOG("USB driver version is 1.1");
+               ret = mode_set_driver_1_1(ad, mode);
+               um_retvm_if (0 != ret, -1, "FAIL: mode_set_driver_1_1(mode)\n")
+               break;
+
+       /* If other kernel versions are added, add functions here that notice USB mode to the kernel */
+
+       default:
+               USB_LOG("This version of kernel is not registered to usb-server.\n");
+               __USB_FUNC_EXIT__ ;
+               return -1;
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+static int mode_set_driver_0_0(int mode)
+{
+       __USB_FUNC_ENTER__ ;
+
+       char buf[DRIVER_VERSION_BUF_LEN];
+       int ret = -1;
+
+       switch(mode)
+       {
+       case SETTING_USB_DEFAULT_MODE:
+       case SETTING_USB_NONE_MODE:
+               USB_LOG("Mode : SETTING_USB_DEFAULT_MODE mode_set_kernel\n");
+               snprintf(buf, KERNEL_SET_BUF_SIZE, "%d", KERNEL_DEFAULT_MODE);
+               break;
+       case SETTING_USB_ETHERNET_MODE:
+               USB_LOG("Mode : USB_ETHERNET_MODE mode_set_kernel\n");
+               snprintf(buf, KERNEL_SET_BUF_SIZE, "%d", KERNEL_ETHERNET_MODE);
+               break;
+       case SETTING_USB_ACCESSORY_MODE:
+               USB_LOG("Mode : USB accessory is not supported in USB driver 0.0(C210)\n");
+               return 0;
+       default:
+               USB_LOG("ERROR : parameter is not available(mode : %d)\n", mode);
+               __USB_FUNC_EXIT__ ;
+               return -1;
+       }
+
+       ret = write_file(KERNEL_SET_PATH, buf);
+       um_retvm_if (EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", KERNEL_SET_PATH);
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+static int driver_1_0_kernel_node_set(char *vendor_id,
+                                     char *product_id,
+                                     char *functions,
+                                     char *device_class,
+                                     char *device_subclass,
+                                     char *device_protocol)
+{
+       __USB_FUNC_ENTER__ ;
+       if (vendor_id == NULL || product_id == NULL || device_class == NULL
+               || functions == NULL || device_subclass == NULL || device_protocol == NULL) {
+               USB_LOG("ERROR: There are parameters whose value is NULL\n");
+               return -1;
+       }
+       int ret = -1;
+
+       ret = write_file(USB_MODE_ENABLE, "0");
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+
+       ret = write_file(USB_VENDOR_ID, vendor_id);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_VENDOR_ID);
+
+       ret = write_file(USB_PRODUCT_ID, product_id);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_PRODUCT_ID);
+
+       ret = write_file(USB_FUNCTIONS, functions);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_FUNCTIONS);
+
+       ret = write_file(USB_DEVICE_CLASS, device_class);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_CLASS);
+
+       ret = write_file(USB_DEVICE_SUBCLASS, device_subclass);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_SUBCLASS);
+
+       ret = write_file(USB_DEVICE_PROTOCOL, device_protocol);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_PROTOCOL);
+
+       ret = write_file(USB_MODE_ENABLE, "1");
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+static int mode_set_driver_1_0(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       int ret = -1;
+
+       switch(mode)
+       {
+       case SETTING_USB_DEFAULT_MODE:
+               USB_LOG("Mode : SETTING_USB_DEFAULT_MODE mode_set_kernel\n");
+#ifndef SIMULATOR
+               if (ad->curDebugMode) {
+                       ret = driver_1_0_kernel_node_set("04e8", "6860", "mtp,acm,sdb",
+                                                       "239", "2", "1");
+               } else {
+                       ret = driver_1_0_kernel_node_set("04e8", "6860", "mtp,acm",
+                                                       "239", "2", "1");
+               }
+#else
+               ret = driver_1_0_kernel_node_set("04e8", "6860", "mtp,acm,sdb",
+                                                       "239", "2", "1");
+#endif
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_ETHERNET_MODE:
+       case SETTING_USB_TETHERING_MODE:
+               USB_LOG("Mode : USB_ETHERNET or TETHERING_MODE mode_set_kernel\n");
+               ret = driver_1_0_kernel_node_set("04e8", "6864", "rndis", "239", "2", "1");
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_ACCESSORY_MODE:
+               USB_LOG("Mode : USB_ACCESSORY_MODE mode_set_kernel\n");
+               ret = driver_1_0_kernel_node_set("18d1", "2d00", "accessory", "0", "0", "0");
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_NONE_MODE:
+               USB_LOG("Mode : USB_NONE_MODE mode_set_kernel\n");
+               ret = write_file(USB_MODE_ENABLE, "0");
+               um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+               __USB_FUNC_EXIT__ ;
+               return 0;
+
+       default:
+               USB_LOG("ERROR : parameter is not available(mode : %d)\n", mode);
+               __USB_FUNC_EXIT__ ;
+               return ret;
+       }
+}
+
+static int driver_1_1_kernel_node_set(char *vendor_id,
+                                     char *product_id,
+                                     char *funcs_fconf,
+                                     char *funcs_sconf,
+                                     char *device_class,
+                                     char *device_subclass,
+                                     char *device_protocol)
+{
+       __USB_FUNC_ENTER__ ;
+       if (vendor_id == NULL || product_id == NULL || funcs_fconf == NULL
+               || funcs_sconf == NULL || device_class == NULL
+               || device_subclass == NULL || device_protocol == NULL) {
+               USB_LOG("ERROR: There are parameters whose value is NULL\n");
+               return -1;
+       }
+       int ret = -1;
+
+       ret = write_file(USB_MODE_ENABLE, "0");
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+
+       ret = write_file(USB_VENDOR_ID, vendor_id);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_VENDOR_ID);
+
+       ret = write_file(USB_PRODUCT_ID, product_id);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_PRODUCT_ID);
+
+       ret = write_file(USB_FUNCS_FCONF, funcs_fconf);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_FUNCS_FCONF);
+
+       ret = write_file(USB_FUNCS_SCONF, funcs_sconf);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_FUNCS_SCONF);
+
+       ret = write_file(USB_DEVICE_CLASS, device_class);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_CLASS);
+
+       ret = write_file(USB_DEVICE_SUBCLASS, device_subclass);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_SUBCLASS);
+
+       ret = write_file(USB_DEVICE_PROTOCOL, device_protocol);
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_DEVICE_PROTOCOL);
+
+       ret = write_file(USB_MODE_ENABLE, "1");
+       um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+static int mode_set_driver_1_1(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       int ret = -1;
+
+       switch(mode)
+       {
+       case SETTING_USB_DEFAULT_MODE:
+               USB_LOG("Mode : SETTING_USB_DEFAULT mode_set_kernel\n");
+#ifndef SIMULATOR
+               if (ad->curDebugMode) {
+                       ret = driver_1_1_kernel_node_set("04e8", "6860", "mtp", "mtp,acm,sdb",
+                                                               "239", "2", "1");
+               } else {
+                       ret = driver_1_1_kernel_node_set("04e8", "6860", "mtp", "mtp,acm",
+                                                               "239", "2", "1");
+               }
+#else
+               ret = driver_1_1_kernel_node_set("04e8", "6860", "mtp", "mtp,acm,sdb",
+                                                               "239", "2", "1");
+#endif
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_ETHERNET_MODE:
+       case SETTING_USB_TETHERING_MODE:
+               USB_LOG("Mode : USB_ETHERNET or TETHERING_MODE mode_set_kernel\n");
+               ret = driver_1_1_kernel_node_set("04e8", "6864", "rndis", " ",
+                                               "239", "2", "1");
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_ACCESSORY_MODE:
+               USB_LOG("Mode : USB_ACCESSORY_MODE mode_set_kernel\n");
+               ret = driver_1_1_kernel_node_set("18d1", "2d00", "accessory", " ",
+                                               "0", "0", "0");
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       case SETTING_USB_NONE_MODE:
+               USB_LOG("Mode : USB_NONE_MODE mode_set_kernel\n");
+               ret = write_file(USB_MODE_ENABLE, "0");
+               um_retvm_if(EINA_FALSE == ret, -1, "FAIL: write_file(%s)\n", USB_MODE_ENABLE);
+               __USB_FUNC_EXIT__ ;
+               return ret;
+
+       default:
+               USB_LOG("ERROR : parameter is not available(mode : %d)\n", mode);
+               __USB_FUNC_EXIT__ ;
+               return ret;
+       }
+}
+
+void start_dr(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return ;
+       call_cmd(CMD_DR_START);
+       __USB_FUNC_EXIT__ ;
+}
+
+static Eina_Bool write_file(const char *filepath, char *content)
+{
+       __USB_FUNC_ENTER__ ;
+
+       if(!filepath || !content) return EINA_FALSE;
+       FILE *fp;
+       int ret = -1;
+
+       fp = fopen(filepath, "w");
+       um_retvm_if (fp == NULL, EINA_FALSE, "FAIL: fopen(%s)\n", filepath);
+
+       ret = fwrite(content, sizeof(char), strlen(content), fp);
+       if ( ret < strlen(content)) {
+               USB_LOG("FAIL: fwrite()\n");
+               ret = fclose(fp);
+               if(ret != 0) USB_LOG("FAIL : fclose()\n");
+               return EINA_FALSE;
+       }
+
+       ret = fclose(fp);
+       um_retvm_if (ret != 0, EINA_FALSE, "FAIL: result of fclose() is %d\n", ret);
+
+       __USB_FUNC_EXIT__ ;
+       return EINA_TRUE;
+}
+
+static int get_device_desc_info(char *buf, char *descType, int *descValue)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!buf || !descType || !descValue) return -1;
+       char *found = NULL;
+       char *tmp = NULL;
+
+       found = strstr(buf, descType);
+       if (found == NULL) {
+               USB_LOG("FAIL: strnstr(%s)", descType);
+               return -1;
+       }
+       found = found + strlen(descType);
+       while(*found == ' ') {
+               found++;
+       }
+       tmp = strstr(found, " ");
+       if (tmp != NULL) *tmp = '\0';
+
+       *descValue = strtoul(found, &tmp, 16);
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+int store_default_device_info( UmMainData *ad,
+                                                                               int class,
+                                                                               int subClass,
+                                                                               int protocol,
+                                                                               int vendor,
+                                                                               int product,
+                                                                               int bus,
+                                                                               int devAddress)
+{
+       __USB_FUNC_ENTER__ ;
+       UsbHost *device = (UsbHost *)malloc(sizeof(UsbHost));
+       device->permittedAppId = NULL;
+       device->deviceClass = class;
+       device->deviceSubClass = subClass;
+       device->deviceProtocol = protocol;
+       device->idVendor = vendor;
+       device->idProduct = product;
+       device->bus = bus;
+       device->deviceAddress = devAddress;
+       ad->defaultDevList = g_list_append(ad->defaultDevList, device);
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+int get_default_usb_device(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if (!ad) return -1;
+       FILE *fp;
+       int ret = -1;
+       char buf[BUF_MAX];
+       bool checkIF = false;
+       char *found = NULL;
+       int defClass = -1;
+       int defSubClass = -1;
+       int defProtocol = -1;
+       int defVendor = -1;
+       int defProduct = -1;
+       int defBus = -1;
+       int defDevAddress = -1;
+
+       ret = access("/tmp/usb_default", F_OK);
+       /*  The file does not exist if default usb device does not exist */
+       um_retvm_if(ret < 0, 0, "usb_default file does not exist.");
+
+       fp = fopen("/tmp/usb_default", "r");
+       um_retvm_if(fp == NULL, -1, "FAIL: fopen()");
+
+       FREE(ad->defaultDevList);
+
+       while(fgets(buf, BUF_MAX, fp)) {
+               USB_LOG("BUF: %s", buf);
+
+               /* 'D' means device descriptor which has information of class, subclass, and protocol */
+               /* 'P' also means device descriptor which has information of vendor and product */
+               /* 'I' means interface descriptor which has information of class, subclass, and protocol */
+               /* 'T' means Topology of devices which has information of bus number and device address */
+               if (*buf == 'D' || *buf == 'I') {
+                       if (*buf == 'I' && checkIF == false) {
+                               USB_LOG("Device class is located in the device descriptor");
+                               continue;
+                       }
+
+                       USB_LOG("Found the information of class, subclass, and protocol");
+                       /* Getting Protocol */
+                       ret = get_device_desc_info(buf, "Prot=", &defProtocol);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(Protocol)");
+
+                       /* Getting SubClass */
+                       ret = get_device_desc_info(buf, "Sub=", &defSubClass);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(SubClass)");
+
+                       /* Getting Class */
+                       ret = get_device_desc_info(buf, "Cls=", &defClass);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(Class)");
+
+                       /* Deciding whether or not checking interface */
+                       if (*buf == 'D' && defClass <= 0) {
+                               USB_LOG("Device class is located in the interface decsriptor");
+                               checkIF = true;
+                       } else if (*buf == 'I' && checkIF == true) {
+                               USB_LOG("Device class is stored from interface descriptor");
+                               checkIF = false;
+                       }
+               } else if (*buf == 'T') {
+                       USB_LOG("Found the information of bus number and device address");
+
+                       /* Getting Bus number */
+                       ret = get_device_desc_info(buf, "Dev#=", &defDevAddress);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(devAddress)");
+
+                       /* Getting device address */
+                       ret = get_device_desc_info(buf, "Bus=", &defBus);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(bus)");
+
+               } else if (*buf == 'P') {
+                       USB_LOG("Found the information of vendor and product");
+                       /* Getting Product ID */
+                       ret = get_device_desc_info(buf, "ProdID=", &defProduct);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(ProductID)");
+
+                       /* Getting Vendor ID */
+                       ret = get_device_desc_info(buf, "Vendor=", &defVendor);
+                       if (ret < 0) USB_LOG("FAIL: get_device_desc_info(Vendor)");
+
+               } else {
+                       USB_LOG("Cannot find device information");
+               }
+
+               if (defClass > 0 && defVendor >= 0) {
+                       ret = store_default_device_info(ad, defClass, defSubClass, defProtocol,
+                                                                               defVendor, defProduct, defBus, defDevAddress);
+                       if (ret < 0) {
+                               USB_LOG("FAIL: store_default_device_info()");
+                       }
+                       defClass = -1;
+                       defSubClass = -1;
+                       defProtocol = -1;
+                       defVendor = -1;
+                       defProduct = -1;
+                       defBus = -1;
+                       defDevAddress = -1;
+               }
+       }
+
+       fclose(fp);
+       USB_LOG("Number of default devices: %d", g_list_length(ad->defaultDevList));
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+bool is_device_supported(int class)
+{
+       __USB_FUNC_ENTER__ ;
+       switch (class) {
+       case USB_HOST_CDC:
+       case USB_HOST_HID:
+       case USB_HOST_CAMERA:
+       case USB_HOST_PRINTER:
+       case USB_HOST_MASS_STORAGE:
+       case USB_HOST_HUB:
+               __USB_FUNC_EXIT__ ;
+               return true;
+       default:
+                __USB_FUNC_EXIT__ ;
+               return false;
+       }
+}
+
+void load_connection_popup(UmMainData *ad, char *msg, int orientation)
+{
+       __USB_FUNC_ENTER__ ;
+
+       if(!ad) return ;
+       if(!msg) return ;
+       bundle *b = NULL;
+       int ret = -1;
+       int usbCurMode = -1;
+       const int arrSize = 2;
+       char str_orientation[arrSize];
+
+       USB_LOG("msg: %s", msg);
+
+       b = bundle_create();
+       um_retm_if (!b, "FAIL: bundle_create()\n");
+
+       /* Set tickernoti style */
+       ret = bundle_add(b, "0", "info");       /* "0" means tickernoti style */
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if ( 0 != bundle_free(b) )
+                       USB_LOG("FAIL: bundle_free()\n");
+               return;
+       }
+
+       /* Set tickernoti text */
+       ret = bundle_add(b, "1", dgettext(USB_SERVER_MESSAGE_DOMAIN, msg)); /* "1" means popup text */
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if ( 0 != bundle_free(b) )
+                       USB_LOG("FAIL: bundle_free()\n");
+               return;
+       }
+
+       /* Set tickernoti orientation */
+       snprintf(str_orientation, arrSize, "%d", orientation);
+       ret = bundle_add(b, "2", str_orientation);  /* "2" means orientation of tickernoti(1: bottom) */
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if ( 0 != bundle_free(b) )
+                       USB_LOG("FAIL: bundle_free()\n");
+               return;
+       }
+
+       /* Set tickernoti timeout */
+       ret = bundle_add(b, "3", "3");  /* "3" means timeout(second) of tickernoti */
+       if (0 != ret) {
+               USB_LOG("FAIL: bundle_add()\n");
+               if ( 0 != bundle_free(b) )
+                       USB_LOG("FAIL: bundle_free()\n");
+               return;
+       }
+
+       ret = syspopup_launch(TICKERNOTI_SYSPOPUP, b);
+       USB_LOG("ret: %d", ret);
+       if (0 > ret) {
+               USB_LOG("FAIL: syspopup_launch()\n");
+       }
+
+       ret = bundle_free(b);
+       um_retm_if(0 != ret, "FAIL: bundle_free()\n");
+
+       usleep(1000000);
+
+       __USB_FUNC_EXIT__ ;
+}
diff --git a/src/um_main.c b/src/um_main.c
new file mode 100644 (file)
index 0000000..77157ad
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_main.h"
+#include <heynoti.h>
+
+static void fini(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       __USB_FUNC_EXIT__;
+}
+
+static void usb_server_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       um_signal_init();
+       appcore_set_i18n(PACKAGE, LOCALEDIR);
+       um_usb_server_init(ad);
+       __USB_FUNC_EXIT__;
+}
+
+static int usb_server_main(int argc, char **argv)
+{
+       __USB_FUNC_ENTER__;
+       UmMainData ad;
+       memset(&ad, 0x0, sizeof(UmMainData));
+
+       ecore_init();
+
+       usb_server_init(&ad);
+       if (USB_DEVICE_CLIENT == ad.isHostOrClient) {
+               ad.usbAcc = (UsbAccessory*)malloc(sizeof(UsbAccessory));
+       }
+
+       ecore_main_loop_begin();
+
+       fini(&ad);
+       ecore_shutdown();
+       FREE(ad.usbAcc);
+
+       if (USB_DEVICE_HOST == ad.isHostOrClient) {
+               if (USB_HOST_CONNECTED == check_usbhost_connection())
+                       return 1;
+       } else if (USB_DEVICE_CLIENT == ad.isHostOrClient) {
+               if (USB_CLIENT_CONNECTED == check_usbclient_connection())
+                       return 1;
+       }
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int elm_main(int argc, char **argv)
+{
+       __USB_FUNC_ENTER__;
+       int ret = 0;
+       while(1) {
+               ret = usb_server_main(argc, argv);
+               if (ret == 0) break;
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int main(int argc, char **argv)
+{
+       __USB_FUNC_ENTER__;
+       __USB_FUNC_EXIT__;
+       return elm_main(argc, argv);
+}
diff --git a/src/um_usb_accessory_manager.c b/src/um_usb_accessory_manager.c
new file mode 100644 (file)
index 0000000..756b0ad
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_usb_accessory_manager.h"
+#include <vconf.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+int getAccessoryInfo(UsbAccessory *usbAcc)
+{
+       __USB_FUNC_ENTER__;
+       if (!usbAcc) return -1;
+
+       int acc = open(USB_ACCESSORY_NODE, O_RDONLY);
+       um_retvm_if(acc < 0, -1, "FAIL: open(USB_ACCESSORY_NODE, O_RDONLY)");
+
+       char buf[ACC_ELEMENT_LEN];
+       ioctl(acc, USB_ACCESSORY_GET_MANUFACTURER, buf);
+       usbAcc->manufacturer = strdup(buf);
+       ioctl(acc, USB_ACCESSORY_GET_MODEL, buf);
+       usbAcc->model = strdup(buf);
+       ioctl(acc, USB_ACCESSORY_GET_DESCRIPTION, buf);
+       usbAcc->description = strdup(buf);
+       ioctl(acc, USB_ACCESSORY_GET_VERSION, buf);
+       usbAcc->version = strdup(buf);
+       ioctl(acc, USB_ACCESSORY_GET_URI, buf);
+       usbAcc->uri = strdup(buf);
+       ioctl(acc, USB_ACCESSORY_GET_SERIAL, buf);
+       usbAcc->serial = strdup(buf);
+
+       close(acc);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int accessoryAttached(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       //load_system_popup(ad, SELECT_PKG_FOR_ACC_POPUP);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int connectAccessory(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+       ret = getAccessoryInfo(ad->usbAcc);
+       um_retvm_if(0 != ret, -1, "FAIL: getAccessoryInfo(ad->usbAcc)");
+       getCurrentAccessory(ad);
+
+       /* Change usb mode to accessory mode */
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_ACCESSORY_MODE);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT)");
+       
+       ret = accessoryAttached(ad);
+       um_retvm_if(0 > ret, -1, "FAIL: accessoryAttached(ad);");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int loadURIForAccessory(UsbAccessory *usbAcc)
+{
+       __USB_FUNC_ENTER__;
+       if (!usbAcc) return -1;
+/*     service_h service_handle = NULL;
+       if (service_create(&service_handle) < 0) {
+               USB_LOG("FAIL: service_create(&service_handle)");
+               return -1;
+       }
+       um_retvm_if (!service_handle, -1, "service_handle");
+       if (service_set_operation(service_handle, "http://tizen.org/appsvc/operation/view") < 0) {
+               USB_LOG("FAIL: service_set_operation(service_handle, http://tizen.org/appsvc/operation/view)");
+               service_destroy(service_handle);
+               return -1;
+       }
+       if (service-set_uri(servoce_handle, usbAcc->uri) < 0) {
+               USB_LOG("FAIL: service-set_uri(servoce_handle, usbAcc->uri)");  
+               service_destroy(service_handle);
+               return -1;
+       }
+       service_destroy(service_handle);*/
+       bundle *bd = bundle_create();
+       um_retvm_if(NULL == bd, -1, "FAIL: bundle_create()");
+       appsvc_set_operation(bd, APPSVC_OPERATION_VIEW);
+       appsvc_set_uri(bd, usbAcc->uri);
+       appsvc_run_service(bd, 0, NULL, NULL);
+       if (bundle_free(bd)) {
+               USB_LOG("FAIL: bundle_free()");
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int grantAccessoryPermission(UmMainData *ad, char *appId)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       if (!appId) return -1;
+
+       if (ad->permittedPkgForAcc != NULL) {
+               USB_LOG("Previous permitted pkg is removed\n");
+       }
+       FREE(ad->permittedPkgForAcc);
+       ad->permittedPkgForAcc = strdup(appId);
+       USB_LOG("Permitted pkg for accessory is %s\n", ad->permittedPkgForAcc);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int launch_acc_app(char *appId)
+{
+       __USB_FUNC_ENTER__;
+       if (appId == NULL) return -1;
+       bundle *b = NULL;
+       b = bundle_create();
+       um_retvm_if(!b, -1, "FAIL: bundle_create()"); 
+       int ret = aul_launch_app(appId, b);
+       bundle_free(b);
+       um_retvm_if(0 > ret, -1, "FAIL: aul_launch_app(appId, b)");
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+Eina_Bool hasAccPermission(UmMainData *ad, char *appId)
+{
+       /* Check whether or not a package has permission to access to device/accessory */
+       __USB_FUNC_ENTER__;
+       if (!ad) return EINA_FALSE;
+       if (ad->permittedPkgForAcc && appId) {
+               if (!strncmp(ad->permittedPkgForAcc, appId, strlen(appId))) {
+                       __USB_FUNC_EXIT__;
+                       return EINA_TRUE;
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return EINA_FALSE;
+}
+
+static int usbAccessoryRelease(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       if (ad->usbAcc == NULL) return -1;
+       FREE(ad->usbAcc->manufacturer);
+       FREE(ad->usbAcc->version);
+       FREE(ad->usbAcc->description);
+       FREE(ad->usbAcc->model);
+       FREE(ad->usbAcc->uri);
+       FREE(ad->usbAcc->serial);
+       FREE(ad->permittedPkgForAcc);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+void umAccInfoInit(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return ;
+       if (ad->usbAcc == NULL) return;
+       ad->usbAcc->manufacturer = NULL;
+       ad->usbAcc->version = NULL;
+       ad->usbAcc->description = NULL;
+       ad->usbAcc->model = NULL;
+       ad->usbAcc->uri = NULL;
+       ad->usbAcc->serial = NULL;
+       ad->permittedPkgForAcc = NULL;
+
+       __USB_FUNC_EXIT__;
+}
+
+int disconnectAccessory(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       usbAccessoryRelease(ad);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+void getCurrentAccessory(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return ;
+       if (!(ad->usbAcc)) return ;
+       /* Get current accessory */
+       USB_LOG("** USB Accessory Info **\n");
+       USB_LOG("Manufacturer: %s\n", ad->usbAcc->manufacturer);
+       USB_LOG("Model       : %s\n", ad->usbAcc->model);
+       USB_LOG("Description : %s\n", ad->usbAcc->description);
+       USB_LOG("Version     : %s\n", ad->usbAcc->version);
+       USB_LOG("Uri         : %s\n", ad->usbAcc->uri);
+       USB_LOG("Serial      : %s\n", ad->usbAcc->serial);
+       USB_LOG("************************\n");
+       __USB_FUNC_EXIT__;
+}
diff --git a/src/um_usb_connection_manager.c b/src/um_usb_connection_manager.c
new file mode 100644 (file)
index 0000000..c9ee6f9
--- /dev/null
@@ -0,0 +1,473 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_usb_connection_manager.h"
+
+int call_cmd(char* cmd)
+{
+       __USB_FUNC_ENTER__ ;
+       int ret = system(cmd);
+       USB_LOG("The result of %s is %d\n",cmd, ret);
+       __USB_FUNC_EXIT__ ;
+       return ret;
+}
+
+int connectUsbClient(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int ret = -1;
+       int mh_status = -1;
+       int usbSelMode = -1;
+       int keep_ethernet = -1;
+
+       /* If the mobile hotspot is on, USB-setting changes USB mode to mobile hotspot */
+       mh_status = check_mobile_hotspot_status();
+       if ((mh_status >= 0) && (mh_status & VCONFKEY_MOBILE_HOTSPOT_MODE_USB))
+       {
+               USB_LOG("Mobile hotspot is on\n");
+               ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_TETHERING_MODE);
+               um_retvm_if (0 != ret, -1, "FAIL: vconf_set_int(VCONF_SETAPPL_USB_SEL_MODE_INT)\n");
+               __USB_FUNC_EXIT__ ;
+               return 0;
+       } else {
+               USB_LOG("Mobile hotspot is off\n");
+       }
+
+       /********************************************************************/
+       /* Turn on ethernet mode if developers want to turn on the ethernet */
+       ret = vconf_get_int(VCONFKEY_USB_KEEP_ETHERNET, &keep_ethernet);
+       if (ret == 0 && keep_ethernet == VCONFKEY_USB_KEEP_ETHERNET_SET) {
+               USB_LOG("Ethernet mode is loading");
+               ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_ETHERNET_MODE);
+               if (ret < 0) USB_LOG("FAIL: vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT)");
+               __USB_FUNC_EXIT__ ;
+               return 0;
+       }
+       /********************************************************************/
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, &usbSelMode);
+       if (0 != ret) {
+               USB_LOG("FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT)\n");
+               usbSelMode = SETTING_USB_DEFAULT_MODE;
+       }
+
+       ret = set_USB_mode(ad, usbSelMode);
+       if (0 != ret) {
+               USB_LOG("ERROR: Cannot set USB mode \n");
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+int disconnectUsbClient(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int ret = -1;
+       int usbCurMode = -1;
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retvm_if(ret <0, -1, "FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT)\n");
+
+       action_clean(ad, usbCurMode);
+
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT, SETTING_USB_NONE_MODE);
+       if (ret != 0) {
+               USB_LOG("ERROR: vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT)\n");
+       }
+
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_DEFAULT_MODE);
+       if (0 != ret) {
+               USB_LOG("ERROR: vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT)\n");
+       }
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE, CHANGE_COMPLETE);
+       if (0 != ret) {
+               USB_LOG("FAIL: vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE)\n");
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+char *get_usb_connection_msg()
+{
+       __USB_FUNC_ENTER__ ;
+       char *msg = NULL;
+       int usbCurMode = -1;
+       int ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retvm_if(0 != ret, NULL, "FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT)");
+       USB_LOG("usbCurMode: %d\n", usbCurMode);
+
+       switch(usbCurMode) {
+       case SETTING_USB_DEFAULT_MODE:
+               msg = "IDS_COM_BODY_USB_CONNECTED";
+               break;
+       case SETTING_USB_ETHERNET_MODE:
+               msg = "SSH enabled";
+               break;
+       case SETTING_USB_ACCESSORY_MODE:
+               msg = "IDS_COM_BODY_CONNECTED_TO_A_USB_ACCESSORY";
+               break;
+       default:
+               msg = USB_NOTICE_SYSPOPUP_FAIL;
+               break;
+       }
+
+       __USB_FUNC_EXIT__ ;
+       return strdup(msg);
+}
+
+int usb_mode_change_done(UmMainData *ad, int done)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int vconf_ret = -1;
+       int ret = -1;
+       int usbSelMode = -1;
+       int usbCurMode = -1;
+       char *msg = NULL;
+
+       if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+               return 0;
+       }
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, &usbSelMode);
+       um_retvm_if(ret < 0, -1, "FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT)\n");
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retvm_if(ret < 0, -1, "FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT)\n");
+       USB_LOG("CurMode: %d, SelMode: %d", usbCurMode, usbSelMode);
+
+       if(ACT_SUCCESS == done) {
+               vconf_ret = vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT, usbSelMode);
+               um_retvm_if (0 != vconf_ret, -1, "FAIL: vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT)\n");
+#ifndef SIMULATOR
+               ad->prevDebugMode = ad->curDebugMode;
+#endif
+
+               if (SETTING_USB_TETHERING_MODE == usbSelMode) {
+                       return 0;
+               } else if (SETTING_USB_DEFAULT_MODE == usbSelMode
+                               && SETTING_USB_DEFAULT_MODE == usbCurMode) {
+                       return 0;
+               } else {
+                       msg = get_usb_connection_msg();
+                       load_connection_popup(ad, msg, TICKERNOTI_ORIENTATION_TOP);
+                       FREE(msg);
+               }
+
+       } else {        /* USB mode change failed */
+               action_clean(ad, usbSelMode);
+               load_system_popup(ad, ERROR_POPUP);
+       }
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+#ifndef SIMULATOR
+void debug_mode_cb(keynode_t* in_key, void *data)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!data) return ;
+
+       change_mode_cb(in_key, data);
+
+       __USB_FUNC_EXIT__ ;
+       return ;
+}
+#endif
+
+#ifndef SIMULATOR
+void change_mode_cb(keynode_t* in_key, void *data)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!data) return ;
+       UmMainData *ad = (UmMainData *)data;
+       int ret = -1;
+       int usbSelMode = -1;
+       int usbCurMode = -1;
+       int debugMode = 0;
+
+       if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+               return ;
+       }
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, &usbSelMode);
+       um_retm_if (0 != ret , "ERROR: Cannot get the vconf key\n");
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retm_if (0 != ret , "ERROR: Cannot get the vconf key\n");
+       ret = vconf_get_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, &debugMode);
+       um_retm_if (0 != ret , "ERROR: Cannot get the vconf key\n");
+       USB_LOG("debugMode: %d", debugMode);
+       if (debugMode == 1) ad->curDebugMode = true;
+       else if (debugMode == 0) ad->curDebugMode = false;
+       else {
+               USB_LOG("ERROR: debugMode value is improper");
+               return;
+       }
+
+       if (usbSelMode == SETTING_USB_DEFAULT_MODE
+                       && usbCurMode == SETTING_USB_DEFAULT_MODE) {
+               um_retm_if (ad->curDebugMode == ad->prevDebugMode, "Previous usb mode is same as the input mode");
+       } else {
+               um_retm_if (usbSelMode == usbCurMode, "Previous connection mode is same as the input mode");
+       }
+       um_retm_if (usbSelMode == usbCurMode, "Previous connection mode is same as the input mode");
+
+       ret = set_USB_mode(ad, usbSelMode);
+       um_retm_if (0 != ret, "ERROR: Cannot set USB mode \n");
+
+       __USB_FUNC_EXIT__ ;
+       return ;
+}
+#else
+void change_mode_cb(keynode_t* in_key, void *data)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!data) return ;
+       UmMainData *ad = (UmMainData *)data;
+       int ret = -1;
+       int usbSelMode = -1;
+       int usbCurMode = -1;
+
+       if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+               return ;
+       }
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, &usbSelMode);
+       um_retm_if (0 != ret , "ERROR: Cannot get the vconf key\n");
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retm_if (0 != ret , "ERROR: Cannot get the vconf key\n");
+       um_retm_if (usbSelMode == usbCurMode, "Previous connection mode is same as the input mode");
+
+       ret = set_USB_mode(ad, usbSelMode);
+       um_retm_if (0 != ret, "ERROR: Cannot set USB mode \n");
+
+       __USB_FUNC_EXIT__ ;
+       return ;
+}
+#endif
+
+int set_USB_mode(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int ret = -1;
+       int done = ACT_FAIL;
+       int usbCurMode = -1;
+
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE, IN_MODE_CHANGE);
+       if (0 != ret) {
+               USB_LOG("FAIL: vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE)");
+       }
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       if (0 == ret && SETTING_USB_NONE_MODE != usbCurMode) {
+               action_clean(ad, usbCurMode);
+       }
+       USB_LOG("Mode change : %d\n", mode);
+       done = run_core_action(ad, mode);
+       ret = usb_mode_change_done(ad, done);
+       um_retvm_if(0 != ret, -1, "usb_mode_change_done(ad, done)");
+
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE, CHANGE_COMPLETE);
+       if (0 != ret) {
+               USB_LOG("vconf_set_int(VCONFKEY_SETAPPL_USB_IN_MODE_CHANGE)");
+       }
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+void change_hotspot_status_cb(keynode_t* in_key, void *data)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!data) return ;
+
+       UmMainData *ad = (UmMainData *)data;
+       int mh_status = -1;
+       int ret = -1;
+       int usbCurMode = -1;
+       if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+               return;
+       }
+
+       mh_status = check_mobile_hotspot_status();
+       USB_LOG("mobile_hotspot_status: %d\n", mh_status);
+       um_retm_if (0 > mh_status, "FAIL: Getting mobile hotspot status\n");
+
+       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usbCurMode);
+       um_retm_if (0 != ret, "FAIL: vconf_get_int(VCONF_SETAPPL_USB_MODE_INT)\n");
+
+       if (mh_status & VCONFKEY_MOBILE_HOTSPOT_MODE_USB) {
+               USB_LOG("USB Mobile hotspot is on\n");
+
+               if (usbCurMode != SETTING_USB_TETHERING_MODE) {
+                       /* When mobile hotspot is on, this callabck function only sets vconf key value of USB mode.
+                        * And then, the callback function for vconf change will be called */
+                       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_TETHERING_MODE);
+                       um_retm_if (0 != ret, "FAIL: vconf_set_int(VCONF_SETAPPL_USB_MODE_INT)\n");
+               }
+       } else {
+               USB_LOG("USB Mobile hotspot is off\n");
+               if (usbCurMode == SETTING_USB_TETHERING_MODE) {
+                       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT,
+                                                       SETTING_USB_DEFAULT_MODE);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: vconf_set_int(VCONF_SETAPPL_USB_SEL_MODE_INT)\n");
+                               return;
+                       }
+               }
+       }
+       __USB_FUNC_EXIT__ ;
+}
+
+static int check_mobile_hotspot_status()
+{
+       __USB_FUNC_ENTER__ ;
+
+       int mh_status = -1;
+       int ret = -1;
+       ret = vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &mh_status);
+       um_retvm_if (0 != ret, -1, "FAIL: vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE)\n");
+       __USB_FUNC_EXIT__ ;
+       return mh_status;
+}
+
+/****************************************************/
+/* Functions related to mode change                 */
+/****************************************************/
+
+static int run_core_action(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return ACT_FAIL;
+       int ret = -1;
+
+       switch(mode)
+       {
+       case SETTING_USB_DEFAULT_MODE:
+               USB_LOG("Mode : SETTING_USB_DFAULT_MODE\n");
+               ret = mode_set_kernel(ad, SETTING_USB_DEFAULT_MODE);
+               um_retvm_if(0 != ret, ACT_FAIL, "FAIL : mode_set_kernel()\n");
+               start_dr(ad);
+#ifndef SIMULATOR
+               if (ad->curDebugMode) {
+                       USB_LOG("Current Debug mode is on");
+                       call_cmd(SDBD_START);
+               }
+#endif
+               break;
+
+       case SETTING_USB_ETHERNET_MODE:
+               USB_LOG("Mode: SETTING_USB_ETHERNET_MODE\n");
+               ret = mode_set_kernel(ad, SETTING_USB_ETHERNET_MODE);
+               um_retvm_if(0 != ret, ACT_FAIL, "FAIL : mode_set_kernel()\n");
+               call_cmd(SET_USB0_IP);
+               call_cmd(ADD_DEFAULT_GW);
+               call_cmd(OPENSSHD_START);
+               break;
+
+       case SETTING_USB_TETHERING_MODE:
+               USB_LOG("Mode : SETTING_USB_TETHERING_MODE\n");
+               ret = mode_set_kernel(ad, SETTING_USB_TETHERING_MODE);
+               um_retvm_if(0 != ret, ACT_FAIL, "FAIL : mode_set_kernel()\n");
+               call_cmd(SET_USB0_IP);
+               call_cmd(ADD_DEFAULT_GW);
+               break;
+
+       case SETTING_USB_ACCESSORY_MODE:
+               USB_LOG("Mode : SETTING_USB_ACCESSORY_MODE\n");
+               ret = mode_set_kernel(ad, SETTING_USB_ACCESSORY_MODE);
+               um_retvm_if(0 != ret, ACT_FAIL, "FAIL : mode_set_kernel()\n");
+               break;
+
+       default:
+               break;
+       }
+       __USB_FUNC_EXIT__ ;
+       return ACT_SUCCESS;
+}
+
+int action_clean(UmMainData *ad, int mode)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int ret = -1;
+
+       switch(mode) {
+       case SETTING_USB_DEFAULT_MODE:
+               USB_LOG("Mode : SETTING_USB_DEFAULT_MODE action_clean\n");
+#ifndef SIMULATOR
+               if (ad->prevDebugMode) {
+                       USB_LOG("Previous debug mode was on");
+                       call_cmd(SDBD_STOP);
+               }
+#endif
+               break;
+       case SETTING_USB_ETHERNET_MODE:
+               USB_LOG("Mode : SETTING_USB_ETHERNET_MODE action_clean\n");
+               call_cmd(OPENSSHD_STOP);
+               call_cmd(UNSET_USB0_IP);
+               break;
+       case SETTING_USB_TETHERING_MODE:
+               USB_LOG("Mode : SETTING_USB_TETHERING_MODE action_clean\n");
+               call_cmd(UNSET_USB0_IP);
+               break;
+       case SETTING_USB_ACCESSORY_MODE:
+       default:
+               break;
+       }
+       ret = mode_set_kernel(ad, SETTING_USB_NONE_MODE);
+       um_retvm_if(0 != ret, -1, "FAIL: mode_set_kernel(SETTING_USB_NONE_MODE)");
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
+
+/***********************************************/
+/*  Functions related to popups                */
+/***********************************************/
+
+void usb_connection_selected_btn(UmMainData *ad, int input)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return ;
+       if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+               return;
+       }
+
+       switch (input) {
+       case ERROR_POPUP_OK_BTN:
+               USB_LOG("The button on the error popup is selected\n");
+               response_error_popup(ad);
+               break;
+       default:
+               break;
+       }
+       __USB_FUNC_EXIT__ ;
+}
+
+int response_error_popup(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__ ;
+       if(!ad) return -1;
+       int ret = -1;
+       ret = vconf_set_int(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, SETTING_USB_DEFAULT_MODE);
+       um_retvm_if(0 != ret, -1, "ERROR: Cannot set the vconf key\n");
+
+       __USB_FUNC_EXIT__ ;
+       return 0;
+}
diff --git a/src/um_usb_host_manager.c b/src/um_usb_host_manager.c
new file mode 100644 (file)
index 0000000..80e5d9d
--- /dev/null
@@ -0,0 +1,939 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vconf.h>
+#include <dirent.h>
+#include "um_usb_host_manager.h"
+
+int tmpfs_mounted = 0;
+int added_noti_value = 0;
+int removed_noti_value = 0;
+
+void free_func(gpointer data)
+{
+       __USB_FUNC_ENTER__;
+       UsbHost *device = (UsbHost *)data;
+       FREE(device->permittedAppId);
+       __USB_FUNC_EXIT__;
+}
+
+int retrieve_device_info(libusb_device *device,
+                                               int *deviceClass,
+                                               int *deviceSubClass,
+                                               int *deviceProtocol,
+                                               int *idVendor,
+                                               int *idProduct,
+                                               int *bus,
+                                               int *devAddress)
+{
+       __USB_FUNC_ENTER__;
+       if (device == NULL) return -1;
+       struct libusb_device_descriptor desc;
+       int ret = -1;
+       libusb_device_handle *handle = NULL;
+       ret = libusb_get_device_descriptor(device, &desc);
+       if (ret != 0) {
+               USB_LOG("FAIL: libusb_get_device_descriptor()\n");
+               return -1;
+       }
+
+       /* If device class of device descriptor is 0,
+        * the real device class information would be located in the interface descriptor */
+       if (0 == desc.bDeviceClass) {
+               struct libusb_config_descriptor *config = NULL;
+               ret = libusb_get_active_config_descriptor(device, &config);
+               if (ret != 0) {
+                       USB_LOG("FAIL: libusb_get_active_config_descriptor(device, &config)");
+                       libusb_free_config_descriptor(config);
+                       return -1;
+               }
+               *deviceClass = config->interface->altsetting[0].bInterfaceClass;
+               *deviceSubClass = config->interface->altsetting[0].bInterfaceSubClass;
+               *deviceProtocol = config->interface->altsetting[0].bInterfaceProtocol;
+               libusb_free_config_descriptor(config);
+       } else {
+               *deviceClass = desc.bDeviceClass;
+               *deviceSubClass = desc.bDeviceSubClass;
+               *deviceProtocol = desc.bDeviceProtocol;
+       }
+       *idVendor = desc.idVendor;
+       *idProduct = desc.idProduct;
+       *bus = libusb_get_bus_number(device);
+       *devAddress = libusb_get_device_address(device);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int umReleaseAllDevice(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       if (ad->devList) {
+               int cnt = g_list_length(ad->devList);
+               int i;
+               int ret;
+               for ( i = cnt-1 ; i >= 0 ; i--) {
+                       ret = um_disconnect_usb_device(ad,
+                                                       ((UsbHost *)(g_list_nth_data(ad->devList, i)))->deviceClass);
+                       if (ret < 0) USB_LOG("FAIL: um_disconnect_usb_device()");
+                       ad->devList = g_list_delete_link(ad->devList, g_list_nth(ad->devList, i));
+               }
+
+               if (ad->devList) {
+                       g_list_free_full(ad->devList, free_func);
+                       ad->devList = NULL;
+               }
+       }
+       load_connection_popup(ad, "IDS_COM_POP_USB_CONNECTOR_DISCONNECTED", TICKERNOTI_ORIENTATION_TOP);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int compareTwoDevices(libusb_device *usbDevice, UsbHost *listedDevice)
+{
+       __USB_FUNC_ENTER__;
+       if (usbDevice == NULL || listedDevice == NULL) return -1;
+       int ret = -1;
+       int deviceClass;
+       int deviceSubClass;
+       int deviceProtocol;
+       int idVendor;
+       int idProduct;
+       int bus;
+       int devAddress;
+       ret = retrieve_device_info(usbDevice,
+                                                       &deviceClass,
+                                                       &deviceSubClass,
+                                                       &deviceProtocol,
+                                                       &idVendor,
+                                                       &idProduct,
+                                                       &bus,
+                                                       &devAddress);
+       if (ret < 0) {
+               USB_LOG("FAIL: retrieve_device_info()\n");
+               return -1;
+       }
+       if (listedDevice->deviceClass == deviceClass
+               && listedDevice->deviceSubClass == deviceSubClass
+               && listedDevice->deviceProtocol == deviceProtocol
+               && listedDevice->idVendor == idVendor
+               && listedDevice->idProduct == idProduct
+               && listedDevice->bus == bus
+               && listedDevice->deviceAddress == devAddress)
+       {
+               USB_LOG("Two devices are same\n");
+               __USB_FUNC_EXIT__;
+               return 0;
+       } else {
+               USB_LOG("Two devices are different\n");
+               __USB_FUNC_EXIT__;
+               return 1;
+       }
+}
+
+bool is_device_driver_active(libusb_device *device, int devClass)
+{
+       __USB_FUNC_ENTER__;
+       if (!device) return false;
+       int ret = -1;
+       bool result;
+       libusb_device_handle *handle;
+
+       switch (devClass) {
+       case USB_HOST_CAMERA:
+               /* Camera is supported by libgphpoto2, not by kernel
+                * The directory is made When camera is connected, and removed when camera is removed */
+               if (0 == access("/tmp/camera", F_OK)) {
+                       result = true;
+               } else {
+                       result = false;
+               }
+               break;
+       case USB_HOST_CDC:
+       case USB_HOST_HID:
+       case USB_HOST_PRINTER:
+       case USB_HOST_MASS_STORAGE:
+       case USB_HOST_HUB:
+               ret = libusb_open(device, &handle);
+               if (ret != 0) {
+                       USB_LOG("FAIL: libusb_open()");
+                       return false;
+               }
+
+               /* We can check the usb device is available by checking if kernel driver is actice or not */
+               ret = libusb_kernel_driver_active(handle, 0);
+               if (ret == 1) {
+                       USB_LOG("Device driver is active");
+                       result = true;
+               } else if (ret == 0) {
+                       USB_LOG("No device driver is active");
+                       result = false;
+               } else {
+                       USB_LOG("FAIL: libusb_kernel_driver_active()");
+                       result = false;
+               }
+               libusb_close(handle);
+               break;
+       default:
+               USB_LOG("The device(class: %d) is not supported by kernel", devClass);
+               result = false;
+               break;
+       }
+       __USB_FUNC_EXIT__;
+       return result;
+}
+
+int add_usb_device_to_list(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+       int i, j;
+       int deviceClass;
+       int deviceSubClass;
+       int deviceProtocol;
+       int idVendor;
+       int idProduct;
+       int bus;
+       int devAddress;
+       bool found = false;
+       libusb_device **list = NULL;
+       pm_change_state(LCD_NORMAL);
+
+       ssize_t cnt = libusb_get_device_list(ad->usbctx, &list);
+
+       for (i = 0 ; i < cnt ; i++) {
+               ret = retrieve_device_info(list[i],
+                                                               &deviceClass,
+                                                               &deviceSubClass,
+                                                               &deviceProtocol,
+                                                               &idVendor,
+                                                               &idProduct,
+                                                               &bus,
+                                                               &devAddress);
+               if (ret < 0) {
+                       USB_LOG("FAIL: retrieve_device_info()\n");
+                       libusb_free_device_list(list, 1);
+                       return -1;
+               }
+               USB_LOG("Device class: %d", deviceClass);
+
+               /* Check default device list */
+               if (ad->defaultDevList) {
+                       for (j = 0 ; j < g_list_length(ad->defaultDevList) ; j++) {
+                               if (0 == compareTwoDevices(list[i],
+                                                       ((UsbHost *)(g_list_nth_data(ad->defaultDevList, j))))) {
+                                       found = true;
+                                       break;
+                               }
+                       }
+                       if (found == true) USB_LOG("Device is found at default device list");
+               }
+
+               /* Check device list */
+               if (found == false && ad->devList) {
+                       for (j = 0 ; j < g_list_length(ad->devList) ; j++) {
+                               if (0 == compareTwoDevices(list[i],
+                                                       ((UsbHost *)(g_list_nth_data(ad->devList, j))))) {
+                                       found = true;
+                                       break;
+                               }
+                       }
+                       if (found == true) USB_LOG("Device is found at device list");
+               }
+
+               if (found == false) {
+                       UsbHost *device = (UsbHost *)malloc(sizeof(UsbHost));
+                       device->permittedAppId = NULL;
+                       device->deviceClass = deviceClass;
+                       device->deviceSubClass = deviceSubClass;
+                       device->deviceProtocol = deviceProtocol;
+                       device->idVendor = idVendor;
+                       device->idProduct = idProduct;
+                       device->bus = bus;
+                       device->deviceAddress = devAddress;
+                       ad->devList = g_list_append(ad->devList, device);
+
+                       if (true == is_device_supported(deviceClass)) {
+                               if (deviceClass != USB_HOST_MASS_STORAGE) {
+                                       j = 0;
+                                       while(false == is_device_driver_active(list[i], deviceClass)) {
+                                               USB_LOG("Wait...");
+                                               usleep(100000);
+                                               j++;
+                                               if (j > 100) break;     /* Try for 10 seconds */
+                                       }
+                                       if (j <= 100) {
+                                               ret = um_connect_known_device(ad, deviceClass,
+                                                                                                               deviceSubClass, deviceProtocol);
+                                               if (ret < 0) USB_LOG("FAIL: um_connect_known_device()");
+                                       }
+                               }
+                       } else {
+                               ret = um_connect_unknown_device(ad, deviceClass, deviceSubClass,
+                                                                                       deviceProtocol, idVendor, idProduct);
+                               if (ret < 0) USB_LOG("FAIL: um_connect_unknown_device()");
+                       }
+               } else {
+                       found = false;
+               }
+       }
+       libusb_free_device_list(list, 1);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int remove_usb_device_to_list(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       if (!(ad->devList)) return 0;
+       int i, j;
+       int ret = -1;
+       int recheck = 0;
+       ssize_t cnt;
+       bool found = false;
+       libusb_device **list = NULL;
+       pm_change_state(LCD_NORMAL);
+
+       /* When getting the device list using libusb apis,
+        * the device list would not be updated.
+        * So, we should re-check when we cannot find device removed */
+       do {
+               cnt = libusb_get_device_list(ad->usbctx, &list);
+               if (list == NULL) {
+                       /* USB device status is not changed */
+                       __USB_FUNC_EXIT__;
+                       return 0;
+               }
+               for (i = 0 ; i < g_list_length(ad->devList) ; i++) {
+                       for (j = 0 ; j < cnt ; j++) {
+                               if ( 0 == compareTwoDevices(list[j],
+                                                ((UsbHost *)(g_list_nth_data(ad->devList, i)))) ) {
+                                       found = true;
+                                       break;
+                               }
+                       }
+                       if (found == true) {
+                               found = false;
+                       } else {
+                               ret = um_disconnect_usb_device(ad,
+                                               ((UsbHost *)(g_list_nth_data(ad->devList, i)))->deviceClass);
+                               if (ret < 0) {
+                                       USB_LOG("FAIL: um_disconnect_usb_device()");
+                               }
+                               ad->devList = g_list_delete_link(ad->devList, g_list_nth(ad->devList, i));
+                               found = true;
+                               break;
+                       }
+               }
+               recheck++;
+               libusb_free_device_list(list, 1);
+               USB_LOG("Wait...");
+               sleep(1);       /* Wait for 1 sec to get valid libusb device list */
+       } while (found == false && recheck < 3);        /* Try 3 times */
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int grantHostPermission(UmMainData *ad, char *appId, int vendor, int product)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad || !appId) return -1;
+       if (ad->permittedPkgForAcc != NULL) {
+               USB_LOG("Previous permitted pkg is removed\n");
+       }
+
+       int i;
+       for (i = 0; i < g_list_length(ad->devList) ; i++) {
+               if ( ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idVendor == vendor
+                                       && ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idProduct == product) {
+                       FREE(((UsbHost *)(g_list_nth_data(ad->devList, i)))->permittedAppId);
+                       ((UsbHost *)(g_list_nth_data(ad->devList, i)))->permittedAppId = strdup(appId);
+                       USB_LOG("Permitted app for the device is %s\n", ((UsbHost *)(g_list_nth_data(ad->devList, i)))->permittedAppId);
+                       break;
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int launch_host_app(char *appId)
+{
+       __USB_FUNC_ENTER__;
+       if (appId == NULL) return -1;
+       bundle *b = NULL;
+       b = bundle_create();
+       um_retvm_if(!b, -1, "FAIL: bundle_create()");
+       int ret = aul_launch_app(appId, b);
+       bundle_free(b);
+       um_retvm_if(0 > ret, -1, "FAIL: aul_launch_app(appId, b)");
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+Eina_Bool hasHostPermission(UmMainData *ad, char *appId, int vendor, int product)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad || !appId) return EINA_FALSE;
+       int i;
+       for (i = 0; i < g_list_length(ad->devList) ; i++) {
+               if ( ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idVendor == vendor
+                                       && ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idProduct == product ) {
+                       if (0 == strncmp(((UsbHost *)(g_list_nth_data(ad->devList, i)))->permittedAppId,
+                                                       appId, strlen(appId))) {
+                               __USB_FUNC_EXIT__;
+                               return EINA_TRUE;
+                       } else {
+                               break;
+                       }
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return EINA_FALSE;
+}
+
+Eina_Bool is_host_connected(UmMainData *ad, int vendor, int product)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return EINA_FALSE;
+       int i;
+       for (i = 0 ; i < g_list_length(ad->devList) ; i++) {
+               if ( ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idVendor == vendor
+                                       && ((UsbHost *)(g_list_nth_data(ad->devList, i)))->idProduct == product ) {
+                       __USB_FUNC_EXIT__;
+                       return EINA_TRUE;
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return EINA_FALSE;
+}
+
+int show_all_usb_devices(GList *devList, int option)
+{
+       __USB_FUNC_ENTER__;
+       if (!(devList)) {
+               return 0;
+       }
+       if (option == 1) {
+               int i;
+               USB_LOG("***********************************\n");
+               USB_LOG("** USB devices list \n");
+               USB_LOG("** \n");
+               for (i = 0 ; i < g_list_length(devList) ; i++) {
+                       USB_LOG("** Device number: %d\n", i);
+                       USB_LOG("** Permitted app : %s\n", ((UsbHost *)(g_list_nth_data(devList, i)))->permittedAppId);
+                       USB_LOG("** Device Class : %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->deviceClass);
+                       USB_LOG("** Device Subclass : %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->deviceSubClass);
+                       USB_LOG("** Device Protocol : %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->deviceProtocol);
+                       USB_LOG("** Device Vendor ID : %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->idVendor);
+                       USB_LOG("** Device Product ID: %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->idProduct);
+                       USB_LOG("** Device Bus number: %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->bus);
+                       USB_LOG("** Device Address: %u\n", ((UsbHost *)(g_list_nth_data(devList, i)))->deviceAddress);
+                       USB_LOG("*************************************** ");
+               }
+       } else {
+               USB_LOG("FAIL: Option is not correct\n");
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+void add_host_noti_cb(void *data)
+{
+       __USB_FUNC_ENTER__;
+       UmMainData *ad = (UmMainData *)data;
+       int ret = show_all_usb_devices(ad->devList,1);
+       if (ret != 0) USB_LOG("FAIL: show_all_usb_devices(ad)\n");
+
+       ret = add_usb_device_to_list(ad);
+       um_retm_if(0 != ret, "FAIL: add_usb_device_to_list(ad)");
+
+       ret = show_all_usb_devices(ad->devList,1);
+       if (ret != 0) USB_LOG("FAIL: show_all_usb_devices(ad)\n");
+       __USB_FUNC_EXIT__;
+}
+
+void remove_host_noti_cb(void *data)
+{
+       __USB_FUNC_ENTER__;
+       UmMainData *ad = (UmMainData *)data;
+       int ret = show_all_usb_devices(ad->devList,1);
+       if (ret != 0) USB_LOG("FAIL: show_all_usb_devices(ad)\n");
+
+       ret = remove_usb_device_to_list(ad);
+       um_retm_if(0 != ret, "FAIL: remove_usb_device_to_list(ad)");
+
+       ret = show_all_usb_devices(ad->devList,1);
+       if (ret != 0) USB_LOG("FAIL: show_all_usb_devices(ad)\n");
+       __USB_FUNC_EXIT__;
+}
+
+static void camera_added_popup()
+{
+       __USB_FUNC_ENTER__;
+       int ret = -1;
+       bundle *b = NULL;
+
+       DIR *dp;
+       struct dirent *dir;
+       struct stat stat;
+       char buf[255] = "unknown_camera";
+
+       if ((dp = opendir("/tmp/camera")) == NULL) {
+               USB_LOG("Can not open directory");
+               return ;
+       }
+       chdir("/tmp/camera");
+
+       while (dir = readdir(dp)) {
+               memset(&stat, 0, sizeof(struct stat));
+               lstat(dir->d_name, &stat);
+               if (S_ISDIR(stat.st_mode) || S_ISLNK(stat.st_mode)) {
+                       if (strncmp(".", dir->d_name, 1) == 0
+                                       || strncmp("..", dir->d_name, 2) == 0)
+                               continue;
+                       snprintf(buf, 255, "%s", dir->d_name);
+               }
+       }
+       closedir(dp);
+
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "camera_add");
+       bundle_add(b, "device_name", buf);
+       ret = syspopup_launch("usbotg-syspopup", b);
+       USB_LOG("ret: %d", ret);
+       if (ret < 0) {
+               USB_LOG("FAIL: syspopup_launch(usbotg-syspopup, b)");
+       }
+       bundle_free(b);
+
+       __USB_FUNC_EXIT__ ;
+       return ;
+}
+
+static bool is_mass_storage_mounted(UmMainData *ad, int event)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return false;
+       int ret;
+       char *storage_path = NULL;
+       char *storage = NULL;
+       char storage_mount_path[BUF_MAX];
+       if (event == 0) {       /* 'event == 0' means that mass storage is just connected */
+               storage_path = vconf_get_str(VCONFKEY_SYSMAN_ADDED_STORAGE_UEVENT);
+               if (storage_path != NULL) {
+                       storage = strrchr(storage_path, '/');
+                       storage++;      /* remove '/' */
+                       USB_LOG("storage: %s", storage);
+               }
+       } else if (event == 1) {        /*  'event == 1' means that mass storage is just removed */
+               storage = vconf_get_str(VCONFKEY_SYSMAN_REMOVED_STORAGE_UEVENT);
+       }
+       if (storage) {
+               snprintf(storage_mount_path, BUF_MAX, "%s/%s", MOUNT_POINT, storage);
+               USB_LOG("storage_mount_path: %s", storage_mount_path);
+               ret = access(storage_mount_path, F_OK);
+               if (ret == 0) {
+                       USB_LOG("This mass storage is mounted");
+                       __USB_FUNC_EXIT__;
+                       return true;
+               } else {
+                       USB_LOG("This mass storage is unmounted");
+                       __USB_FUNC_EXIT__;
+                       return false;
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return false;
+}
+
+int um_connect_known_device(UmMainData *ad, int class, int subClass, int protocol)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+       char *msg = NULL;
+       int i;
+
+       switch (class) {
+       case USB_HOST_HID:
+               if (HID_KEYBOARD == protocol) {
+                       USB_LOG("USB host keyboard connected");
+                       msg = "IDS_COM_POP_KEYBOARD_CONNECTED_ABB2";
+               } else if (HID_MOUSE == protocol) {
+                       USB_LOG("USB host mouse connected");
+                       msg = "IDS_COM_POP_MOUSE_CONNECTED_ABB2";
+               } else {
+                       USB_LOG("USB host unknown HID device connected");
+                       msg = "IDS_BT_POP_CONNECTED_TO_HID_DEVICE";
+               }
+               break;
+       case USB_HOST_CAMERA:
+               USB_LOG("USB host camera connected");
+               msg = "IDS_COM_POP_CAMERA_CONNECTED_ABB2";
+               camera_added_popup();
+               break;
+       case USB_HOST_PRINTER:
+               USB_LOG("USB host printer connected");
+               msg = "IDS_COM_POP_PRINTER_CONNECTED_ABB2";
+               /* We should add some operations for printer */
+               break;
+       case USB_HOST_MASS_STORAGE:
+               USB_LOG("USB host mass storage connected");
+               ret = um_usb_storage_added();
+               if (0 > ret) {
+                       msg = "USB mass storage mount failed";
+               } else {
+                       msg = "IDS_COM_POP_USB_MASS_STORAGE_CONNECTED_ABB2";
+               }
+               break;
+       case USB_HOST_HUB:
+               USB_LOG("USB host hub connected");
+               break;
+       default:
+               USB_LOG("USB host unknown device connected");
+               break;
+       }
+       if (msg == NULL) {
+               USB_LOG("msg of tickernoti is NULL");
+               __USB_FUNC_EXIT__;
+               return 0;
+       }
+
+       load_connection_popup(ad, msg, TICKERNOTI_ORIENTATION_TOP);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_connect_unknown_device(UmMainData *ad,
+                                                       int class,
+                                                       int subClass,
+                                                       int protocol,
+                                                       int vendor,
+                                                       int product)
+{
+       __USB_FUNC_ENTER__;
+       int ret = load_system_popup_with_deviceinfo(ad, SELECT_PKG_FOR_HOST_POPUP,
+                                                                               class, subClass, protocol, vendor, product);
+       if (ret < 0) {
+               USB_LOG("FAIL: load_system_popup_with_deviceinfo()");
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_disconnect_usb_device(UmMainData *ad, int class)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+       char *msg = "IDS_COM_BODY_USB_DEVICE_SAFELY_REMOVED";
+       int i;
+
+       switch (class) {
+       case USB_HOST_MASS_STORAGE:
+               USB_LOG("USB host mass storage removed");
+               if (false == is_mass_storage_mounted(ad, 1)) {
+                       USB_LOG("Mass storage is already unmounted");
+                       __USB_FUNC_EXIT__;
+                       return 0;
+               }
+               msg = "IDS_COM_POP_USB_MASS_STORAGE_UNEXPECTEDLY_REMOVED";
+               ret = um_usb_storage_removed();
+               if (ret < 0) USB_LOG("FAIL: um_usb_storage_removed()");
+               break;
+       case USB_HOST_HUB:
+               USB_LOG("USB hub removed");
+               __USB_FUNC_EXIT__;
+               return 0;
+       case USB_HOST_HID:
+       case USB_HOST_CAMERA:
+       case USB_HOST_PRINTER:
+       default:
+               break;
+       }
+
+       load_connection_popup(ad, msg, TICKERNOTI_ORIENTATION_TOP);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+void add_mass_storage_cb(keynode_t *in_key, void *data)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return ;
+       UmMainData *ad = (UmMainData *)data;
+       int ret;
+       if (false == is_mass_storage_mounted(ad, 0)) {
+               ret = um_connect_known_device(ad, USB_HOST_MASS_STORAGE, 0, 0);
+               if (ret < 0) USB_LOG("FAIL: um_connect_known_device()");
+       }
+       __USB_FUNC_EXIT__;
+}
+
+void remove_mass_storage_cb(keynode_t *in_key, void *data)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return ;
+       UmMainData *ad = (UmMainData *)data;
+       if (true == is_mass_storage_mounted(ad, 1)) {
+               int ret = um_disconnect_usb_device(ad, USB_HOST_MASS_STORAGE);
+               if (ret < 0) USB_LOG("FAIL: um_disconnect_usb_device()");
+       }
+       __USB_FUNC_EXIT__;
+}
+
+int disconnectUsbHost(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = umReleaseAllDevice(ad);
+       if (ret < 0) USB_LOG("FAIL: umReleaseAllDevice(ad)");
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+/*************************************************************/
+/* Mounting Mass Storage (USB storage)                       */
+/*************************************************************/
+static int um_mount_device(char *dev)
+{
+       __USB_FUNC_ENTER__;
+       if (access(dev, F_OK) != 0) {
+               USB_LOG("Failed to find device: DEVICE(%s)", dev);
+               return -1;
+       }
+
+       int fd = -1;
+       int r = -1;
+       char *rel_mnt_point;
+       char buf_mnt_point[BUF_MAX];
+
+       rel_mnt_point = strrchr(dev, '/');
+       if (rel_mnt_point == NULL) {
+               USB_LOG("Get Relative Mount Path Failed");
+               return -1;
+       }
+
+       snprintf(buf_mnt_point, BUF_MAX, "%s%s", MOUNT_POINT, rel_mnt_point);
+
+       /* Make directory to mount */
+       r = mkdir(buf_mnt_point, 0755);
+       if (r < 0) {
+               if (errno == EEXIST) {
+                       USB_LOG("Directory is already exsited: %s", buf_mnt_point);
+               } else {
+                       USB_LOG("FAIL: Make Directory Failed: %s", buf_mnt_point);
+                       return -1;
+               }
+       }
+
+       /* Mount block device on mount point */
+       r = mount(dev, buf_mnt_point, "vfat", 0, "uid=0,gid=0,dmask=0000,fmask=0111,iocharset=iso8859-1,utf8,shortname=mixed,smackfsroot=*,smackfsdef=*");
+       if (r < 0) {
+               r = rmdir(buf_mnt_point);
+               USB_LOG("FAIL: Mount failed: MOUNT PATH(%s)", buf_mnt_point);
+               return -1;
+       }
+       USB_LOG("Mount Complete: MOUNT PATH(%s)", buf_mnt_point);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int um_unmount_device(char *mnt_point)
+{
+       __USB_FUNC_ENTER__;
+       if (mnt_point == NULL) return -1;
+       if (access(mnt_point, F_OK) != 0) {
+               USB_LOG("Failed to find path: MOUNT PATH(%s)", mnt_point);
+               return -1;
+       }
+
+       int ret = -1;
+
+       /* Umount block device */
+       ret = umount2(mnt_point, MNT_DETACH);
+       if (ret < 0) {
+               USB_LOG("Unmounting is unabled: MOUNT PATH(%s)", mnt_point);
+               ret = rmdir(mnt_point);
+               if (ret < 0) {
+                       USB_LOG("Removing Directory is unabled: PATH(%s)", mnt_point);
+               }
+               return -1;
+       }
+
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add(b, "_SYSPOPUP_CONTENT_", "otg_remove");
+       ret = syspopup_launch("usbotg-syspopup", b);
+       if (ret < 0) {
+               USB_LOG("FAIL: popup lauch failed\n");
+       }
+       bundle_free(b);
+
+       /* Clean up unmounted directory */
+       ret = rmdir(mnt_point);
+       if (ret < 0) {
+               USB_LOG("FAIL: Removing Directory is unabled: PATH(%s)", mnt_point);
+       }
+       USB_LOG("Unmount/Remove Complete: MOUNT PATH(%s)", mnt_point);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int um_usb_storage_added()
+{
+       __USB_FUNC_ENTER__;
+       int ret = -1;
+       int fd = -1;
+       int i;
+
+       char *buf_dev;
+       char *mounted_check;
+       char *rel_mnt_point;
+       char buf_mnt_point[BUF_MAX];
+       char *sd_char;
+
+       do {
+               i = 0;
+               buf_dev = vconf_get_str(VCONFKEY_SYSMAN_ADDED_STORAGE_UEVENT);
+               if (buf_dev != NULL) {
+                       sd_char = strstr(buf_dev, "sd");
+                       if (sd_char == NULL) buf_dev = NULL;
+               }
+               USB_LOG("Wait...");
+               sleep(1);
+               i++;
+               if (i == 5) break;
+       } while(buf_dev == NULL);
+
+
+       /* Check whether mount point directory is exist */
+       if (access(MOUNT_POINT, F_OK) < 0) {
+               if (mkdir(MOUNT_POINT, 0755) < 0) {
+                       USB_LOG("FAIL: Make Mount Directory Failed: %s", MOUNT_POINT);
+                       return -1;
+               }
+       }
+
+       /* Mount tmpfs for protecting user data */
+       if (tmpfs_mounted != 1) {
+               if (mount("tmpfs", MOUNT_POINT, "tmpfs", 0, "") < 0) {
+                       if (errno != EBUSY) {
+                               USB_LOG("FAIL: Failed to mount USB Storage Mount Directory: %s", MOUNT_POINT);
+                               return -1;
+                       }
+               } else {
+                       /* Change permission to avoid to write user data on tmpfs */
+                       if (chmod(MOUNT_POINT, 0755) < 0) {
+                               USB_LOG("FAIL: Failed to change mode: %s", MOUNT_POINT);
+                               umount2(MOUNT_POINT, MNT_DETACH);
+                               return -1;
+                       }
+                       tmpfs_mounted = 1;
+               }
+       }
+
+       USB_LOG("buf_dev: %s", buf_dev);
+       USB_LOG("strrchr(buf_dev): %s", strrchr(buf_dev, '/'));
+       rel_mnt_point = strrchr(buf_dev, '/');
+
+       if (rel_mnt_point == NULL) {
+               USB_LOG("FAIL: Get Relative Mount Path Failed");
+               return -1;
+       }
+       snprintf(buf_mnt_point, BUF_MAX, "%s%s", MOUNT_POINT, rel_mnt_point);
+
+       if (um_mount_device(buf_dev)) {
+               USB_LOG("FAIL: um_mount_device(%s)", buf_dev);
+       }
+
+       FILE *file = setmntent(MTAB_FILE, "r");
+       struct mntent *mnt_entry;
+
+       /* Check whether block deivce is mounted */
+       while (mnt_entry = getmntent(file)) {
+               mounted_check = strstr(mnt_entry->mnt_fsname, buf_dev);
+               if (mounted_check != NULL) {
+                       if (added_noti_value < INT_MAX) {
+                               ++added_noti_value;
+                       } else {
+                               added_noti_value = 1;
+                       }
+                       /* Broadcast mounting notification */
+                       if (vconf_set_int(VCONFKEY_SYSMAN_ADDED_USB_STORAGE, added_noti_value) < 0) {
+                               USB_LOG("Setting vconf value is failed: KEY(%s)", VCONFKEY_SYSMAN_ADDED_USB_STORAGE);
+                               vconf_set_int(VCONFKEY_SYSMAN_ADDED_USB_STORAGE, -1);
+                       }
+
+                       USB_LOG("Setting vconf value: KEY(%s) DEVICE(%s)", VCONFKEY_SYSMAN_ADDED_USB_STORAGE, buf_dev);
+                       endmntent(file);
+
+                       bundle *b = NULL;
+                       b = bundle_create();
+                       bundle_add(b, "_SYSPOPUP_CONTENT_", "otg_add");
+                       bundle_add(b, "path", buf_mnt_point);
+                       ret = syspopup_launch("usbotg-syspopup", b);
+                       if (ret < 0) {
+                               USB_LOG("popup lauch failed\n");
+                       }
+                       bundle_free(b);
+                       return 0;
+               }
+       }
+       /* Failed to mount storage device */
+       USB_LOG("Nothing to be mounted: DEVICE(%s)", buf_dev);
+       endmntent(file);
+       __USB_FUNC_EXIT__;
+       return -1;
+}
+
+static int um_usb_storage_removed()
+{
+       __USB_FUNC_ENTER__;
+       int fd = -1;
+       char *buf_dev_name = vconf_get_str(VCONFKEY_SYSMAN_REMOVED_STORAGE_UEVENT);
+       char buf_mnt_point[BUF_MAX];
+
+       snprintf(buf_mnt_point, BUF_MAX, "%s/%s", MOUNT_POINT, buf_dev_name);
+
+       if (um_unmount_device(buf_mnt_point) == 0) {
+               if(umount2(MOUNT_POINT, MNT_DETACH) == 0)
+                       tmpfs_mounted = 1;
+               if (removed_noti_value < INT_MAX) {
+                       ++removed_noti_value;
+               } else {
+                       removed_noti_value = 1;
+               }
+               if (vconf_set_int(VCONFKEY_SYSMAN_REMOVED_USB_STORAGE, removed_noti_value) < 0) {
+                       USB_LOG("Setting vconf value is failed: KEY(%s)", VCONFKEY_SYSMAN_REMOVED_USB_STORAGE);
+                       vconf_set_int(VCONFKEY_SYSMAN_ADDED_USB_STORAGE, -1);
+               }
+               USB_LOG("Setting vconf value: KEY(%s) DEVICE(%s)", VCONFKEY_SYSMAN_REMOVED_USB_STORAGE, buf_dev_name);
+               return 0;
+       }
+       USB_LOG("Usb storage removed fail");
+       __USB_FUNC_EXIT__;
+       return -1;
+}
diff --git a/src/um_usb_server.c b/src/um_usb_server.c
new file mode 100644 (file)
index 0000000..3da160e
--- /dev/null
@@ -0,0 +1,812 @@
+/*
+ * usb-manager
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "um_usb_server.h"
+#include <vconf.h>
+#include <signal.h>
+
+char *tempAppId;
+int tempVendor, tempProduct;
+static struct sigaction sig_pipe_old_act;
+
+static void sig_pipe_handler(int signo, siginfo_t *info, void *data)
+{
+
+}
+
+void um_signal_init()
+{
+       __USB_FUNC_ENTER__;
+       struct sigaction sig_act;
+       sig_act.sa_handler = NULL;
+       sig_act.sa_sigaction = sig_pipe_handler;
+       sig_act.sa_flags = SA_SIGINFO;
+       sigemptyset(&sig_act.sa_mask);
+       sigaction(SIGPIPE, &sig_act, &sig_pipe_old_act);
+       __USB_FUNC_EXIT__;
+}
+
+int um_heynoti_add(int *fd, char *noti, void (*cb)(void *), UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!fd)   return -1;
+       if (!noti) return -1;
+       if (!cb)   return -1;
+       if (!ad)   return -1;
+
+       *fd = heynoti_init();
+       if (-1 == *fd) {
+               USB_LOG("FAIL: heynoti_init()");
+               return -1;
+       } else {
+               if (-1 == heynoti_subscribe(*fd, noti, cb, ad)) {
+                       USB_LOG("FAIL: heynoti_subscribe(fd)");
+                       return -1;
+               } else {
+                       if (-1 == heynoti_attach_handler(*fd)) {
+                               USB_LOG("FAIL: heynoti_attach_handler(fd)");
+                               return -1;
+                       } else {
+                               USB_LOG("Success to register heynoti ");
+                       }
+               }
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_heynoti_remove(int fd, char *noti, void (*cb)(void *))
+{
+       __USB_FUNC_ENTER__;
+       if (!noti) return -1;
+       if (!cb) return -1;
+       if (heynoti_unsubscribe(fd, noti, cb) < 0) {
+               USB_LOG("ERROR: heynoti_unsubscribe() \n");
+       }
+       if (heynoti_detach_handler(fd) < 0) {
+               USB_LOG("ERROR: heynoti_detach_handler() \n");
+       }
+       heynoti_close(fd);
+        __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int terminate_usbclient_connection(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+       int status = -1;
+
+       ret = um_usb_server_release_handler(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usb_server_release_handler(ad)\n");
+
+       ret = um_usbclient_vconf_key_ignore(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usbclient_vconf_key_ignore(ad)");
+
+       ret = um_usbclient_heynoti_unsubscribe(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usbclient_heynoti_unsubscribe(ad)");
+
+       ret = disconnectUsbClient(ad);
+       if(0 != ret) USB_LOG("FAIL: disconnectUsbClient(ad)");
+
+       /* If USB accessory is removed, the vconf value of accessory status should be updated */
+       ret = vconf_get_int(VCONFKEY_USB_ACCESSORY_STATUS, &status);
+       if (0 == ret && VCONFKEY_USB_ACCESSORY_STATUS_CONNECTED == status) {
+               ret = vconf_set_int(VCONFKEY_USB_ACCESSORY_STATUS,
+                                               VCONFKEY_USB_ACCESSORY_STATUS_DISCONNECTED);
+               if(0 != ret) USB_LOG("FAIL: vconf_set_int(VCONFKEY_USB_ACCESSORY_STATUS");
+               ret = disconnectAccessory(ad);
+               if(0 != ret) USB_LOG("FAIL: disconnectAccessory(ad)\n");
+       }
+
+       ecore_main_loop_quit();
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int terminate_usbhost_connection(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+
+       ret = um_usb_server_release_handler(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usb_server_release_handler(ad)\n");
+
+       ret = um_usbhost_vconf_key_ignore(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usbhost_vconf_key_ignore(ad)");
+
+       ret = um_usbhost_heynoti_unsubscribe(ad);
+       if (0 > ret) USB_LOG("FAIL: um_usbhost_heynoti_unsubscribe(ad)");
+
+       ret = disconnectUsbHost(ad);
+       if (0 != ret) USB_LOG("FAIL: disconnectUsbHost(ad)");
+
+       ecore_main_loop_quit();
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static void um_usbclient_chgdet_cb(keynode_t *in_key, void *data)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return;
+       UmMainData *ad = (UmMainData *)data;
+       int status = -1;
+       int ret = -1;
+       status = check_usbclient_connection();
+
+       switch(status) {
+       case USB_CLIENT_DISCONNECTED:
+               ret = terminate_usbclient_connection(ad);
+               um_retm_if(0 != ret, "FAIL: terminate_usbclient_connection(ad)");
+               break;
+       case USB_CLIENT_CONNECTED:
+               ret = connectUsbClient(ad);
+               um_retm_if(0 != ret, "FAIL: connectUsbClient(ad)");
+               if (USB_CLIENT_DISCONNECTED == check_usbclient_connection()) {
+                       ret = terminate_usbclient_connection(ad);
+                       um_retm_if(0 != ret, "FAIL: terminate_usbclient_connection(ad)\n");
+               }
+               break;
+       default:
+               break;
+       }
+       __USB_FUNC_EXIT__;
+}
+
+static void um_usbclient_acc_chgdet_cb(void *data)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return;
+       UmMainData *ad = (UmMainData *)data;
+       int status;
+       int ret;
+       status = check_usbclient_connection();
+       if (USB_CLIENT_CONNECTED == status) {
+               USB_LOG("ACC_CONNECTED %d", status);
+               ret = vconf_get_int(VCONFKEY_USB_ACCESSORY_STATUS, &status);
+               um_retm_if(0 != ret, "FAIL: vconf_get_int(VCONFKEY_USB_ACCESSORY_STATUS)\n");
+               if (VCONFKEY_USB_ACCESSORY_STATUS_DISCONNECTED == status) {
+                       ret = connectAccessory(ad);
+                       um_retm_if(ret != 0, "FAIL: connectAccessory(ad)\n");
+
+                       ret = vconf_set_int(VCONFKEY_USB_ACCESSORY_STATUS,
+                                                               VCONFKEY_USB_ACCESSORY_STATUS_CONNECTED);
+                       um_retm_if(ret != 0, "FAIL: vconf_set_int(VCONFKEY_USB_ACCESSORY_STATUS)");
+               }
+       }
+       __USB_FUNC_EXIT__;
+}
+
+static void um_usbhost_chgdet_cb(keynode_t *in_key, void *data)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return;
+       UmMainData *ad = (UmMainData *)data;
+       int ret = -1;
+       int status = check_usbhost_connection();
+
+       if (USB_HOST_DISCONNECTED == status) {
+               ret = terminate_usbhost_connection(ad);
+               um_retm_if(0 > ret, "FAIL: terminnate_usbhost_connection(ad)");
+       }
+
+       __USB_FUNC_EXIT__;
+}
+
+int um_usbclient_vconf_key_notify(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, change_mode_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT)");
+
+#ifndef SIMULATOR
+       ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, debug_mode_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL)");
+#endif
+
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_STATUS, um_usbclient_chgdet_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_STATUS)");
+
+       ret = vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, change_hotspot_status_cb, ad);
+       if (0 != ret) {
+               USB_LOG("ERROR: vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE)");
+       }
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbclient_vconf_key_ignore(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_SEL_MODE_INT, change_mode_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT)");
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS, um_usbclient_chgdet_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS)");
+
+       ret = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, change_hotspot_status_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE)");
+
+#ifndef SIMULATOR
+       ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, debug_mode_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL)");
+#endif
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbhost_vconf_key_notify(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_HOST_STATUS,
+                                                                       um_usbhost_chgdet_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_HOST_STATUS)");
+
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_ADDED_STORAGE_UEVENT,
+                                                                       add_mass_storage_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_ADD_STORAGE_UEVENT)");
+
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_REMOVED_STORAGE_UEVENT,
+                                                                       remove_mass_storage_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_REMOVE_STORAGE_UEVENT)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbhost_vconf_key_ignore(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_HOST_STATUS,
+                                                                       um_usbhost_chgdet_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_HOST_STATUS)");
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_ADDED_STORAGE_UEVENT,
+                                                                       add_mass_storage_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_ADD_STORAGE_UEVENT)");
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_REMOVED_STORAGE_UEVENT,
+                                                                       remove_mass_storage_cb);
+       if (0 != ret) USB_LOG("FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_REMOVE_STORAGE_UEVENT)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbclient_heynoti_subscribe(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = um_heynoti_add(&(ad->acc_noti_fd), "device_usb_accessory",
+                                                                                       um_usbclient_acc_chgdet_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_heynoti_add(ad->acc_noti_fd)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbclient_heynoti_unsubscribe(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = um_heynoti_remove(ad->acc_noti_fd, "device_usb_accessory",
+                                                                                       um_usbclient_acc_chgdet_cb);
+       if (0 != ret) USB_LOG("FAIL: um_heynoti_remove(ad->acc_noti_fd)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbhost_heynoti_subscribe(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = um_heynoti_add(&(ad->host_add_noti_fd), "device_usb_host_add",
+                                                                                       add_host_noti_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_heynoti_add(ad->host_add_noti_fd)");
+
+       ret = um_heynoti_add(&(ad->host_remove_noti_fd), "device_usb_host_remove",
+                                                                                       remove_host_noti_cb, ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_heynoti_add(ad->host_remove_noti_fd)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usbhost_heynoti_unsubscribe(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+
+       ret = um_heynoti_remove(ad->host_add_noti_fd, "device_usb_host_add",
+                                                                                       add_host_noti_cb);
+       if (0 != ret) USB_LOG("FAIL: um_heynoti_remove(ad->host_add_noti_fd)");
+
+       ret = um_heynoti_remove(ad->host_remove_noti_fd, "device_usb_host_remove",
+                                                                                       remove_host_noti_cb);
+       if (0 != ret) USB_LOG("FAIL: um_heynoti_remove(ad->host_remove_noti_fd)");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usb_server_register_handler(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+
+       /* Init server socket for IPC with Accessroy apps and Host apps */
+       ad->server_sock_local = ipc_request_server_init();
+       um_retvm_if(0 > ad->server_sock_local, -1, "FAIL: ipc_request_server_init()\n");
+
+       /* Add fd handler for pipe between main thread and IPC thread */
+       ad->ipcRequestServerFdHandler = ecore_main_fd_handler_add(ad->server_sock_local,
+                                                                               ECORE_FD_READ, answer_to_ipc, ad, NULL, NULL);
+       um_retvm_if(NULL == ad->ipcRequestServerFdHandler, -1, "FAIL: ecore_main_fd_handler_add()");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usb_server_release_handler(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+
+       /* Remove fd handler for pipe between main thread and IPC thread */
+       if (ad->ipcRequestServerFdHandler != NULL) {
+               ecore_main_fd_handler_del(ad->ipcRequestServerFdHandler);
+               ad->ipcRequestServerFdHandler = NULL;
+       }
+
+       /* Close server socket for IPC with Accessroy apps and Host apps */
+       ipc_request_server_close(ad);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+#ifndef SIMULATOR
+int um_usbclient_value_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+       int debugMode = 0;
+
+       ret = vconf_get_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, &debugMode);
+       if (ret < 0) {
+               USB_LOG("FAIL: vconf_get_int(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL)");
+               /* Set debug mode to true to find problems */
+               debugMode = 1;
+               ret = vconf_set_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, debugMode);
+               if (ret < 0) USB_LOG("FAIL: vconf_set_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL()");
+       }
+       if (debugMode == 1) {
+               ad->prevDebugMode = true;
+               ad->curDebugMode = true;
+       } else if (debugMode == 0) {
+               ad->prevDebugMode = false;
+               ad->curDebugMode = false;
+       } else {
+               USB_LOG("debugMode %d is improper");
+               return -1;
+       }
+
+       umAccInfoInit(ad);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+#else
+int um_usbclient_value_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       umAccInfoInit(ad);
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+#endif
+
+int um_usbhost_device_list_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if(!ad) return -1;
+       int ret = -1;
+       int status;
+       int defNumDevices;
+       ret = get_default_usb_device(ad);
+       if (ret < 0) {
+               USB_LOG("FAIL: get_default_usb_device()");
+       }
+
+       show_all_usb_devices(ad->defaultDevList, 1);
+
+       ad->devList = NULL;
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int noti_selected_btn(UmMainData *ad, int input)
+{
+       __USB_FUNC_ENTER__;
+       int sock_remote = -1;
+       char buf[SOCK_STR_LEN];
+       int ret = -1;
+       int ipc_result = -1;
+       switch (input) {
+       case REQ_ACC_PERM_NOTI_YES_BTN:
+               ret = grantAccessoryPermission(ad, tempAppId);
+               if (0 != ret) {
+                       USB_LOG("FAIL: grant_permission_to_app(appId)");
+               }
+               break;
+       case REQ_HOST_PERM_NOTI_YES_BTN:
+               ret = grantHostPermission(ad, tempAppId, tempVendor, tempProduct);
+               if (0 != ret) {
+                       USB_LOG("grandHostPermission()\n");
+               }
+               break;
+       default:
+               break;
+       }
+
+       FREE(tempAppId);
+       tempVendor = 0;
+       tempProduct = 0;
+       sock_remote = ipc_noti_server_init();
+       um_retvm_if(sock_remote < 0, -1, "FAIL: ipc_noti_server_init()\n");
+       ret = notice_to_client_app(sock_remote, input, buf);
+       if (ret == 0) {
+               ipc_result = atoi(buf);
+       }
+       ret = ipc_noti_server_close(&sock_remote);
+       um_retvm_if(ret < 0, -1, "FAIL: ipc_socket_client_close(&sock_remote)\n");
+       if (IPC_SUCCESS != ipc_result) {
+               return -1;
+       }
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int divide_str(char* str1, char** str2)
+{
+       __USB_FUNC_ENTER__;
+       if(!str1 || !str2) return -1;
+       char *tmp = str1;
+       if (str1) {
+               while (*tmp++) {
+                       if('|' == *tmp) {
+                               *tmp = '\0';
+                               tmp++;
+                               break;
+                       }
+                       USB_LOG("#");
+               }
+       }
+       *str2 = tmp;
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+Eina_Bool answer_to_ipc(void *data, Ecore_Fd_Handler *fd_handler)
+{
+       __USB_FUNC_ENTER__;
+       if (!data) return ECORE_CALLBACK_RENEW;
+       UmMainData *ad = (UmMainData *)data;
+       char str[SOCK_STR_LEN];
+       int fd, input, output, t, n;
+       int ret = -1;
+       struct sockaddr_un remote;
+       char *appId = NULL;
+       char *strVendor = NULL;
+       char *strProduct = NULL;
+       int vendor = -1;
+       int product = -1;
+
+       if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ) == EINA_FALSE)
+               return ECORE_CALLBACK_RENEW;
+       fd = ecore_main_fd_handler_fd_get(fd_handler);
+
+       t = sizeof(remote);
+       if ((ad->server_sock_remote
+               = accept(ad->server_sock_local, (struct sockaddr *)&remote, &t)) == -1) {
+               perror("accept");
+               USB_LOG("FAIL: accept(ad->server_sock_local, (struct sockaddr *)&remote, &t)\n");
+               return ECORE_CALLBACK_RENEW;
+       }
+       n = recv(ad->server_sock_remote, str, SOCK_STR_LEN, 0);
+       if (n <= 0) {
+               snprintf(str, SOCK_STR_LEN, "ERROR");
+       } else {
+               if (n < SOCK_STR_LEN) {
+                       str[n] = '\0';
+               } else { /* n == SOCK_STR_LEN */
+                       str[SOCK_STR_LEN-1] = '\0';
+               }
+               USB_LOG("[SERVER] Received value: %s", str);
+               ret = divide_str(str, &appId);
+               um_retvm_if(ret < 0, ECORE_CALLBACK_RENEW, "FAIL: divide_str(str, &appId)\n");
+               input = atoi(str);
+               USB_LOG("input: %d, appId: %s\n", input, appId);
+               switch(input) {
+               case REQ_HOST_PERMISSION:
+               case HAS_HOST_PERMISSION:
+               case REQ_HOST_PERM_NOTI_YES_BTN:
+               case REQ_HOST_PERM_NOTI_NO_BTN:
+               case REQ_HOST_CONNECTION:
+                       ret = divide_str(appId, &strVendor);
+                       um_retvm_if(ret < 0, ECORE_CALLBACK_RENEW, "FAIL: divide_str(appId, &strVendor)\n");
+                       ret = divide_str(strVendor, &strProduct);
+                       um_retvm_if(ret < 0, ECORE_CALLBACK_RENEW, "FAIL: divide_str(appId, &strProduct)\n");
+                       vendor = atoi(strVendor);
+                       product = atoi(strProduct);
+                       USB_LOG("appId: %s, vendor: %d, product: %d\n", appId, vendor, product);
+                       break;
+               default:
+                       break;
+               }
+
+               switch(input) {
+               case LAUNCH_APP_FOR_ACC:
+                       ret = grantAccessoryPermission(ad, appId);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: grant_permission_to_app(appId)");
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_ERROR);
+                               break;
+                       }
+                       ret = launch_acc_app(ad->permittedPkgForAcc);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: launch_app(appId)");
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_ERROR);
+                               break;
+                       }
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       break;
+               case REQ_ACC_PERMISSION:
+                       tempAppId = strdup(appId);
+                       USB_LOG("tempAppId: %s\n", tempAppId);
+                       load_system_popup(ad, REQ_ACC_PERM_POPUP);
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       break;
+               case HAS_ACC_PERMISSION:
+                       if (EINA_TRUE == hasAccPermission(ad, appId)) {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       } else {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_FAIL);
+                       }
+                       break;
+               case REQ_ACC_PERM_NOTI_YES_BTN:
+               case REQ_ACC_PERM_NOTI_NO_BTN:
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       ret = noti_selected_btn(ad, input);
+                       if (ret < 0) USB_LOG("FAIL: noti_selected_btn(input)\n");
+                       break;
+               case GET_ACC_INFO:
+                       snprintf(str, SOCK_STR_LEN, "%s|%s|%s|%s|%s|%s",
+                                                       ad->usbAcc->manufacturer,
+                                                       ad->usbAcc->model,
+                                                       ad->usbAcc->description,
+                                                       ad->usbAcc->version,
+                                                       ad->usbAcc->uri,
+                                                       ad->usbAcc->serial);
+                       break;
+               case ERROR_POPUP_OK_BTN:
+                       usb_connection_selected_btn(ad, input);
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       break;
+               case LAUNCH_APP_FOR_HOST:
+                       ret = grantHostPermission(ad, appId, vendor, product);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: grandHostPermission()\n");
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_ERROR);
+                               break;
+                       }
+                       ret = launch_host_app(appId);
+                       if (0 != ret) {
+                               USB_LOG("FAIL: launch_host_app(appId)\n");
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_ERROR);
+                               break;
+                       }
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       break;
+               case REQ_HOST_PERMISSION:
+                       tempAppId = strdup(appId);
+                       tempVendor = vendor;
+                       tempProduct = product;
+                       load_system_popup(ad, REQ_HOST_PERM_POPUP);
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       break;
+               case HAS_HOST_PERMISSION:
+                       if (EINA_TRUE == hasHostPermission(ad, appId, vendor, product)) {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       } else {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_FAIL);
+                       }
+                       break;
+               case REQ_HOST_PERM_NOTI_YES_BTN:
+               case REQ_HOST_PERM_NOTI_NO_BTN:
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       ret = noti_selected_btn(ad, input);
+                       if (ret < 0) USB_LOG("FAIL: noti_selected_btn(input)\n");
+                       break;
+               case REQ_HOST_CONNECTION:
+                       if (EINA_TRUE == is_host_connected(ad, vendor, product)) {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       } else {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_FAIL);
+                       }
+                       break;
+               case IS_EMUL_BIN:
+                       if (is_emul_bin()) {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_SUCCESS);
+                       } else {
+                               snprintf(str, SOCK_STR_LEN, "%d", IPC_FAIL);
+                       }
+                       break;
+               default:
+                       snprintf(str, SOCK_STR_LEN, "%d", IPC_ERROR);
+                       break;
+               }
+       }
+       USB_LOG("str: %s", str);
+
+       if(send(ad->server_sock_remote, str, strlen(str)+1, 0) < 0) {
+               USB_LOG("FAIL: end(ad->server_sock_remote, str, strlen(str)+1, 0)\n");
+       }
+
+       __USB_FUNC_EXIT__;
+       return ECORE_CALLBACK_RENEW;
+}
+
+static int um_usbclient_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+
+       ad->isHostOrClient = USB_DEVICE_CLIENT;
+
+       ret = um_usbclient_value_init(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usbclient_value_init(ad)");
+
+       ret = check_driver_version(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: check_driver_version(ad)");
+
+       ret = um_usbclient_vconf_key_notify(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_vconf_key_notify(ad)");
+
+       ret = um_usbclient_heynoti_subscribe(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usbclient_heynoti_subscribe(ad)");
+
+       um_usbclient_chgdet_cb(NULL, ad);
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+static int um_usbhost_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       if (!ad) return -1;
+       int ret = -1;
+
+       ad->isHostOrClient = USB_DEVICE_HOST;
+       ad->usbctx = NULL;
+       int i = 0;
+       do {
+               ret = libusb_init(&(ad->usbctx));
+               USB_LOG("libusb_init() return value : %d", ret);
+               if (i > 10) {
+                       USB_LOG("FAIL: libusb_init()");
+                       load_connection_popup(ad, "Error: Remove and reconnect USB device",
+                                                                               TICKERNOTI_ORIENTATION_TOP);
+                       return 1;
+               } else {
+                       i++;
+                       USB_LOG("Wait...");
+                       sleep(1);
+               }
+       } while(ret != 0);
+
+       /* Getting default device list */
+       ret = um_usbhost_device_list_init(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usbhost_device_list_init(ad)");
+
+       ret = um_usbhost_vconf_key_notify(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usbhost_vconf_key_notify(ad)");
+
+       ret = um_usbhost_heynoti_subscribe(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usbclient_heynoti_subscribe(ad)");
+
+       if (USB_HOST_DISCONNECTED == check_usbhost_connection()) {
+               um_usbhost_chgdet_cb(NULL, ad);
+               return 1;       /* USB host is not available */
+       } else {
+               load_connection_popup(ad, "IDS_COM_POP_USB_CONNECTOR_CONNECTED", TICKERNOTI_ORIENTATION_TOP);
+       }
+
+       /* Check devices which is connected before init process */
+       ret = add_usb_device_to_list(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: add_usb_device_to_list(ad)");
+
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
+
+int um_usb_server_init(UmMainData *ad)
+{
+       __USB_FUNC_ENTER__;
+       /* In case that heynoties are subscribed after a noti arrives, 
+        * check whether or not a noti already arrived and do something */
+       if(!ad) return -1;
+       int ret = -1;
+       pm_change_state(LCD_NORMAL);
+
+       if (USB_CLIENT_CONNECTED == check_usbclient_connection()) {
+               USB_LOG("USB cable is connected");
+               ret = um_usbclient_init(ad);
+               um_retvm_if(0 > ret, -1, "FAIL: um_usbclient_init(ad)"); 
+       } else {
+               if (USB_HOST_CONNECTED == check_usbhost_connection()) {
+                       USB_LOG("USB host is connected");
+                       ret = um_usbhost_init(ad);
+                       um_retvm_if(0 > ret , -1, "FAIL: um_usbhost_init(ad)");
+                       um_retvm_if(1 == ret, 0, "USB host is not available");
+               } else {
+                       /* USB cable is disconnected */
+                       USB_LOG("USB cable or device is removed");
+                       ecore_main_loop_quit();
+                       __USB_FUNC_EXIT__;
+                       return 0;
+               }
+       }
+
+       ret = um_usb_server_register_handler(ad);
+       um_retvm_if(0 != ret, -1, "FAIL: um_usb_server_register_handler()");
+
+       __USB_FUNC_EXIT__;
+       return 0;
+}
diff --git a/start_dr.sh b/start_dr.sh
new file mode 100755 (executable)
index 0000000..bff365d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# start data-router
+if (/bin/ps -e | /bin/grep data-router); then
+  /bin/echo "Already DR activated. No need launch DR"
+else
+  /bin/echo "Launch DR"
+  /usr/bin/data-router &
+fi
diff --git a/udev-rules/91-usb-server.rules.in b/udev-rules/91-usb-server.rules.in
new file mode 100644 (file)
index 0000000..eda12fe
--- /dev/null
@@ -0,0 +1,2 @@
+#USB accessory
+ACTION=="change" DEVPATH=="/devices/virtual/misc/usb_accessory", ENV{ACCESSORY}=="START" RUN+="/usr/bin/sys_event device_usb_accessory"