diff options
author | Alex Hong <rurumihong@google.com> | 2020-07-09 17:00:43 +0800 |
---|---|---|
committer | Alex Hong <rurumihong@google.com> | 2020-07-09 17:00:43 +0800 |
commit | c0bed9c86e8b580f6f0ddaa72bdf287561e75e77 (patch) | |
tree | 3220b09861777d1b76ea2f963aa5fe871282fc2d /dumpstate | |
parent | d00d7bbf51adf5912edfcd66cef3ab9e1c08f353 (diff) | |
download | redfin-c0bed9c86e8b580f6f0ddaa72bdf287561e75e77.tar.gz |
Dump the debugfs information only in userdebug build
W/sh (10769): type=1400 audit(0.0:416): avc: denied { read } for name="/" dev="dm-5" ino=2 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
W/sh (10771): type=1400 audit(0.0:417): avc: denied { read } for name="/" dev="dm-5" ino=2 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
Bug: 160544144
Test: run cts -m CtsSecurityHostTestCases -t android.security.cts.SELinuxHostTest#testNoBugreportDenials
Change-Id: Ib10b9b0e959e86c6e96610015df93537102d7dde
Diffstat (limited to 'dumpstate')
-rwxr-xr-x | dumpstate/DumpstateDevice.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 538daea..11f46d6 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -699,8 +699,12 @@ Return<DumpstateStatus> DumpstateDevice::dumpstateBoard_1_1(const hidl_handle& h RunCommandToFd(fd, "USB Device Descriptors", {"/vendor/bin/sh", "-c", "cd /sys/bus/usb/devices/1-1 && cat product && cat bcdDevice; cat descriptors | od -t x1 -w16 -N96"}); RunCommandToFd(fd, "Power supply properties", {"/vendor/bin/sh", "-c", "for f in `ls /sys/class/power_supply/*/uevent` ; do echo \"------ $f\\n`cat $f`\\n\" ; done"}); RunCommandToFd(fd, "PMIC Votables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/pmic-votable/*/status"}); - RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /d/google_charger/; for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"}); - RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /d/google_battery/; for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"}); + + if (!PropertiesHelper::IsUserBuild()) { + RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /d/google_charger/; for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"}); + RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /d/google_battery/; for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"}); + } + RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/soc/98c000.i2c/i2c-1/1-0050/1-00500/nvmem"}); DumpFileToFd(fd, "WLC VER", "/sys/devices/platform/soc/98c000.i2c/i2c-1/1-003b/version"); DumpFileToFd(fd, "WLC STATUS", "/sys/devices/platform/soc/98c000.i2c/i2c-1/1-003b/status"); |