diff --git a/cc/test.go b/cc/test.go index 1a0d44fd6..a5a368071 100644 --- a/cc/test.go +++ b/cc/test.go @@ -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