--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)\r
+PROJECT(privacy-popup)\r
+\r
+\r
+MESSAGE("build privacy-popup")\r
+\r
+SET(CMAKE_VERBOSE_MAKEFILE OFF)\r
+\r
+ADD_SUBDIRECTORY(privacy-popup)\r
--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+
+ 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
+Name: privacy-popup
+Summary: privacy-popup
+Version: 0.0.1
+Release: 0
+License: SAMSUNG
+Source0: %{name}-%{version}.tar.gz
+Source1: tizenprv00.privacy-popup.manifest
+
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+BuildRequires: cmake
+BuildRequires: edje-tools
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(privacy-manager-client)
+
+%description
+The Privacy popup provides UI to set privacy information of application.
+
+%prep
+%setup -q
+
+%build
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%ifarch %{ix86}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=x86 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DDESCRIPTION=%{summary}
+%else
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=arm -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DDESCRIPTION=%{summary}
+%endif
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%postun
+/sbin/ldconfig
+
+%files
+%manifest packaging/tizenprv00.privacy-popup.manifest
+%defattr(-,root,root,-)
+/usr/bin/tizenprv00.privacy-popup
+/usr/share/packages/privacy-popup.xml
+#/usr/share/packages/tizenprv00.privacy-popup.xml
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="privacy-popup" version="0.1.0" install-location="internal-only">
+ <label>privacy-popup</label>
+ <author email="jc815.lee@samsung.com" href="www.samsung.com">Jaechul Lee</author>
+ <description>privacy popup</description>
+ <ui-application appid="tizenprv00.privacy-popup" exec="/usr/bin/tizenprv00.privacy-popup" nodisplay="true" multiple="false" type="capp" taskmanage="false">
+ <label>privacy-popup</label>
+ </ui-application>
+</manifest>
--- /dev/null
+<manifest>
+ <define>
+ <domain name="tizenprv00.privacy-popup" />
+ </define>
+ <assign>
+ <filesystem path="/usr/bin/tizenprv00.privacy-popup" label="tizenprv00.privacy-popup" exec_label="tizenprv00.privacy-popup" />
+ </assign>
+</manifest>
--- /dev/null
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=/usr/include
+
+Name: @PC_NAME@
+Description: @PC_DESCRIPTION@
+Version: @VERSION@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: @PC_CFLAGS@
+Requires:
--- /dev/null
+INCLUDE(FindPkgConfig)
+pkg_check_modules(privacy-popup_pkgs
+ REQUIRED
+ #elementary
+ #evas
+ ecore-x
+ ui-gadget-1
+ dlog
+ capi-appfw-application
+ appcore-efl
+ privacy-manager-client
+)
+SET (this_target tizenprv00.privacy-popup)
+
+SET(SRCS
+ src/privacy-popup.c
+)
+
+#SET(INCLUDEDIR "\${prefix}/include")
+INCLUDE_DIRECTORIES(${privacy-popup_pkgs_INCLUDE_DIRS})
+#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)
+INCLUDE_DIRECTORIES(./inc)
+
+
+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")
+
+MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
+
+ADD_DEFINITIONS("-DSLP_DEBUG")
+
+#SET(CMAKE_CXX_CFLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+
+ADD_EXECUTABLE(${this_target} ${SRCS})
+
+#TARGET_LINK_LIBRARIES(${this_target} --as-needed -pie)
+
+ADD_DEPENDENCIES(${this_target} privacy-manager-client)
+TARGET_LINK_LIBRARIES(${this_target} ${privacy-popup_pkgs_LDFLAGS} ${privacy-popup_pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(${this_target} "-lpkgmgr-info")
+TARGET_LINK_LIBRARIES(${this_target} "-lprivacy-manager-client" "-L../client")
+
+
+TARGET_LINK_LIBRARIES(${this_target}
+ ${privacy-popup_LIBRARIES}
+)
+
+
+INSTALL(TARGETS
+ ${this_target}
+ DESTINATION
+ /usr/bin/
+)
+#INSTALL(FILES ${CMAKE_SOURCE_DIR}/packaging/${this_target}.xml DESTINATION /usr/share/packages)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/packaging/privacy-popup.xml DESTINATION /usr/share/packages)
--- /dev/null
+
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include "dlog.h"
+#include <Evas.h>
+#include <app.h>
+
+
+#include <pkgmgr-info.h>
+#include <aul.h>
+#include <bundle.h>
+#include <appcore-efl.h>
+#include <privacy_manager_client.h>
+
+#include <stdio.h>
+#include <ui-gadget.h>
+#include <ui-gadget-module.h>
+#include <ui-gadget-engine.h>
+
+
+#ifdef LOG_TAG
+ #undef LOG_TAG
+#endif
+
+#ifndef LOG_TAG
+ #define LOG_TAG "PRIVACY_POPUP"
+#endif
+
+#define PACKAGE "privacy-popup"
+
+typedef struct appdata_t {
+ ui_gadget_h ug;
+ Evas_Object *conform;
+ Evas_Object *main_layout;
+ Evas_Object *win;
+} appdata;
+
+const char *KEY_PACKAGE_ID = "pkg_id";
+const char *KEY_RESULT_EXIT = "exit";
+const char *KEY_RESULT_OK = "ok";
+const char *KEY_RESULT_CANCEL = "cancel";
--- /dev/null
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 "privacy-popup.h"
+
+static appdata ad;
+static service_h service;
+
+static char *package_id = NULL;
+static char *app_id = NULL;
+static bundle *bundle_data = NULL;
+int get_packageid_by_appid(const char* appid, char** packageid);
+Evas_Object* create_conform(Evas_Object *parent);
+
+static void destroy_privacy_popup()
+{
+ LOGD("exit");
+ //elm_shutdown();
+ elm_exit();
+}
+
+static void layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) {
+ LOGD("layout_cb");
+ Evas_Object *base, *win;
+ appdata *mydata;
+
+ if (!ug || !priv)
+ return;
+
+ mydata = priv;
+
+ base = ug_get_layout(ug);
+ if (!base){
+ LOGE("base layout from UG is null! %p", base);
+ return;
+ }
+
+ win = ug_get_window();
+
+ switch (mode) {
+ case UG_MODE_FULLVIEW:
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, base);
+ ug_disable_effect(ug);
+ evas_object_show(base);
+ break;
+ default:
+ break;
+ }
+}
+
+static void result_cb(ui_gadget_h ug, service_h service, void *priv) {
+ LOGD("result_cb");
+
+ if (!ug || !priv)
+ return;
+
+ if(!service){
+ LOGE("service is null. return without set_user_consented");
+ return;
+ }
+
+ char* exit_value = NULL;
+ service_get_extra_data(service, KEY_RESULT_EXIT, &exit_value);
+ if(!exit_value){
+ LOGD("no exit value from UG");
+ return;
+ }
+
+ LOGD("exit value : %s", exit_value);
+
+ if(strncmp(exit_value, KEY_RESULT_CANCEL, 2) == 0){
+ int result = privacy_manager_client_set_user_consented(package_id, true);
+ if(result != PRIV_MGR_ERROR_SUCCESS){
+ LOGD("set_user_censented failed : %d", result);
+ }
+ }
+}
+
+static void destroy_cb(ui_gadget_h ug, void *priv) {
+ LOGD("destroy_cb");
+
+ int result = privacy_manager_client_set_user_consented(package_id, true);
+
+ int res = aul_forward_app(app_id, bundle_data);
+ if(res < 0){
+ LOGE("aul_forward_app failed! result : %d", res);
+ destroy_privacy_popup();
+ }
+
+ if (!ug || !priv)
+ return;
+
+ //ug_destroy(ug);
+ //destroy_privacy_popup();
+}
+
+ui_gadget_h create_ug(appdata *data) {
+ LOGD("create_ug");
+
+ struct ug_cbs cbs = { 0, };
+ cbs.layout_cb = layout_cb;
+ cbs.result_cb = result_cb;
+ cbs.destroy_cb = destroy_cb;
+ cbs.priv = (void *) data;
+
+ service_create(&service);
+ LOGD("package_id : %s", package_id);
+ service_add_extra_data(service, "privacy_category", "service");
+ service_add_extra_data(service, KEY_PACKAGE_ID, package_id);
+
+ data->ug = ug_create(NULL, "setting-privacy-efl", UG_MODE_FULLVIEW, service, &cbs);
+ service_destroy(service);
+
+ if(!data->ug){
+ LOGE("ug_create failed!");
+ }
+
+ return data->ug;
+}
+
+static void on_done(void *data, Evas_Object *obj, void *event_info) {
+ (void) data;
+ (void) obj;
+ (void) event_info;
+ LOGD("on_done");
+ destroy_privacy_popup();
+}
+
+Evas_Object* create_win(char* name)
+{
+ int w,h;
+ Evas_Object *win = elm_win_add(NULL, PACKAGE, ELM_WIN_BASIC);
+ if(!win){
+ return NULL;
+ }
+
+ elm_win_title_set(win, PACKAGE);
+ evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+ evas_object_resize(win, w, h);
+ return win;
+}
+
+Evas_Object* create_conform(Evas_Object *parent)
+{
+ Evas_Object *conform = elm_conformant_add(parent);
+ if(!conform){
+ return NULL;
+ }
+ evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, conform);
+ evas_object_show(conform);
+
+ return conform;
+}
+
+Evas_Object* create_layout(Evas_Object *parent)
+{
+ Evas_Object *layout = elm_layout_add(parent);
+ elm_layout_theme_set(layout, "layout", "application", "default");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(parent, layout);
+
+ return layout;
+}
+
+EAPI_MAIN int elm_main() {
+ LOGD("elm_main");
+
+ Evas_Object *win = create_win(PACKAGE);
+ if(!win){
+ LOGE("failed to create window");
+ return 0;
+ }
+ elm_win_conformant_set(win, EINA_TRUE);
+
+ Evas_Object *conform = create_conform(win);
+ if(!conform){
+ LOGE("failed to create window");
+ return 0;
+ }
+
+ // main layout
+ Evas_Object *main_layout = create_layout(conform);
+ if(!conform){
+ LOGE("failed to create layout");
+ return 0;
+ }
+
+ UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE);
+ elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_HIDE);
+ evas_object_show(win);
+
+ ad.win = win;
+ ad.conform = conform;
+ ad.main_layout = main_layout;
+
+ return 0;
+}
+
+static int app_create(void *data)
+{
+ LOGD("app_create");
+ return elm_main();
+}
+
+static int app_terminate(void *data)
+{
+ LOGD("app_terminate");
+
+ free(package_id);
+ free(app_id);
+ bundle_free(bundle_data);
+ return 0;
+}
+
+static int app_pause(void *data)
+{
+ LOGD("app_pause");
+
+ destroy_privacy_popup();
+ // else(ex screen of or lose top most)
+
+ return 0;
+}
+
+static int app_resume(void *data)
+{
+ LOGD("app_resume");
+ return 0;
+}
+
+static int app_reset(bundle *b, void *data)
+{
+ LOGD("app_reset");
+ evas_object_show(ad.win);
+
+ //AUL pass appid
+ const char *appid = bundle_get_val(b, AUL_K_PRIVACY_APPID);
+
+ if(!appid){
+ LOGE("appid is null! ");
+ destroy_privacy_popup();
+ return 0;
+ }
+
+ app_id = strndup(appid, strlen(appid));
+ LOGD("app id %s", appid);
+
+ int result = get_packageid_by_appid(appid, &package_id);
+
+ if(result != 0 || !package_id){
+ LOGE("Failed to get package id! exit");
+ destroy_privacy_popup();
+ }
+
+ LOGD("package id %s", package_id);
+ bundle_data = bundle_dup(b);
+
+
+ if(!create_ug(&ad)){
+ destroy_privacy_popup();
+ }
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ elm_init(argc, argv);
+
+ struct appcore_ops ops = {
+ .create = app_create,
+ .terminate = app_terminate,
+ .pause = app_pause,
+ .resume = app_resume,
+ .reset = app_reset,
+ };
+ return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
+
+int get_packageid_by_appid(const char* appid, char** packageid)
+{
+ int result = 0;
+ char* pack_id = NULL;
+ pkgmgrinfo_appinfo_h app_info_handle = NULL;
+
+ result = pkgmgrinfo_appinfo_get_appinfo(appid, &app_info_handle);
+ if(result != 0){
+ LOGE("pkgmgrinfo_appinfo_get_appinfo() failed. result=[%d], appId=[%s]",result, appid);
+ return -1;
+ }
+
+ result = pkgmgrinfo_appinfo_get_pkgname(app_info_handle, &pack_id);
+ LOGD("pkgmgrinfo get_pkgname :%s", pack_id);
+
+ if(pack_id){
+ *packageid = (char*)malloc(sizeof(char)*strlen(pack_id));
+ if(*packageid == NULL){
+ LOGE("memory allocation failed to packageid!");
+ return -1;
+ }
+ strncpy(*packageid, pack_id, strlen(pack_id));
+ }
+ else{
+ LOGD("failed to get package id");
+ return -1;
+ }
+
+ if(app_info_handle)
+ {
+ pkgmgrinfo_appinfo_destroy_appinfo(app_info_handle);
+ }
+
+ return 0;
+}
+