1 /* 2 * Copyright (C) 2021 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 public class TestCase { 18 test()19 public static void test() { 20 // This call should be successful as the method is accessible through the interface. 21 int value = new InheritAbstract().methodPublicSdkNotInAbstractParent(); 22 if (value != 42) { 23 throw new Error("Expected 42, got " + value); 24 } 25 } 26 testNative(String library)27 public static void testNative(String library) { 28 System.load(library); 29 int value = testNativeInternal(); 30 if (value != 42) { 31 throw new Error("Expected 42, got " + value); 32 } 33 } 34 testNativeInternal()35 public static native int testNativeInternal(); 36 } 37