)]}'
{
  "commit": "81da75c95ca3799ef4b54faaa049f8aa685d158b",
  "tree": "4bb9f873fda938c5c48b46c90c13ba56966eab04",
  "parents": [
    "ca68af800ed5a2097c3198a618093f777256e226"
  ],
  "author": {
    "name": "Zimuzo Ezeozue",
    "email": "zezeozue@google.com",
    "time": "Tue May 19 12:29:41 2026 +0100"
  },
  "committer": {
    "name": "Zimuzo Ezeozue",
    "email": "zezeozue@google.com",
    "time": "Tue May 19 12:29:41 2026 +0100"
  },
  "message": "android_sdk: Host JVM test runner for PerfettoTraceTest\n\nCompanion to tools/run_android_test (which runs the SDK test under ART on\na device or emulator). tools/run_android_sdk_host_test compiles the\nupstream perfetto Java SDK against a small set of host-only stubs for the\nandroid.* classes the SDK references, links against the standard\nlibperfetto_jni.so the gn+ninja pipeline produces, and runs the JUnit\nsuite under whatever host JVM is on PATH.\n\nMechanics\n---------\n* Stubs at src/android_sdk/java/host_stubs/ cover the only Android\n  symbols the SDK + test touch: dalvik.annotation.optimization.{Critical,\n  Fast}Native (no-op annotations), android.system.SystemCleaner (delegates\n  to java.lang.ref.Cleaner), android.util.{ArraySet,Log},\n  android.os.Process, and androidx.test.ext.junit.runners.AndroidJUnit4\n  (delegates to BlockJUnit4ClassRunner). Same .java sources compile and\n  run on both Android and host -- no codegen, no patched SDK file.\n* libperfetto_jni\u0027s source set gains a conditional include path\n  (jdk_include_path, opt-in via tools/gn args) that wires up the host\n  JDK\u0027s jni.h and a small android/log.h shim under host_shims/. AOSP /\n  device builds are untouched because the conditional only fires when\n  jdk_include_path is set, which the runner does itself when the user\n  invokes it.\n* tools/install-build-deps --java-sdk lands JUnit 4, Hamcrest, Truth,\n  Guava + failureaccess, protobuf-java 4.31.1 (matches protoc 31.x),\n  error_prone_annotations, checker-qual and j2objc-annotations in\n  buildtools/java_sdk_host_test/. All SHA256-pinned from Maven Central.\n  The flag is opt-in -- a plain tools/install-build-deps doesn\u0027t pull\n  Java deps, so the standard build is unaffected.\n* The runner generates the Java proto codegen for the transitive\n  closure of imports starting from the protos PerfettoTraceTest\n  references, javac-compiles SDK + stubs + protos to\n  out/release/perfetto_sdk_host.jar, compiles the test to\n  perfetto_sdk_host_test.jar, and invokes JUnitCore with java.library.path\n  + LD_LIBRARY_PATH pointing at out/release.\n\nWhy the macro + this runner together\n------------------------------------\nRunning the upstream SDK natives under HotSpot requires the standard\nJNIEnv*/jclass prefix on the C side; PERFETTO_JNI_HOST_PARAMS handles\nthat. This change adds the surrounding glue (host stubs + native build\nwiring + JUnit driver) so contributors can iterate on the Java SDK on\ntheir dev machine without a connected device or emulator. C++ tests and\nbenchmarks (perfetto_unittests / perfetto_benchmarks) already run on\nhost; this closes the same loop for the Java side.\n\nUsage\n-----\n  tools/install-build-deps\n  tools/install-build-deps --java-sdk\n  tools/run_android_sdk_host_test\n  # -\u003e \"OK (20 tests)\" on HotSpot 21\n\nVerification\n------------\nPerfettoTraceTest -\u003e 20/20 PASS on host OpenJDK 21 (3.08s).\nAOSP / device build path unaffected: jdk_include_path defaults to \"\" so\nthe new include_dirs and cflags blocks in libperfetto_jni_src are inert\nunless the runner is in use.\n\nChange-Id: If4b9451acc9d3381a597ef9661f245e7bcdb342b\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f9bd95a8ac182c786ea2fd4504583190127ad433",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/android/os/Process.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e0ed128eb72c612e265a6db120a0570501783be2",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/android/system/SystemCleaner.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bc246b05b2c31f75623453264bb1503fb24f2efb",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/android/util/ArraySet.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "edea22204c9897030874ae3f429603d44b4fe42b",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/android/util/Log.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4753a45c3a0d4a1dfad10bf3d49674f9ee928761",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/androidx/test/ext/junit/runners/AndroidJUnit4.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1dfb2a3d3f5114c24fcea97cbe067e81dee5e796",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/dalvik/annotation/optimization/CriticalNative.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "052a2bcfe58d879f37a29d905c788f4f35f50c41",
      "new_mode": 33188,
      "new_path": "src/android_sdk/java/host_stubs/dalvik/annotation/optimization/FastNative.java"
    },
    {
      "type": "modify",
      "old_id": "955fef6494f6cbe508fcd566ddf12c432d8fc000",
      "old_mode": 33188,
      "old_path": "src/android_sdk/jni/BUILD.gn",
      "new_id": "44edfc4edcd27f063621f1aea883fb9b467c7d0d",
      "new_mode": 33188,
      "new_path": "src/android_sdk/jni/BUILD.gn"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7133810a0ee993fc8a24432c394918659cca8d49",
      "new_mode": 33188,
      "new_path": "src/android_sdk/jni/host_shims/android/log.h"
    },
    {
      "type": "modify",
      "old_id": "df9b2cb930e939f7a1b4d683628c77087728b0f3",
      "old_mode": 33261,
      "old_path": "tools/install-build-deps",
      "new_id": "39553188a65043ba1cfa6a59eeec6dd7a89321cd",
      "new_mode": 33261,
      "new_path": "tools/install-build-deps"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5b5ccff06185863c313b27bffe0f2f50632090e2",
      "new_mode": 33261,
      "new_path": "tools/run_android_sdk_host_test"
    }
  ]
}
