Add android extension to expose detrand.Disable() am: eee46e6d5c am: 1a171bb04b am: 639e78f42c

Original change: https://android-review.googlesource.com/c/platform/external/golang-protobuf/+/1833015

Change-Id: I2a565e707dcd52b95c626dc4b55731e7c44a5dcf
diff --git a/Android.gen.bp b/Android.gen.bp
index 65138a2..72e1c3b 100644
--- a/Android.gen.bp
+++ b/Android.gen.bp
@@ -1,6 +1,17 @@
 // Automatically generated with:
 // go2bp -rewrite google.golang.org/protobuf=golang-protobuf -rewrite github.com/google/go-cmp/cmp=go-cmp -exclude-src internal/detrand/rand_test.go
 
+bootstrap_go_package {
+    name: "golang-protobuf-android",
+    pkgPath: "google.golang.org/protobuf/android",
+    deps: [
+        "golang-protobuf-internal-detrand",
+    ],
+    srcs: [
+        "android/android.go",
+    ],
+}
+
 blueprint_go_binary {
     name: "protoc-gen-go",
     deps: [
diff --git a/android/android.go b/android/android.go
new file mode 100644
index 0000000..a06e657
--- /dev/null
+++ b/android/android.go
@@ -0,0 +1,20 @@
+// Package android provides android-specific extensions to the upstream module.
+package android
+
+import "google.golang.org/protobuf/internal/detrand"
+
+// DisableRand disables the randomness introduced into JSON and Text encodings.
+// This function is not concurrent-safe and must be called during program init.
+//
+// This does not guarantee long term stability of the JSON/Text encodings, but
+// that isn't necessary in Soong or similar build tools. They are only
+// interested in longer stable periods, as any change in the output may
+// introduce significant extra building during incremental builds. That price
+// is expected when upgrading library versions (and will be paid then even
+// without a format change, as the reader and writer packages will often both
+// change), but is not desired when changing other parts of the executables.
+//
+// See https://github.com/golang/protobuf/issues/1121 for more discussion.
+func DisableRand() {
+	detrand.Disable()
+}