--- /dev/null
+Taeyoung Kim <ty317.kim at samsung dot com>\r
+Suchang Woo <suchang.woo at samsung dot com>\r
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(usb-syspopup C)
+
+SET(SRCS usb-syspopup.c)
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.${PROJECT_NAME}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(DATADIR "${PREFIX}/share")
+SET(LOCALEDIR "${DATADIR}/locale")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ appcore-efl
+ bundle
+ dlog
+ ecore
+ elementary
+ evas
+ syspopup
+ devman
+ heynoti
+ vconf)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O2 -g")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} syspopup ${pkgs_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+# install manifest file
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PKGNAME}.xml DESTINATION /usr/share/packages/)
+
+ADD_SUBDIRECTORY(po)
--- /dev/null
+
+ 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.
--- /dev/null
+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.
--- /dev/null
+usb-syspopup (0.0.1-1) unstable; urgency=low
+
+ * Initial Commit
+ * Git: slp/pkgs/u/usb-syspopup
+ * Tag: usb-syspopup_0.0.1-1
+
+ -- Taeyoung Kim <ty317.kim@samsung.com> Mon, 19 Mar 2012 11:00:59 +0900
+
--- /dev/null
+Source: usb-syspopup
+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),
+ libelm-dev,
+ libappcore-efl-dev,
+ libecore-dev,
+ libevas-dev,
+ libheynoti-dev,
+ libslp-setting-dev,
+ libdevman-dev,
+ dlog-dev,
+ syspopup-dev,
+ iniparser-dev,
+ libattr1-dev
+Standards-Version: 3.7.2
+
+Package: org.tizen.usb-syspopup
+Section: devel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: usb system popup package
+
+Package: org.tizen.usb-syspopup-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, org.tizen.usb-syspopup (= ${Source-Version})
+Description: usb system popup degug package
--- /dev/null
+@PREFIX@/bin/usb-syspopup
+@PREFIX@/share/locale/*/LC_MESSAGES/usb-syspopup.mo
+@PREFIX@/share/packages/org.tizen.usb-syspopup.xml
--- /dev/null
+#!/bin/sh
+#This is usb-syspopup postinst file
+
+
+vconftool set -t int db/setting/select_popup_btn "0" -u 5000
+
+
+sync
+
--- /dev/null
+#!/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 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
+
+
+
+
+ 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
+
+
+# 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=org.tizen.usb-syspopup-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
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.usb-syspopup" version="0.0.1" install-location="internal-only">
+ <label>Usb syspopup</label>
+ <author email="ty317.kim@samsung.com" href="www.samsung.com">Taeyoung Kim</author>
+ <description>USB System Popup Application</description>
+ <ui-application appid="org.tizen.usb-syspopup" exec="/usr/bin/usb-syspopup" nodisplay="true" multiple="false" type="capp" taskmanage="false">
+ <label>Usb syspopup</label>
+ <label xml:lang="en-us">Usb system popup</label>
+ <label xml:lang="nl-nl">Usb-systeem pop-up</label>
+ <label xml:lang="de-de">USB-System popup</label>
+ <label xml:lang="zh-hk">USB系統彈出</label>
+ <label xml:lang="zh-cn">USB系统弹出</label>
+ <label xml:lang="ru-ru">Usb система всплывающих</label>
+ <label xml:lang="zh-tw">USB系統彈出</label>
+ <label xml:lang="ja-jp">USBシステムのポップアップ</label>
+ <label xml:lang="es-es">USB del sistema emergente</label>
+ <label xml:lang="el-gr">Usb σύστημα popup</label>
+ <label xml:lang="it-it">Usb sistema popup</label>
+ <label xml:lang="tr-tr">Usb sistemi açılır</label>
+ <label xml:lang="pt-pt">Usb sistema pop-up</label>
+ <label xml:lang="fr-fr">Usb système contextuel</label>
+ <label xml:lang="ko-kr">USB 시스템 팝업</label>
+ </ui-application>
+</manifest>
--- /dev/null
+<manifest>
+ <define>
+ <domain name="usb-syspopup"/>
+ <provide>
+ <label name="usb-syspopup::usb-rx"/>
+ </provide>
+ </define>
+ <assign>
+ <filesystem path="/usr/bin/usb-syspopup" label="usb-syspopup::usb-rx" exec_label="usb-syspopup::usb-rx"/>
+ </assign>
+ <request>
+ <domain name="usb-syspopup"/>
+ </request>
+</manifest>
--- /dev/null
+Name: org.tizen.usb-syspopup
+Summary: USB system popup
+Version: 0.0.5
+Release: 1
+Group: framework-system
+License: APLv2
+Source0: org.tizen.usb-syspopup-%{version}.tar.gz
+Source1: org.tizen.usb-syspopup.manifest
+
+BuildRequires: cmake
+BuildRequires: libattr-devel
+BuildRequires: gettext-devel
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(devman)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(syspopup)
+
+%description
+Description: USB system popup
+
+
+%prep
+%setup -q
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+
+%build
+cp %{SOURCE1} .
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+%post
+chown 5000:5000 /usr/bin/usb-syspopup
+chown 5000:5000 /usr/share/locale/*/LC_MESSAGES/usb-syspopup.mo
+vconftool set -t int db/setting/select_popup_btn "0" -u 5000
+
+%files
+%manifest org.tizen.usb-syspopup.manifest
+%defattr(440,root,root,-)
+%attr(540,root,root) /usr/bin/usb-syspopup
+/usr/share/locale/*/LC_MESSAGES/usb-syspopup.mo
+/usr/share/packages/org.tizen.usb-syspopup.xml
--- /dev/null
+# 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-syspopup.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po_usb_syspopup ALL DEPENDS ${moFiles})
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "فشل اتصال USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "ملحق USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "هل تريد السماح للتطبيق بالوصول إلى ملحق USB؟"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB bağlantısı alınmadı"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB aksesuarı"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Proqrama USB aksesuarına daxil olmağa icazə verilsin?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB връзката е неуспешна"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB аксесоар"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Позволяване на приложението достъп до USB аксесоара?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Error de connexió USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accessori USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Permetre a l'aplicació accedir a l'accessori USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Připojení USB se nezdařilo"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Příslušenství USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Povolit aplikaci používat příslušenství USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-forbindelse mislykkedes"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-tilbehør"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Tillad, at programmet får adgang til USB-tilbehør?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-Verbindung fehlgeschlagen"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-Gerät"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Anwendung den Zugriff auf das USB-Gerät erlauben?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Η σύνδεση USB απέτυχε"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Αξεσουάρ USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Να επιτρέπεται στην εφαρμογή πρόσβαση σε αξεσουάρ USB;"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB connection failed"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB accessory"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Allow application to access USB accessory?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB connection failed"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB accessory"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Allow application to access USB accessory?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB connection failed"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB accessory"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Allow application to access USB accessory?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Error de conexión USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accesorio USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "¿Permitir a la aplicación acceder al accesorio USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Falló la conexión USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accesorio USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "¿Permitir que la aplicación acceda al accesorio USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-ühendus nurjus"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-tarvik"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Kas lubada rakendusel juurde pääseda USB-tarvikule?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB konexioak huts egin du"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB osagarria"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Baimena eman aplikazioari USB osagarrira sartzeko?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-yhteys epäonnistui"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-lisälaite"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Annetaanko sovelluksen käyttää USB-lisälaitetta?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Échec de la connexion USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accessoire USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Autoriser l'application à accéder à l'accessoire USB ?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Echec de la connexion USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accessoire USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Autoriser l'application à accéder à l'accessoire USB ?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Theip ar nasc USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Oiriúint USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Ceadaigh d'fheidhmchlár oiriúint USB a rochtain?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Erro na conexión USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accesorio USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Desexas permitir á aplicación acceder ao accesorio USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB कनेक्शन विफल"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB उपसाधन"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "एप्लीकेशन को USB उपसाधन ऍक्सेस करने की अनुमति दें?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Greška USB veze"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB priključak"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Dopustiti aplikaciji pristup USB priključku?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Sikertelen USB-kapcsolat"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-tartozék"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Lehetővé teszi a(z) alkalmazás számára a hozzáférést az USB-tartozékhoz?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB միացումը ձախողվեց"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB լրասարք"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Թույլ տա՞լ, որ ծրագիրը մուտք գործի USB լրասարք:"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-tenging mistókst"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-aukahlutur"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Leyfa forritinu að fá aðgang að USB-aukabúnaðinum?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Connessione USB non riuscita"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accessorio USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Consentire all'applicazione di accedere all'accessorio USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB接続に失敗しました。"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USBアクセサリ"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "アプリケーションに、USBアクセサリへのアクセスを許可しますか?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB კავშირი ვერ დამყარდა"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB აქსესუარი"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "პროგრამას ჰქონდეს წვდომა USB აქსესუარზე?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB қосылмады"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB аксессуары"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "бағдарламасына USB аксессуарына кіруге мүмкіндік беру керек пе?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB 연결 실패"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB 액세서리"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "애플리케이션이 USB 액세서리에 접근할 수 있도록 허용할까요?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Nutrūko USB ryšys"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB priedas"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Leisti programai pasiekti USB priedą?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB savienojums neizdevās"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB piederums"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Vai ļaut programmai piekļūt USB piederumam?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Неуспешно поврзување USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB додаток"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Да се дозволи апликацијата да пристапи до USB додатокот?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-tilkobling mislyktes"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-enhet"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Tillate at programmet får tilgang til USB-tilbehør?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-verbinding mislukt"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-accessoire"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Mag applicatie toegang krijgen tot USB-accessoire?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Połączenie USB nie powiodło się"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Akcesorium USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Zezwolić aplikacji na uzyskiwanie dostępu do akcesorium USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Falha da conexão USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Acessório USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Permitir que o aplicativo acesse o acessório USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Ligação USB falhou"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Acessório USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Permitir que a aplicação aceda ao acessório USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Conexiunea USB nu a reuşit"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Accesoriu USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Permiteţi aplicaţiei să acceseze accesoriul USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Сбой подключения через USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-аксессуар"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Разрешить приложению получать доступ к USB-аксессуару?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Pripojenie USB zlyhalo"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Príslušenstvo USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Povoliť aplikácii prístup k príslušenstvu USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Povezava USB ni uspela"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "Dodatek USB"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Dovolite programu, da dostopa do dodatka USB?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB veza nije uspostavljena"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB pribor"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Dozvoliti aplikaciji da pristupi USB priboru?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB-anslutningen misslyckades"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-tillbehör"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Tillåt att programmet får åtkomst till USB-tillbehöret?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB bağlantısı kurulamadı"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB aksesuarı"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Uygulama'nin USB aksesuarına erişmesine izin verilsin mi?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "Збій підключення через USB"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB-аксесуар"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "Дозволити програмі отримувати доступ до цього USB-пристрою?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB ulanishi bajarilmadi"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB aksessuari"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "ilovasiga USB aksessuariga kirish uchun ruxsat berilsinmi?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB 连接失败"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB配件"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "是否允许应用程序 访问 USB 附件?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB 連接失敗"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB 配件"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "允許應用程式 存取 USB 配件嗎?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB 连接失败"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB 附件"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "是否允许应用程序 访问 USB 附件?"
+
--- /dev/null
+msgid "IDS_USB_POP_USB_CONNECTION_FAILED"
+msgstr "USB 連接失敗"
+
+msgid "IDS_COM_HEADER_USB_ACCESSORY"
+msgstr "USB 配件"
+
+msgid "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB"
+msgstr "允許應用程式 存取 USB 配件嗎?"
+
--- /dev/null
+/*
+ * usb-syspopup
+ * 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 <stdio.h>
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <devman.h>
+#include <heynoti.h>
+
+#include <time.h>
+#include "usb-syspopup.h"
+
+#define SYSPOPUP_PARAM_LEN 3
+#define USB_SYSPOPUP_MESSAGE_DOMAIN \
+ "usb-syspopup"
+#define USB_NOTICE_SYSPOPUP_FAIL \
+ "USB system popup failed."
+
+char *matchedApps[MAX_NUM_OF_MATCHED_APPS];
+Elm_Genlist_Item_Class itc;
+Evas_Object *genlist;
+Elm_Object_Item *item;
+
+syspopup_handler handler = {
+ .def_term_fn = NULL,
+ .def_timeout_fn = NULL
+};
+
+int ipc_socket_client_init(int *sock_remote)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!sock_remote) return -1;
+ int t, len;
+ struct sockaddr_un remote;
+ char str[SOCK_STR_LEN];
+
+ if (((*sock_remote) = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+ perror("socket");
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: socket(AF_UNIX, SOCK_STREAM, 0)");
+ return -1;;
+ }
+ remote.sun_family = AF_UNIX;
+ strncpy(remote.sun_path, 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(USB_LOG_VERBOSE, "FAIL: connect((*sock_remote), (struct sockaddr *)&remote, len)");
+ return -1;
+ }
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+int ipc_socket_client_close(int *sock_remote)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!sock_remote) return -1;
+ close (*sock_remote);
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+static void __win_del(void *data, Evas_Object * obj, void *event)
+{
+ __USB_FUNC_ENTER__ ;
+ elm_exit();
+ __USB_FUNC_EXIT__ ;
+}
+
+static Evas_Object *__create_win(const char *name)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!name) return NULL;
+ Evas_Object *eo;
+ int w;
+ int h;
+
+ eo = elm_win_add(NULL, name, ELM_WIN_DIALOG_BASIC);
+ if (eo) {
+ elm_win_title_set(eo, name);
+ elm_win_borderless_set(eo, EINA_TRUE);
+ elm_win_alpha_set(eo, EINA_TRUE);
+ elm_win_raise(eo);
+ evas_object_smart_callback_add(eo, "delete,request",
+ __win_del, NULL);
+ ecore_x_window_size_get(ecore_x_window_root_first_get(),
+ &w, &h);
+ evas_object_resize(eo, w, h);
+ }
+
+ __USB_FUNC_EXIT__ ;
+
+ return eo;
+}
+
+static void usp_usbclient_chgdet_cb(keynode_t *in_key, void *data)
+{
+ __USB_FUNC_ENTER__ ;
+ int ret = -1;
+ int usb_status = -1;
+
+ ret = vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, &usb_status);
+ if (ret == 0 && usb_status == VCONFKEY_SYSMAN_USB_DISCONNECTED) {
+ USB_LOG(USB_LOG_VERBOSE, "USB cable is not connected");
+ elm_exit();
+ }
+ __USB_FUNC_EXIT__ ;
+}
+
+static void usp_usbhost_chgdet_cb(keynode_t *in_key, void *data)
+{
+ __USB_FUNC_ENTER__ ;
+ int ret = -1;
+ int usb_status = -1;
+
+ ret = vconf_get_int(VCONFKEY_SYSMAN_USBHOST_STATUS, &usb_status);
+ if (ret == 0 && usb_status == VCONFKEY_SYSMAN_USB_HOST_DISCONNECTED) {
+ USB_LOG(USB_LOG_VERBOSE, "USB host is not connected");
+ elm_exit();
+ }
+ __USB_FUNC_EXIT__ ;
+}
+
+int usp_vconf_key_notify(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__;
+ if(!ad) return -1;
+ int ret = -1;
+
+ /* Event for USB cable */
+ ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_STATUS, usp_usbclient_chgdet_cb, NULL);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_STATUS)");
+ return -1;
+ }
+
+ /* Event for USB host */
+ ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_USBHOST_STATUS, usp_usbhost_chgdet_cb, NULL);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: vconf_notify_key_changed(VCONFKEY_SYSMAN_USBHOST_STATUS)");
+ return -1;
+ }
+
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+int usp_vconf_key_ignore()
+{
+ __USB_FUNC_ENTER__;
+ int ret = -1;
+
+ /* Event for USB cable */
+ ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS, usp_usbclient_chgdet_cb);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS)");
+ return -1;
+ }
+
+ /* Event for USB host */
+ ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_USBHOST_STATUS, usp_usbhost_chgdet_cb);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: vconf_ignore_key_changed(VCONFKEY_SYSMAN_USBHOST_STATUS)");
+ return -1;
+ }
+
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static int __app_create(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!data) return -1;
+ struct appdata *ad = data;
+ int ret = -1;
+ int usbclient_status = -1;
+ int usbhost_status = -1;
+
+ ret = usp_vconf_key_notify(ad);
+ if (ret != 0) USB_LOG(USB_LOG_VERBOSE, "FAIL: usp_vconf_key_notify(ad)");
+
+ /* init internationalization */
+ ret = appcore_set_i18n(PACKAGE, LOCALEDIR);
+ if (ret != 0)
+ {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: appcore_set_i18n(PACKAGE, LOCALEDIR)\n");
+ return -1;
+ }
+
+ __USB_FUNC_EXIT__ ;
+
+ return 0;
+}
+
+static void unload_popup(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!data) return ;
+ struct appdata *ad = data;
+
+ if (ad->lbtn) {
+ evas_object_del(ad->lbtn);
+ ad->lbtn = NULL;
+ }
+ if (ad->rbtn) {
+ evas_object_del(ad->rbtn);
+ ad->rbtn = NULL;
+ }
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+ if (ad->win) {
+ evas_object_del(ad->win);
+ ad->win = NULL;
+ }
+
+ __USB_FUNC_EXIT__ ;
+}
+
+static int __app_terminate(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!data) return -1;
+ struct appdata *ad = data;
+ int ret = -1;
+
+ USB_LOG(USB_LOG_VERBOSE, "[SYSPOPUP] %s, %d\n", __func__, __LINE__);
+
+ ret = usp_vconf_key_ignore();
+ if (ret != 0) USB_LOG(USB_LOG_VERBOSE, "FAIL: usp_vconf_key_ignore()");
+
+ unload_popup(ad);
+
+ if (ad->b)
+ {
+ ret = bundle_free(ad->b);
+ if (ret != 0 )
+ {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: bundle_free(ad->b)\n");
+ }
+ ad->b = NULL;
+ }
+
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static int __app_pause(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static int __app_resume(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+int request_to_usb_server(int request, char *pkgName, char *answer)
+{
+ __USB_FUNC_ENTER__ ;
+ int sock_remote;
+ char str[SOCK_STR_LEN];
+ int t, ret;
+ ret = ipc_socket_client_init(&sock_remote);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: ipc_socket_client_init(&sock_remote)");
+ return -1;
+ }
+ if(LAUNCH_APP_FOR_ACC == request || LAUNCH_APP_FOR_HOST == request) {
+ snprintf(str, SOCK_STR_LEN, "%d|%s", request, pkgName);
+ } else {
+ snprintf(str, SOCK_STR_LEN, "%d|", request);
+ }
+ USB_LOG(USB_LOG_VERBOSE, "request: %s", str);
+ if (send (sock_remote, str, strlen(str)+1, 0) == -1) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: send (sock_remote, str, strlen(str), 0)");
+ ipc_socket_client_close(&sock_remote);
+ 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(USB_LOG_VERBOSE, "[CLIENT] Received value: %s", answer);
+ } else {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: recv(sock_remote, str, SOCK_STR_LEN, 0)");
+ return -1;
+ }
+ ipc_socket_client_close(&sock_remote);
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static void load_connection_failed_popup_ok_response_cb(void *data,
+ Evas_Object * obj, void *event_info)
+{
+ __USB_FUNC_ENTER__;
+
+ if(!data) return ;
+ struct appdata *ad = data;
+ unload_popup(ad);
+
+ evas_object_smart_callback_del(ad->lbtn, "clicked", load_connection_failed_popup_ok_response_cb);
+ char buf[SOCK_STR_LEN];
+ int ret = request_to_usb_server(ERROR_POPUP_OK_BTN, NULL, buf);
+ if (ret < 0) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: request_to_usb_server(ERROR_POPUP_OK_BTN, NULL, buf)\n");
+ return;
+ }
+
+ elm_exit();
+
+ __USB_FUNC_EXIT__ ;
+
+}
+
+static void request_perm_popup_yes_response_cb(void *data,
+ Evas_Object * obj, void *event_info)
+{
+ __USB_FUNC_ENTER__;
+ if (!data) return ;
+ struct appdata *ad = (struct appdata *)data;
+ int ret = -1;
+ unload_popup(ad);
+ evas_object_smart_callback_del(ad->lbtn, "clicked", request_perm_popup_yes_response_cb);
+ evas_object_smart_callback_del(ad->rbtn, "clicked", request_perm_popup_no_response_cb);
+
+ char buf[SOCK_STR_LEN];
+ if (REQ_ACC_PERM_POPUP == ad->type)
+ ret = request_to_usb_server(REQ_ACC_PERM_NOTI_YES_BTN, NULL, buf);
+ else if (REQ_HOST_PERM_POPUP == ad->type)
+ ret = request_to_usb_server(REQ_HOST_PERM_NOTI_YES_BTN, NULL, buf);
+ else
+ ret = request_to_usb_server(-1, NULL, buf);
+
+ if (ret < 0) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: request_to_usb_server(NOTICE_YES_BTN, NULL, buf)\n");
+ return;
+ }
+ elm_exit();
+ __USB_FUNC_EXIT__ ;
+}
+
+static void request_perm_popup_no_response_cb(void *data,
+ Evas_Object * obj, void *event_info)
+{
+ __USB_FUNC_ENTER__;
+ if (!data) return ;
+ struct appdata *ad = (struct appdata *)data;
+ int ret = -1;
+ unload_popup(ad);
+ evas_object_smart_callback_del(ad->lbtn, "clicked", request_perm_popup_yes_response_cb);
+ evas_object_smart_callback_del(ad->rbtn, "clicked", request_perm_popup_no_response_cb);
+
+ char buf[SOCK_STR_LEN];
+ if (REQ_ACC_PERM_POPUP == ad->type)
+ ret = request_to_usb_server(REQ_ACC_PERM_NOTI_NO_BTN, NULL, buf);
+ else if (REQ_HOST_PERM_POPUP == ad->type)
+ ret = request_to_usb_server(REQ_HOST_PERM_NOTI_NO_BTN, NULL, buf);
+ else
+ ret = request_to_usb_server(-1, NULL, buf);
+
+ if (ret < 0) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: request_to_usb_server(NOTICE_NO_BTN, NULL, buf)\n");
+ return;
+ }
+ elm_exit();
+ __USB_FUNC_EXIT__ ;
+}
+
+static void load_connection_failed_popup(void *data)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!data) return ;
+ struct appdata *ad = data;
+ int ret = -1;
+ ad->lbtn = NULL;
+
+ /* create window */
+ ad->win = __create_win(PACKAGE);
+ if (ad->win == NULL)
+ return ;
+
+ ret = syspopup_create(ad->b, &handler, ad->win, ad);
+ if(ret == 0)
+ {
+ ad->content = dgettext(USB_SYSPOPUP_MESSAGE_DOMAIN, "IDS_USB_POP_USB_CONNECTION_FAILED");
+ USB_LOG(USB_LOG_VERBOSE, "ad->content is (%s)\n", ad->content);
+
+ evas_object_show(ad->win);
+ ad->popup = elm_popup_add(ad->win);
+ evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(ad->popup, ad->content);
+
+ /* a button */
+ ad->lbtn = elm_button_add(ad->popup);
+ elm_object_text_set(ad->lbtn, dgettext("sys_string","IDS_COM_SK_OK"));
+ elm_object_part_content_set(ad->popup, "button1", ad->lbtn);
+ evas_object_smart_callback_add(ad->lbtn, "clicked",
+ load_connection_failed_popup_ok_response_cb, ad);
+
+ evas_object_show(ad->popup);
+ }
+ else
+ {
+ USB_LOG(USB_LOG_VERBOSE, "syspopup_create() returns an integer which is not 0\n");
+ }
+
+ __USB_FUNC_EXIT__ ;
+}
+
+static int get_accessory_matched(struct appdata* ad)
+{
+ __USB_FUNC_ENTER__ ;
+ int numOfApps = 0;
+ matchedApps[0]=strdup("acc_test");
+ numOfApps++;
+
+
+ __USB_FUNC_EXIT__ ;
+ return numOfApps;
+}
+
+static char *_gl_text_get(void *data, Evas_Object *obj, const char *part)
+{
+ __USB_FUNC_ENTER__ ;
+ int index = (int)data;
+ USB_LOG(USB_LOG_VERBOSE, "App name: %s\n", matchedApps[index]);
+ __USB_FUNC_EXIT__ ;
+ return strdup(matchedApps[index]);
+}
+
+static void select_app_popup_cancel_response_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!data) return ;
+ struct appdata *ad = (struct appdata *)data;
+ unload_popup(ad);
+ elm_exit();
+ __USB_FUNC_EXIT__ ;
+}
+
+static int send_sel_pkg_to_usb_server(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ int ret = -1;
+ char answer[SOCK_STR_LEN];
+ if (ad->type == SELECT_PKG_FOR_ACC_POPUP)
+ ret = request_to_usb_server(LAUNCH_APP_FOR_ACC, ad->selPkg, answer);
+ else if (ad->type == SELECT_PKG_FOR_HOST_POPUP)
+ ret = request_to_usb_server(LAUNCH_APP_FOR_HOST, ad->selPkg, answer);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: request_to_usb_server(LAUNCH_APP, ad->selPkg, answer)");
+ return -1;
+ }
+ USB_LOG(USB_LOG_VERBOSE, "Launching app result is %s\n", answer);
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static void select_app_popup_gl_select_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!event_info) return;
+ if (!data) return;
+ struct appdata *ad = (struct appdata *)data;
+ int index = 0;
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ if (item) {
+ index = (int)elm_object_item_data_get(item);
+ USB_LOG(USB_LOG_VERBOSE, "Selected Item: %d: %s\n", index, matchedApps[index]);
+ snprintf(ad->selPkg, PKG_NAME_LEN, "%s", matchedApps[index]);
+ }
+ unload_popup(ad);
+ int ret = send_sel_pkg_to_usb_server(ad);
+ if ( 0!= ret ) USB_LOG(USB_LOG_VERBOSE,"FAIL: send_sel_pkg_to_usb_server(ad)");
+ elm_exit();
+
+ __USB_FUNC_EXIT__ ;
+}
+
+static void load_popup_to_select_app(struct appdata *ad, int numOfApps)
+{
+ __USB_FUNC_ENTER__ ;
+ if(!ad) return ;
+ int ret = -1;
+ ad->lbtn = NULL;
+ int index;
+ Evas_Object *win;
+
+ /* create window */
+ win = __create_win(PACKAGE);
+ if (win == NULL)
+ return ;
+ ad->win = win;
+
+ ret = syspopup_create(ad->b, &handler, ad->win, ad);
+ USB_LOG(USB_LOG_VERBOSE, "ret: %d\n", ret);
+ if(ret == 0) {
+ evas_object_show(ad->win);
+ ad->popup = elm_popup_add(ad->win);
+ elm_object_style_set(ad->popup,"menustyle");
+ elm_object_part_text_set(ad->popup, "title,text", "Select app to launch");
+ evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ ad->lbtn = elm_button_add(ad->popup);
+ elm_object_text_set(ad->lbtn, "Cancel");
+ elm_object_part_content_set(ad->popup, "button1", ad->lbtn);
+ evas_object_smart_callback_add(ad->lbtn, "clicked", select_app_popup_cancel_response_cb, ad);
+
+ itc.item_style = "1text";
+ itc.func.text_get = _gl_text_get;
+ itc.func.content_get = NULL;
+ itc.func.state_get = NULL;
+ itc.func.del = NULL;
+ genlist = elm_genlist_add(ad->popup);
+ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ for (index = 0; index < numOfApps; index++) {
+ USB_LOG(USB_LOG_VERBOSE, "%d\n", numOfApps);
+ item = elm_genlist_item_append(genlist, &itc, (void *) index, NULL,
+ ELM_GENLIST_ITEM_NONE, select_app_popup_gl_select_cb, ad);
+ if (NULL == item) USB_LOG(USB_LOG_VERBOSE, "NULL ==item\n");
+ }
+ elm_object_content_set(ad->popup, genlist);
+ evas_object_show(ad->popup);
+ }
+ __USB_FUNC_EXIT__ ;
+}
+
+static void load_popup_to_confirm_uri(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ __USB_FUNC_EXIT__ ;
+}
+
+static int get_accessory_info(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!ad) return -1;
+ int ret, i;
+ char device[ACC_INFO_NUM][ACC_ELEMENT_LEN];
+ char key[SYSPOPUP_PARAM_LEN];
+ for (i = 0; i < ACC_INFO_NUM; i++) {
+ snprintf(key, SYSPOPUP_PARAM_LEN, "%d", 1 + i);
+ const char* type = bundle_get_val(ad->b, (const char *)key);
+ if (!type) {
+ USB_LOG(USB_LOG_VERBOSE, "ERROR: bundle_get_val(b)\n");
+ return -1;
+ } else {
+ USB_LOG(USB_LOG_VERBOSE, "%d: %s\n", i, type);
+ snprintf(device[i], ACC_ELEMENT_LEN, "%s", type);
+ }
+ }
+
+ USB_LOG(USB_LOG_VERBOSE, "Get USB Acc info\n");
+ snprintf(ad->usbAcc->manufacturer, ACC_ELEMENT_LEN, "%s", device[ACC_MANUFACTURER]);
+ snprintf(ad->usbAcc->model, ACC_ELEMENT_LEN, "%s", device[ACC_MODEL]);
+ snprintf(ad->usbAcc->description, ACC_ELEMENT_LEN, "%s", device[ACC_DESCRIPTION]);
+ snprintf(ad->usbAcc->version, ACC_ELEMENT_LEN, "%s", device[ACC_VERSION]);
+ snprintf(ad->usbAcc->uri, ACC_ELEMENT_LEN, "%s", device[ACC_URI]);
+ snprintf(ad->usbAcc->serial, ACC_ELEMENT_LEN, "%s", device[ACC_SERIAL]);
+
+ USB_LOG(USB_LOG_VERBOSE, "Print USB acc info\n");
+ USB_LOG(USB_LOG_VERBOSE, "** USB ACCESSORY INFO **");
+ USB_LOG(USB_LOG_VERBOSE, "* Manufacturer: %s *", ad->usbAcc->manufacturer);
+ USB_LOG(USB_LOG_VERBOSE, "* Model : %s *", ad->usbAcc->model);
+ USB_LOG(USB_LOG_VERBOSE, "* Description : %s *", ad->usbAcc->description);
+ USB_LOG(USB_LOG_VERBOSE, "* Version : %s *", ad->usbAcc->version);
+ USB_LOG(USB_LOG_VERBOSE, "* URI : %s *", ad->usbAcc->uri);
+ USB_LOG(USB_LOG_VERBOSE, "* SERIAL : %s *", ad->usbAcc->serial);
+ USB_LOG(USB_LOG_VERBOSE, "************************");
+ __USB_FUNC_EXIT__ ;
+ return 0;
+}
+
+static void load_select_pkg_for_acc_popup(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!ad) return;
+ int ret = -1;
+ UsbAccessory usbAcc;
+ memset(&usbAcc, 0x0, sizeof(UsbAccessory));
+ ad->usbAcc = &usbAcc;
+ ret = get_accessory_info(ad);
+ if (0 != ret) {
+ USB_LOG(USB_LOG_VERBOSE, "FAIL: get_accessory_info(ad)");
+ elm_exit();
+ }
+
+ int numOfApps = get_accessory_matched(ad);
+ if (numOfApps > 0) {
+ USB_LOG(USB_LOG_VERBOSE, "number of apps matched: %d\n", numOfApps);
+ load_popup_to_select_app(ad, numOfApps);
+ } else {
+ USB_LOG(USB_LOG_VERBOSE, "number of apps matched is 0\n");
+ load_popup_to_confirm_uri(ad);
+ }
+ __USB_FUNC_EXIT__ ;
+}
+
+static int get_host_matched(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!ad) return 0;
+ int numOfApps = 0;
+ matchedApps[0]=strdup("host_test");
+ numOfApps++;
+ __USB_FUNC_EXIT__ ;
+ return numOfApps;
+}
+
+static void load_select_pkg_for_host_popup(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+ if (!ad) return;
+ int ret = -1;
+ int numOfApps = get_host_matched(ad);
+ if (numOfApps > 0) {
+ USB_LOG(USB_LOG_VERBOSE, "number of apps matched: %d\n", numOfApps);
+ load_popup_to_select_app(ad, numOfApps);
+ } else {
+ USB_LOG(USB_LOG_VERBOSE, "number of apps matched is 0\n");
+ load_popup_to_confirm_uri(ad);
+ }
+ __USB_FUNC_EXIT__ ;
+}
+
+void load_request_perm_popup(struct appdata *ad)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!ad) return ;
+ Evas_Object *win;
+ int ret = -1;
+ ad->lbtn = NULL;
+ ad->rbtn = NULL;
+
+ /* create window */
+ win = __create_win(PACKAGE);
+ if (win == NULL)
+ return ;
+ ad->win = win;
+
+ ret = syspopup_create(ad->b, &handler, ad->win, ad);
+ if(ret == 0)
+ {
+ if (ad->type == REQ_ACC_PERM_POPUP)
+ ad->content = dgettext(USB_SYSPOPUP_MESSAGE_DOMAIN, "IDS_COM_POP_ALLOW_APPLICATION_P1SS_TO_ACCESS_USB_ACCESSORY_Q_ABB");
+ else if (ad->type == REQ_HOST_PERM_POPUP)
+ ad->content = dgettext(USB_SYSPOPUP_MESSAGE_DOMAIN, "Allow application to access USB host?");
+ else {
+ ad->content = dgettext(USB_SYSPOPUP_MESSAGE_DOMAIN, "This app cannot access to the usb device");
+ }
+ USB_LOG(USB_LOG_VERBOSE, "ad->content is (%s)\n", ad->content);
+
+ evas_object_show(ad->win);
+ ad->popup = elm_popup_add(ad->win);
+ evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(ad->popup, ad->content);
+
+ if (ad->type == REQ_ACC_PERM_POPUP || ad->type == REQ_HOST_PERM_POPUP) {
+ /* Left button */
+ ad->lbtn = elm_button_add(ad->popup);
+ elm_object_text_set(ad->lbtn, dgettext("sys_string","IDS_COM_SK_YES"));
+ elm_object_part_content_set(ad->popup, "button1", ad->lbtn);
+ evas_object_smart_callback_add(ad->lbtn, "clicked", request_perm_popup_yes_response_cb, ad);
+
+ /* Right button */
+ ad->rbtn = elm_button_add(ad->popup);
+ elm_object_text_set(ad->rbtn, dgettext("sys_string","IDS_COM_SK_NO"));
+ elm_object_part_content_set(ad->popup, "button2", ad->rbtn);
+ evas_object_smart_callback_add(ad->rbtn, "clicked", request_perm_popup_no_response_cb, ad);
+ } else {
+ /* OK button */
+ ad->lbtn = elm_button_add(ad->popup);
+ elm_object_text_set(ad->lbtn, dgettext("sys_string","IDS_COM_SK_OK"));
+ elm_object_part_content_set(ad->popup, "button1", ad->lbtn);
+ evas_object_smart_callback_add(ad->lbtn, "clicked", request_perm_popup_no_response_cb, ad);
+ }
+
+ evas_object_show(ad->popup);
+ }
+ else
+ {
+ USB_LOG(USB_LOG_VERBOSE, "syspopup_create() returns an integer which is not 0\n");
+ }
+
+ __USB_FUNC_EXIT__ ;
+}
+
+static int __app_reset(bundle *b, void *data)
+{
+ __USB_FUNC_ENTER__ ;
+
+ if(!data) return -1;
+ struct appdata *ad = data;
+ char key[SYSPOPUP_PARAM_LEN];
+ int ret = 0;
+
+ ad->b = bundle_dup(b);
+
+ /* When syspopup is already loaded, remove the popup and load new popup */
+ if (syspopup_has_popup(b)) {
+ USB_LOG(USB_LOG_VERBOSE, "syspopup_has_popup(b) returns 1\n");
+ unload_popup(ad);
+ /* Resetting all proporties of syspopup */
+ syspopup_reset(b);
+ }
+
+ snprintf(key, SYSPOPUP_PARAM_LEN, "%d", SYSPOPUP_TYPE);
+ const char* type = bundle_get_val(b, (const char *)key);
+ if (!type) {
+ USB_LOG(USB_LOG_VERBOSE, "ERROR: Non existing type of popup\n");
+ elm_exit();
+ } else {
+ ad->type = atoi(type);
+ USB_LOG(USB_LOG_VERBOSE, "ad->type is (%d)\n", ad->type);
+ }
+
+ /* In case that USB cable/device is disconnected before launching popup,
+ * the connection status are checked according to the popup type */
+ switch(ad->type) {
+ case ERROR_POPUP:
+ case SELECT_PKG_FOR_ACC_POPUP:
+ case REQ_ACC_PERM_POPUP:
+ ad->isClientOrHost = USB_DEVICE_CLIENT;
+ usp_usbclient_chgdet_cb(NULL, NULL);
+ break;
+ case SELECT_PKG_FOR_HOST_POPUP:
+ case REQ_HOST_PERM_POPUP:
+ ad->isClientOrHost = USB_DEVICE_HOST;
+ usp_usbhost_chgdet_cb(NULL, NULL);
+ break;
+ default:
+ USB_LOG(USB_LOG_VERBOSE, "ERROR: The popup type(%d) does not exist\n", ad->type);
+ ad->isClientOrHost = USB_DEVICE_UNKNOWN;
+ elm_exit();
+ break;
+ }
+
+ switch(ad->type) {
+ case ERROR_POPUP:
+ USB_LOG(USB_LOG_VERBOSE, "Connection failed popup is loaded\n");
+ load_connection_failed_popup(ad);
+ break;
+ case SELECT_PKG_FOR_ACC_POPUP:
+ USB_LOG(USB_LOG_VERBOSE, "Select pkg for acc popup is loaded\n");
+ load_select_pkg_for_acc_popup(ad);
+ break;
+ case SELECT_PKG_FOR_HOST_POPUP:
+ USB_LOG(USB_LOG_VERBOSE, "Select pkg for host popup is loaded\n");
+ load_select_pkg_for_host_popup(ad);
+ break;
+ case REQ_ACC_PERM_POPUP:
+ case REQ_HOST_PERM_POPUP:
+ USB_LOG(USB_LOG_VERBOSE, "Request Permission popup is loaded\n");
+ load_request_perm_popup(ad);
+ break;
+ default:
+ USB_LOG(USB_LOG_VERBOSE, "ERROR: The popup type(%d) does not exist\n", ad->type);
+ break;
+ }
+
+ __USB_FUNC_EXIT__ ;
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ __USB_FUNC_ENTER__ ;
+
+ struct appdata ad;
+ struct appcore_ops ops = {
+ .create = __app_create,
+ .terminate = __app_terminate,
+ .pause = __app_pause,
+ .resume = __app_resume,
+ .reset = __app_reset,
+ };
+
+ memset(&ad, 0x0, sizeof(struct appdata));
+ ops.data = &ad;
+
+ __USB_FUNC_EXIT__ ;
+ return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
+
--- /dev/null
+/*
+ * usb-syspopup
+ * 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 __SYSPOPUP_APP_H__
+#define __SYSPOPUP_APP_H__
+
+#include <vconf.h>
+#include <syspopup.h>
+#include <ail.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 SOCK_STR_LEN 1542
+#define ACC_ELEMENT_LEN 256
+#define PKG_NAME_LEN 64
+#define ACC_INFO_NUM 6
+#define MAX_NUM_OF_MATCHED_APPS 256
+#define VCONFKEY_SYSMAN_USBHOST_STATUS "memory/sysman/usbhost_status"
+
+#if !defined(PACKAGE)
+#define PACKAGE "usb_syspopup"
+#endif
+
+#include <dlog.h>
+#define USB_LOG_VERBOSE LOG_VERBOSE
+#define USB_LOG_DEBUG LOG_DEBUG
+#define USB_LOG_INFO LOG_INFO
+#define USB_LOG_WARN LOG_WARN
+#define USB_LOG_ERROR LOG_ERROR
+#define USB_LOG_FATAL LOG_FATAL
+
+#define USB_TAG "USB_SYSPOPUP"
+#define USB_LOG(log_level, format, args...)\
+ LOG(log_level, USB_TAG, "[%s][Ln: %d] " format,__FILE__, __LINE__, ##args)
+#define __USB_FUNC_ENTER__\
+ USB_LOG(USB_LOG_DEBUG, "Entering: %s()\n", __func__)
+#define __USB_FUNC_EXIT__\
+ USB_LOG(USB_LOG_DEBUG, "Exit: %s()\n", __func__)
+
+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 {
+ USB_DEVICE_CLIENT = 0,
+ USB_DEVICE_HOST,
+ USB_DEVICE_BOTH,
+ USB_DEVICE_UNKNOWN
+} IS_CLIENT_OR_HOST;
+
+typedef enum {
+ ACC_MANUFACTURER = 0,
+ ACC_MODEL,
+ ACC_DESCRIPTION,
+ ACC_VERSION,
+ ACC_URI,
+ ACC_SERIAL
+} ACC_ELEMENT;
+
+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 struct _usbAccessory {
+ char manufacturer[ACC_ELEMENT_LEN];
+ char model[ACC_ELEMENT_LEN];
+ char description[ACC_ELEMENT_LEN];
+ char version[ACC_ELEMENT_LEN];
+ char uri[ACC_ELEMENT_LEN];
+ char serial[ACC_ELEMENT_LEN];
+} UsbAccessory;
+
+struct appdata {
+ Evas_Object *win;
+ Evas_Object *popup;
+ Evas_Object *lbtn;
+ Evas_Object *rbtn;
+ bundle *b;
+ int noti_fd;
+ int type;
+ char *content;
+ int isClientOrHost;
+
+ UsbAccessory *usbAcc;
+ char selPkg[PKG_NAME_LEN];
+
+ /* add more variables here */
+};
+
+static void load_connection_failed_popup_ok_response_cb(void *data, Evas_Object * obj, void *event_info);
+static void request_perm_popup_yes_response_cb(void *data, Evas_Object * obj, void *event_info);
+static void request_perm_popup_no_response_cb(void *data, Evas_Object * obj, void *event_info);
+
+#endif /* __SYSPOPUP_APP_H__ */
+