Force gtest to use adb unroot if required_root is false or not set

Bug: 140123924
Test: atest hello_world_test
Change-Id: I36fb31d274c179dc8510e08cdb5dc79601546299
This commit is contained in:
Dan Shi
2019-09-12 10:54:49 -07:00
parent e8fad2ba8c
commit b2cb324ce1

View File

@@ -317,6 +317,10 @@ func (test *testBinary) install(ctx ModuleContext, file android.Path) {
var configs []tradefed.Config
if Bool(test.Properties.Require_root) {
configs = append(configs, tradefed.Preparer{"com.android.tradefed.targetprep.RootTargetPreparer", nil})
} else {
var options []tradefed.Option
options = append(options, tradefed.Option{"force-root", "false"})
configs = append(configs, tradefed.Preparer{"com.android.tradefed.targetprep.RootTargetPreparer", options})
}
if Bool(test.Properties.Disable_framework) {
var options []tradefed.Option