crash: launch crash popup when crash is occurred 07/78407/1 accepted/tizen/common/20160706.142156 accepted/tizen/ivi/20160706.082506 accepted/tizen/mobile/20160706.082325 accepted/tizen/tv/20160706.082335 accepted/tizen/wearable/20160706.082347 submit/tizen/20160706.021530
authortaeyoung <ty317.kim@samsung.com>
Tue, 5 Jul 2016 10:38:41 +0000 (19:38 +0900)
committertaeyoung <ty317.kim@samsung.com>
Tue, 5 Jul 2016 10:38:41 +0000 (19:38 +0900)
- Crash popup is launched by the dbus method.
  The popup requires the full path of executable
  to show the appid to the user

Change-Id: Ibeadfe792faabc61706738f24806f9d7386e6fb3
Signed-off-by: taeyoung <ty317.kim@samsung.com>
packaging/crash-worker.spec
src/crash-manager/crash-manager.sh.in

index e7a05a8..f4c0c46 100644 (file)
@@ -1,4 +1,14 @@
 %define sys_assert on
+%define crash_popup off
+
+%if "%{?profile}" == "mobile"
+%define crash_popup on
+%endif
+
+%if "%{?profile}" == "wearable"
+%define crash_popup on
+%endif
+
 
 Name:      crash-worker
 Summary:    Crash-manager
@@ -23,6 +33,9 @@ Requires(post): tar
 Requires(post): gzip
 Requires: libebl
 Requires: libunwind
+%if %{?crash_popup} == on
+Requires: /usr/bin/dbus-send
+%endif
 
 %description
 crash-manager
@@ -62,6 +75,7 @@ export CFLAGS+=" -Werror"
           -DCRASH_TEMP=%{crash_temp} \
           -DCRASH_PIPE_PATH=%{_libexecdir}/crash-pipe \
           -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \
+          -DCRASH_POPUP=%{crash_popup} \
           -DSYS_ASSERT=%{sys_assert}
 
 make %{?jobs:-j%jobs}
index e36c2b9..540f446 100644 (file)
@@ -44,6 +44,32 @@ else
   @CRASH_PIPE_PATH@ --report "$@" > "$info_path"
   @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
 fi
+
+if [ "@CRASH_POPUP@" = "on" ]
+then
+#Find the full path of executable. The path is used to find appid in the crash-popup
+       exepath=" "
+       found=0
+       while read line
+       do
+               if [ $found -eq 1 ]
+               then
+                       exepath=$(echo $line | sed "s/0: //")
+                       break
+               fi
+
+               if [ "$line" = "Cmdline:" ]
+               then
+                       found=1
+               fi
+
+       done < $info_path
+
+#Call dbus method to launch the crash-popup
+       /usr/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=120000 --dest=org.tizen.system.popup /Org/Tizen/System/Popup/Crash org.tizen.system.popup.Crash.PopupLaunch dict:string:string:"_SYSPOPUP_CONTENT_","crash","_PROCESS_NAME_","${cmd}","_EXEPATH_","${exepath}"
+
+fi
+
 dump_systemstate -d -k -f "$log_path" || true
 
 tar czf "${temp_dir}/report.tar.gz" -C "$temp_dir" "$name"