// // This file was generated by third_party/jni_zero/jni_generator.py // package org.jni_zero.samples; import org.jni_zero.CheckDiscard; import org.jni_zero.JniStaticTestMocker; import org.jni_zero.NativeLibraryLoadedStatus; import org.jni_zero.module_GEN_JNI; import org.jni_zero.NativeMethods; @CheckDiscard("crbug.com/993421") class SampleModuleJni implements SampleModule.Natives { private static SampleModule.Natives testInstance; public static final JniStaticTestMocker TEST_HOOKS = new JniStaticTestMocker() { @Override public void setInstanceForTesting(SampleModule.Natives instance) { if (!module_GEN_JNI.TESTING_ENABLED) { throw new RuntimeException( "Tried to set a JNI mock when mocks aren't enabled!"); } testInstance = instance; } }; @Override public boolean bar(int a) { return (boolean) module_GEN_JNI.org_jni_1zero_samples_SampleModule_bar(a); } @Override public void foo() { module_GEN_JNI.org_jni_1zero_samples_SampleModule_foo(); } public static SampleModule.Natives get() { if (module_GEN_JNI.TESTING_ENABLED) { if (testInstance != null) { return testInstance; } if (module_GEN_JNI.REQUIRE_MOCK) { throw new UnsupportedOperationException( "No mock found for the native implementation of SampleModule.Natives. " + "The current configuration requires implementations be mocked."); } } NativeLibraryLoadedStatus.checkLoaded(); return new SampleModuleJni(); } }