Home | History | Annotate | Download | only in avd
      1 /* Copyright (C) 2011 The Android Open Source Project
      2 **
      3 ** This software is licensed under the terms of the GNU General Public
      4 ** License version 2, as published by the Free Software Foundation, and
      5 ** may be copied, distributed, and modified under those terms.
      6 **
      7 ** This program is distributed in the hope that it will be useful,
      8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 ** GNU General Public License for more details.
     11 */
     12 #ifndef _ANDROID_AVD_UTIL_H
     13 #define _ANDROID_AVD_UTIL_H
     14 
     15 /* A collection of simple functions to extract relevant AVD-related
     16  * information either from an SDK AVD or a platform build.
     17  */
     18 
     19 /* Return the path to the Android SDK root installation.
     20  *
     21  * (*pFromEnv) will be set to 1 if it comes from the $ANDROID_SDK_ROOT
     22  * environment variable, or 0 otherwise.
     23  *
     24  * Caller must free() returned string.
     25  */
     26 char* path_getSdkRoot( char *pFromEnv );
     27 
     28 /* Return the path to the AVD's root configuration .ini file. it is located in
     29  * ~/.android/avd/<name>.ini or Windows equivalent
     30  *
     31  * This file contains the path to the AVD's content directory, which
     32  * includes its own config.ini.
     33  */
     34 char* path_getRootIniPath( const char*  avdName );
     35 
     36 /* Return the target architecture for a given AVD.
     37  * Called must free() returned string.
     38  */
     39 char* path_getAvdTargetArch( const char* avdName );
     40 
     41 /* Retrieves a string corresponding to the target architecture
     42  * when in the Android platform tree. The only way to do that
     43  * properly for now is to look at $OUT/system/build.prop:
     44  *
     45  *   ro.product.cpu-abi=<abi>
     46  *
     47  * Where <abi> can be 'armeabi', 'armeabi-v7a' or 'x86'.
     48  */
     49 char* path_getBuildTargetArch( const char* androidOut );
     50 
     51 /* Retrieves a string corresponding to the target CPU ABI
     52  * when in the Android platform tree. The only way to do that
     53  * properly for now is to look at $OUT/system/build.prop:
     54  *
     55  *   ro.product.cpu-abi=<abi>
     56  *
     57  * Where <abi> can be 'armeabi', 'armeabi-v7a' or 'x86'.
     58  */
     59 char* path_getBuildTargetAbi( const char* androidOut );
     60 
     61 /* Retrieve the target API level when in the Android platform tree.
     62  * This can be a very large number like 1000 if the value cannot
     63  * be extracted from the appropriate file
     64  */
     65 int path_getBuildTargetApiLevel( const char* androidOut );
     66 
     67 #endif /* _ANDROID_AVD_UTIL_H */
     68