Remove usages of namespace in generate_jni in BUILD.gn files
This CL removes usages of namespace in generate_jni, and use
@JNINamespace("foo") instead.
Bug: 396707350
Change-Id: Ia6d76760a22cf00cb42037ec4761a35b4c2fec36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7363020
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Martin Kong <martinkong@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1567791}
NOKEYCHECK=True
GitOrigin-RevId: 45a5f753d943301d61a73c3f69d9e16f206f2f3e
diff --git a/BUILD.gn b/BUILD.gn
index a568d28..b7b391c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -40,7 +40,6 @@
if (!is_cronet_build && is_android) {
generate_jni("jni_headers") {
- namespace = "metrics"
sources = [
"android/java/src/org/chromium/components/metrics/LowEntropySource.java",
]
diff --git a/android/java/src/org/chromium/components/metrics/LowEntropySource.java b/android/java/src/org/chromium/components/metrics/LowEntropySource.java
index e1c76c8..12405d8 100644
--- a/android/java/src/org/chromium/components/metrics/LowEntropySource.java
+++ b/android/java/src/org/chromium/components/metrics/LowEntropySource.java
@@ -9,6 +9,7 @@
import androidx.annotation.MainThread;
import org.jni_zero.CalledByNative;
+import org.jni_zero.JNINamespace;
import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
@@ -18,12 +19,13 @@
/**
* Generates a new non-identifying entropy source used to seed persistent activities. Has a static
- * cache so that the new low entropy source value will only be generated on first access.
- * Low entropy source is queried by entropy_source.cc that caches it in prefs. On Android, it is
+ * cache so that the new low entropy source value will only be generated on first access. Low
+ * entropy source is queried by entropy_source.cc that caches it in prefs. On Android, it is
* generated in Java so that it can be used by FRE experiments when the native is not available yet.
*/
@MainThread
@NullMarked
+@JNINamespace("metrics")
public class LowEntropySource {
// Should be equal to the value of EntropyState::kMaxLowEntropySize in C++.
public static final int MAX_LOW_ENTROPY_SIZE = 8000;