1 /* 2 * Copyright (C) 2017 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 package com.android.cts.apicoverage; 18 19 import com.android.compatibility.common.util.ReadElf; 20 21 import java.io.File; 22 import java.io.IOException; 23 /** Class that holds Native Code Sumbols */ 24 public class TestModule { 25 private File mConfigExe; 26 private String mModuleName; 27 private String mClassName; 28 private ReadElf.Symbol[] mDynSymArr; 29 TestModule(File configExe, String moduleName, String className)30 TestModule(File configExe, String moduleName, String className) { 31 mConfigExe = configExe; 32 mModuleName = moduleName; 33 mClassName = className; 34 } 35 getDynSymArr()36 public ReadElf.Symbol[] getDynSymArr() throws IOException { 37 if (mDynSymArr == null) { 38 ReadElf re = ReadElf.read(mConfigExe); 39 re.getDynamicSymbol(""); 40 mDynSymArr = re.getDynSymArr(); 41 } 42 43 return mDynSymArr; 44 } 45 getModuleName()46 public String getModuleName() { 47 return mModuleName; 48 } 49 getClassName()50 public String getClassName() { 51 return mClassName; 52 } 53 } 54