1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 class MyClassNatives { throwException()18 native void throwException(); foo()19 native void foo(); bar(int count)20 native int bar(int count); sbar(int count)21 static native int sbar(int count); fooI(int x)22 native int fooI(int x); fooII(int x, int y)23 native int fooII(int x, int y); fooJJ(long x, long y)24 native long fooJJ(long x, long y); fooO(Object x)25 native Object fooO(Object x); fooDD(double x, double y)26 native double fooDD(double x, double y); fooJJ_synchronized(long x, long y)27 synchronized native long fooJJ_synchronized(long x, long y); fooIOO(int x, Object y, Object z)28 native Object fooIOO(int x, Object y, Object z); fooSIOO(int x, Object y, Object z)29 static native Object fooSIOO(int x, Object y, Object z); fooSII(int x, int y)30 static native int fooSII(int x, int y); fooSDD(double x, double y)31 static native double fooSDD(double x, double y); fooSSIOO(int x, Object y, Object z)32 static synchronized native Object fooSSIOO(int x, Object y, Object z); arraycopy(Object src, int src_pos, Object dst, int dst_pos, int length)33 static native void arraycopy(Object src, int src_pos, Object dst, int dst_pos, int length); compareAndSwapInt(Object obj, long offset, int expected, int newval)34 native boolean compareAndSwapInt(Object obj, long offset, int expected, int newval); getText(long val1, Object obj1, long val2, Object obj2)35 static native int getText(long val1, Object obj1, long val2, Object obj2); getSinkPropertiesNative(String path)36 synchronized native Object []getSinkPropertiesNative(String path); 37 instanceMethodThatShouldReturnClass()38 native Class instanceMethodThatShouldReturnClass(); staticMethodThatShouldReturnClass()39 static native Class staticMethodThatShouldReturnClass(); 40 instanceMethodThatShouldTakeClass(int i, Class c)41 native void instanceMethodThatShouldTakeClass(int i, Class c); staticMethodThatShouldTakeClass(int i, Class c)42 static native void staticMethodThatShouldTakeClass(int i, Class c); 43 } 44