1811820f440b24db200e66874d42331023b7cd389Raphael/*
2811820f440b24db200e66874d42331023b7cd389Raphael * Copyright (C) 2010 The Android Open Source Project
3811820f440b24db200e66874d42331023b7cd389Raphael *
4811820f440b24db200e66874d42331023b7cd389Raphael * Licensed under the Apache License, Version 2.0 (the "License");
5811820f440b24db200e66874d42331023b7cd389Raphael * you may not use this file except in compliance with the License.
6811820f440b24db200e66874d42331023b7cd389Raphael * You may obtain a copy of the License at
7811820f440b24db200e66874d42331023b7cd389Raphael *
8811820f440b24db200e66874d42331023b7cd389Raphael *      http://www.apache.org/licenses/LICENSE-2.0
9811820f440b24db200e66874d42331023b7cd389Raphael *
10811820f440b24db200e66874d42331023b7cd389Raphael * Unless required by applicable law or agreed to in writing, software
11811820f440b24db200e66874d42331023b7cd389Raphael * distributed under the License is distributed on an "AS IS" BASIS,
12811820f440b24db200e66874d42331023b7cd389Raphael * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13811820f440b24db200e66874d42331023b7cd389Raphael * See the License for the specific language governing permissions and
14811820f440b24db200e66874d42331023b7cd389Raphael * limitations under the License.
15811820f440b24db200e66874d42331023b7cd389Raphael */
16811820f440b24db200e66874d42331023b7cd389Raphael
17811820f440b24db200e66874d42331023b7cd389Raphaelpackage com.android.tools.layoutlib.create.dataclass;
18811820f440b24db200e66874d42331023b7cd389Raphael
19811820f440b24db200e66874d42331023b7cd389Raphaelimport com.android.tools.layoutlib.create.DelegateClassAdapterTest;
20811820f440b24db200e66874d42331023b7cd389Raphael
21811820f440b24db200e66874d42331023b7cd389Raphael/**
22811820f440b24db200e66874d42331023b7cd389Raphael * Dummy test class with a native method.
23811820f440b24db200e66874d42331023b7cd389Raphael * The native method is not defined and any attempt to invoke it will
24811820f440b24db200e66874d42331023b7cd389Raphael * throw an {@link UnsatisfiedLinkError}.
25811820f440b24db200e66874d42331023b7cd389Raphael *
26811820f440b24db200e66874d42331023b7cd389Raphael * Used by {@link DelegateClassAdapterTest}.
27811820f440b24db200e66874d42331023b7cd389Raphael */
28811820f440b24db200e66874d42331023b7cd389Raphaelpublic class ClassWithNative {
29811820f440b24db200e66874d42331023b7cd389Raphael    public ClassWithNative() {
30811820f440b24db200e66874d42331023b7cd389Raphael    }
31811820f440b24db200e66874d42331023b7cd389Raphael
32811820f440b24db200e66874d42331023b7cd389Raphael    public int add(int a, int b) {
33811820f440b24db200e66874d42331023b7cd389Raphael        return a + b;
34811820f440b24db200e66874d42331023b7cd389Raphael    }
35811820f440b24db200e66874d42331023b7cd389Raphael
36811820f440b24db200e66874d42331023b7cd389Raphael    // Note: it's good to have a long or double for testing parameters since they take
37811820f440b24db200e66874d42331023b7cd389Raphael    // 2 slots in the stack/locals maps.
38811820f440b24db200e66874d42331023b7cd389Raphael
39811820f440b24db200e66874d42331023b7cd389Raphael    public int callNativeInstance(int a, double d, Object[] o) {
40811820f440b24db200e66874d42331023b7cd389Raphael        return native_instance(a, d, o);
41811820f440b24db200e66874d42331023b7cd389Raphael    }
42811820f440b24db200e66874d42331023b7cd389Raphael
43811820f440b24db200e66874d42331023b7cd389Raphael    private native int native_instance(int a, double d, Object[] o);
44811820f440b24db200e66874d42331023b7cd389Raphael}
45811820f440b24db200e66874d42331023b7cd389Raphael
46