1// 2// This file was generated by //third_party/jni_zero/jni_zero.py 3// 4package org.jni_zero; 5 6import android.graphics.Rect; 7import java.util.List; 8import java.util.Map; 9import java.util.Set; 10import org.jni_zero.CheckDiscard; 11import org.jni_zero.GEN_JNI; 12import org.jni_zero.JniTestInstanceHolder; 13import org.jni_zero.NativeLibraryLoadedStatus; 14import org.jni_zero.SampleForTests; 15import org.jni_zero.SampleUnderSamePackage; 16 17@CheckDiscard("crbug.com/993421") 18public class SampleForTestsJni implements SampleForTests.Natives { 19 private static JniTestInstanceHolder sOverride; 20 21 public static SampleForTests.Natives get() { 22 JniTestInstanceHolder holder = sOverride; 23 if (holder != null && holder.value != null) { 24 return (SampleForTests.Natives) holder.value; 25 } 26 NativeLibraryLoadedStatus.checkLoaded(); 27 return new SampleForTestsJni(); 28 } 29 30 public static void setInstanceForTesting(SampleForTests.Natives impl) { 31 if (sOverride == null) { 32 sOverride = JniTestInstanceHolder.create(); 33 } 34 sOverride.value = impl; 35 } 36 37 38 @Override 39 public void addStructB(long nativeCPPClass, SampleForTests caller, SampleForTests.InnerStructB b) { 40 assert nativeCPPClass != 0; 41 GEN_JNI.org_jni_1zero_SampleForTests_addStructB(nativeCPPClass, caller, b); 42 } 43 44 @Override 45 public void classUnderSamePackageTest(SampleUnderSamePackage arg) { 46 GEN_JNI.org_jni_1zero_SampleForTests_classUnderSamePackageTest(arg); 47 } 48 49 @Override 50 public void destroy(long nativeCPPClass, SampleForTests caller, byte[] bytes) { 51 assert nativeCPPClass != 0; 52 GEN_JNI.org_jni_1zero_SampleForTests_destroy(nativeCPPClass, caller, bytes); 53 } 54 55 @Override 56 public Class getClass(Class env) { 57 return (Class) GEN_JNI.org_jni_1zero_SampleForTests_getClass(env); 58 } 59 60 @Override 61 public double getDoubleFunction(SampleForTests ret) { 62 return (double) GEN_JNI.org_jni_1zero_SampleForTests_getDoubleFunction(ret); 63 } 64 65 @Override 66 public float getFloatFunction() { 67 return (float) GEN_JNI.org_jni_1zero_SampleForTests_getFloatFunction(); 68 } 69 70 @Override 71 public Object getNonPODDatatype(SampleForTests jcaller) { 72 return (Object) GEN_JNI.org_jni_1zero_SampleForTests_getNonPODDatatype(jcaller); 73 } 74 75 @Override 76 public Throwable getThrowable(Throwable arg0) { 77 return (Throwable) GEN_JNI.org_jni_1zero_SampleForTests_getThrowable(arg0); 78 } 79 80 @Override 81 public long init(SampleForTests caller, String param, byte[] bytes, SampleForTests convertedType, SampleForTests[] nonConvertedArray) { 82 return (long) GEN_JNI.org_jni_1zero_SampleForTests_init( 83 caller, 84 param, 85 bytes, 86 convertedType, 87 nonConvertedArray); 88 } 89 90 @Override 91 public void iterateAndDoSomethingWithStructB(long nativeCPPClass, SampleForTests caller) { 92 assert nativeCPPClass != 0; 93 GEN_JNI.org_jni_1zero_SampleForTests_iterateAndDoSomethingWithStructB(nativeCPPClass, caller); 94 } 95 96 @Override 97 public List listTest2(Set items) { 98 return (List) GEN_JNI.org_jni_1zero_SampleForTests_listTest2(items); 99 } 100 101 @Override 102 public Map mapTest2(Map arg0) { 103 return (Map) GEN_JNI.org_jni_1zero_SampleForTests_mapTest2(arg0); 104 } 105 106 @Override 107 public int method(long nativeCPPClass, SampleForTests caller, String[] strings) { 108 assert nativeCPPClass != 0; 109 return (int) GEN_JNI.org_jni_1zero_SampleForTests_method(nativeCPPClass, caller, strings); 110 } 111 112 @Override 113 public double methodOtherP0(long nativePtr, SampleForTests caller) { 114 assert nativePtr != 0; 115 return (double) GEN_JNI.org_jni_1zero_SampleForTests_methodOtherP0(nativePtr, caller); 116 } 117 118 @Override 119 public boolean[] primitiveArrays(byte[] b, char[] c, short[] s, int[] i, long[] l, float[] f, double[] d) { 120 return (boolean[]) GEN_JNI.org_jni_1zero_SampleForTests_primitiveArrays(b, c, s, i, l, f, d); 121 } 122 123 @Override 124 public String returnAString(long nativeCPPClass, SampleForTests caller) { 125 assert nativeCPPClass != 0; 126 return (String) GEN_JNI.org_jni_1zero_SampleForTests_returnAString(nativeCPPClass, caller); 127 } 128 129 @Override 130 public void setNonPODDatatype(SampleForTests obj, Rect rect) { 131 GEN_JNI.org_jni_1zero_SampleForTests_setNonPODDatatype(obj, rect); 132 } 133} 134