Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4b392be4 authored by Nandana Dutt's avatar Nandana Dutt
Browse files

Added system property (dumpstate.unroot).

Dumpstate starts off as root but drops root as soon as it's done with
some important commands and actions that need root privilege. After that,
on non-user builds it's still possible to assume root with 'su root <cmd>',
which it does with AsRoot() option. This means that the output of
such commands (i.e. commands that are run after dropping root, and
require root priviliges) on user-debug builds differ from those on user
devices. This can make it hard for developers to anticipate what
bugreports from user builds are going to look like.

dumpstate.unroot property allows ignoring the availability of "su" in
non-user builds and emulate the user build behavior for those commands.

Fixes: 117980186
Test: adb shell setprop dumpstate.unroot true && \
      adb shell cmd activity bug-report --progress
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test  --gtest_filter=DumpstateTest.RunCommandAsRootNonUserBuild_withUnroot
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test  --gtest_filter=DumpstateTest.RunCommandAsRootIfAvailableOnDebugBuild_withUnroot

Change-Id: I8d8d2f0733a8d13754c7d2e6a0d323c73afcbbbb
parent 13ad9e89
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment