Convert droiddoc modules to android.RuleBuilder

Test: m docs
Test: m checkapi
Test: m updateapi
Change-Id: Icc932c4a9a3fc642c96ab9cbd8df3229b5ab86d3
diff --git a/android/rule_builder.go b/android/rule_builder.go
index 1238ddc..48d070e 100644
--- a/android/rule_builder.go
+++ b/android/rule_builder.go
@@ -478,6 +478,16 @@
 	return c.Text(flag)
 }
 
+// OptionalFlag adds the specified raw text to the command line if it is not nil.  The text should not contain input or
+// output paths or the rule will not have them listed in its dependencies or outputs.
+func (c *RuleBuilderCommand) OptionalFlag(flag *string) *RuleBuilderCommand {
+	if flag != nil {
+		c.Text(*flag)
+	}
+
+	return c
+}
+
 // Flags adds the specified raw text to the command line.  The text should not contain input or output paths or the
 // rule will not have them listed in its dependencies or outputs.
 func (c *RuleBuilderCommand) Flags(flags []string) *RuleBuilderCommand {