AvdInfo* avdInfo_newForAndroidBuild( const char* androidBuildRoot, const char* androidOut, AvdInfoParams* params ) { AvdInfo* i; ANEW0(i); i->inAndroidBuild = 1; i->androidBuildRoot = ASTRDUP(androidBuildRoot); i->androidOut = ASTRDUP(androidOut); i->contentPath = ASTRDUP(androidOut); i->targetArch = path_getBuildTargetArch(i->androidOut); i->apiLevel = path_getBuildTargetApiLevel(i->androidOut); /* TODO: find a way to provide better information from the build files */ i->deviceName = ASTRDUP("<build>"); /* There is no config.ini in the build */ i->configIni = NULL; if (_avdInfo_getCoreHwIniPath(i, i->androidOut) < 0 ) goto FAIL; /* Read the build skin's hardware.ini, if any */ _avdInfo_getBuildSkinHardwareIni(i); return i; FAIL: avdInfo_free(i); return NULL; }
AvdInfo* avdInfo_new( const char* name, AvdInfoParams* params ) { AvdInfo* i; if (name == NULL) return NULL; if (!_checkAvdName(name)) { derror("virtual device name contains invalid characters"); exit(1); } ANEW0(i); i->deviceName = ASTRDUP(name); if ( _avdInfo_getSdkRoot(i) < 0 || _avdInfo_getRootIni(i) < 0 || _avdInfo_getContentPath(i) < 0 || _avdInfo_getConfigIni(i) < 0 || _avdInfo_getCoreHwIniPath(i, i->contentPath) < 0 ) goto FAIL; i->apiLevel = _avdInfo_getApiLevel(i); // Add for device target infromation. _getContentTarget(i); /* look for image search paths. handle post 1.1/pre cupcake * obsolete SDKs. */ _avdInfo_getSearchPaths(i); // Find the build.prop and boot.prop files and read them. _avdInfo_getPropertyFile(i, "build.prop", i->buildProperties); _avdInfo_getPropertyFile(i, "boot.prop", i->bootProperties); _avdInfo_extractBuildProperties(i); /* don't need this anymore */ iniFile_free(i->rootIni); i->rootIni = NULL; return i; FAIL: avdInfo_free(i); return NULL; }
AvdInfo* avdInfo_newForAndroidBuild( const char* androidBuildRoot, const char* androidOut, AvdInfoParams* params ) { AvdInfo* i; ANEW0(i); i->inAndroidBuild = 1; i->androidBuildRoot = ASTRDUP(androidBuildRoot); i->androidOut = ASTRDUP(androidOut); i->contentPath = ASTRDUP(androidOut); // Find the build.prop file and read it. char* buildPropPath = path_getBuildBuildProp(i->androidOut); if (buildPropPath) { _avdInfo_readPropertyFile(i, buildPropPath, i->buildProperties); free(buildPropPath); } // FInd the boot.prop file and read it. char* bootPropPath = path_getBuildBootProp(i->androidOut); if (bootPropPath) { _avdInfo_readPropertyFile(i, bootPropPath, i->bootProperties); free(bootPropPath); } _avdInfo_extractBuildProperties(i); i->deviceName = ASTRDUP("<build>"); /* out/target/product/<name>/config.ini, if exists, provide configuration * from build files. */ if (_avdInfo_getConfigIni(i) < 0 || _avdInfo_getCoreHwIniPath(i, i->androidOut) < 0) goto FAIL; /* Read the build skin's hardware.ini, if any */ _avdInfo_getBuildSkinHardwareIni(i); return i; FAIL: avdInfo_free(i); return NULL; }
AvdInfo* avdInfo_new( const char* name, AvdInfoParams* params ) { AvdInfo* i; if (name == NULL) return NULL; if (!_checkAvdName(name)) { derror("virtual device name contains invalid characters"); exit(1); } ANEW0(i); i->deviceName = ASTRDUP(name); if ( _avdInfo_getSdkRoot(i) < 0 || _avdInfo_getRootIni(i) < 0 || _avdInfo_getContentPath(i) < 0 || _avdInfo_getConfigIni(i) < 0 || _avdInfo_getCoreHwIniPath(i, i->contentPath) < 0 ) goto FAIL; i->apiLevel = _avdInfo_getApiLevel(i); /* look for image search paths. handle post 1.1/pre cupcake * obsolete SDKs. */ _avdInfo_getSearchPaths(i); /* don't need this anymore */ iniFile_free(i->rootIni); i->rootIni = NULL; return i; FAIL: avdInfo_free(i); return NULL; }