Dumpstate: lshal runs in non-root in user build
lshal output is still useful even without root permission,
so include it in user build as well.
Test: lshal in user build
Test: dumpstate_test
Test: DumpstateTest.RunCommandAsRootIfAvailableOnUserBuild
Test: DumpstateTest.RunCommandAsRootIfAvailableOnDebugBuild
Test: DumpstateUtilTest.RunCommandAsRootIfAvailableOnDebugBuild
Test: DumpstateUtilTest.RunCommandAsRootIfAvailableOnUserBuild
Change-Id: Ie8ba9206feb6c2947ed38159ec9893e85d0e020d
Fixes: 66476950
diff --git a/cmds/dumpstate/DumpstateUtil.h b/cmds/dumpstate/DumpstateUtil.h
index 5a8ce5b..698ceff 100644
--- a/cmds/dumpstate/DumpstateUtil.h
+++ b/cmds/dumpstate/DumpstateUtil.h
@@ -89,6 +89,8 @@
CommandOptionsBuilder& Always();
/* Sets the command's PrivilegeMode as `SU_ROOT` */
CommandOptionsBuilder& AsRoot();
+ /* If !IsUserBuild(), sets the command's PrivilegeMode as `SU_ROOT` */
+ CommandOptionsBuilder& AsRootIfAvailable();
/* Sets the command's PrivilegeMode as `DROP_ROOT` */
CommandOptionsBuilder& DropRoot();
/* Sets the command's OutputMode as `REDIRECT_TO_STDERR` */