From eee53bc24b0c6b2785eeaa714284e6a57ecc850a Mon Sep 17 00:00:00 2001 From: Wenjie Zhou Date: Thu, 9 Apr 2020 14:43:00 -0700 Subject: [PATCH] Enable incidentd access to ro.boot.bootreason incident report contains similar data as in a bugreport, but in proto format. This is a cherry-pick from aosp/1283764 with conflicts resolved. Test: adb shell incident -p LOCAL 1000 Bug: 152173578 Change-Id: Iee53a3b8a6c95629a1d5c15b4d17f3d680b14178 Merged-In: Iee53a3b8a6c95629a1d5c15b4d17f3d680b14178 --- private/incidentd.te | 8 ++++++++ public/bootstat.te | 1 + 2 files changed, 9 insertions(+) diff --git a/private/incidentd.te b/private/incidentd.te index c379fa237..405684ae6 100644 --- a/private/incidentd.te +++ b/private/incidentd.te @@ -168,6 +168,14 @@ userdebug_or_eng(` get_prop(incidentd, serialno_prop) ') +# Read ro.boot.bootreason, persist.sys.boot.bootreason +# This is used to track reports from lab testing devices +userdebug_or_eng(` + get_prop(incidentd, bootloader_boot_reason_prop); + get_prop(incidentd, system_boot_reason_prop); + get_prop(incidentd, last_boot_reason_prop); +') + ### ### neverallow rules ### diff --git a/public/bootstat.te b/public/bootstat.te index 6143a7d2b..e91f2a5e5 100644 --- a/public/bootstat.te +++ b/public/bootstat.te @@ -39,6 +39,7 @@ neverallow { -bootanim -bootstat -dumpstate + userdebug_or_eng(`-incidentd') -init -recovery -shell