aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-10-08 15:15:05 -0700
committerChirayu Desai <cdesai@cyanogenmod.org>2013-03-28 20:11:38 +0530
commitb84fb1ddd871248eb8f00b40b965873bb28aa8eb (patch)
treee0b0e51c8ad9eb5783f7ba8beb1c62a5e891ecf0
parent2ed75275928cbccd3c30b12856866a61442363ff (diff)
downloadexternal_qemu-b84fb1ddd871248eb8f00b40b965873bb28aa8eb.zip
external_qemu-b84fb1ddd871248eb8f00b40b965873bb28aa8eb.tar.gz
external_qemu-b84fb1ddd871248eb8f00b40b965873bb28aa8eb.tar.bz2
Obtain path to dynamic skin layout folder from sdk root
Change-Id: Id83e082238f696aaa0c330020e3310b20ebe5a32
-rw-r--r--android/main-common.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/android/main-common.c b/android/main-common.c
index 5c82005..78f4b30 100644
--- a/android/main-common.c
+++ b/android/main-common.c
@@ -24,6 +24,7 @@
#include "console.h"
+#include "android/avd/util.h"
#include "android/utils/debug.h"
#include "android/utils/path.h"
#include "android/utils/bufprint.h"
@@ -413,7 +414,7 @@ add_parts_to_layout(AConfig* layout,
int
load_dynamic_skin(AndroidHwConfig* hwConfig,
- const char* skinDirPath,
+ char** skinDirPath,
int width,
int height,
AConfig* root)
@@ -422,15 +423,22 @@ load_dynamic_skin(AndroidHwConfig* hwConfig,
AConfig* node;
int i;
int max_part_width;
+ char fromEnv;
+ char* sdkRoot = path_getSdkRoot(&fromEnv);
- if (skinDirPath == NULL)
+ if (sdkRoot == NULL) {
+ dwarning("Unable to locate sdk root. Will not use dynamic skin.");
return 0;
+ }
+
+ snprintf(tmp, sizeof(tmp), "%s/tools/lib/emulator/skins/dynamic/", sdkRoot);
+ free(sdkRoot);
- snprintf(tmp, sizeof(tmp), "%s/dynamic", skinDirPath);
if (!path_exists(tmp))
return 0;
- snprintf(tmp, sizeof(tmp), "%s/dynamic/layout", skinDirPath);
+ *skinDirPath = strdup(tmp);
+ snprintf(tmp, sizeof(tmp), "%s/layout", *skinDirPath);
D("trying to load skin file '%s'", tmp);
if(aconfig_load_file(root, tmp) < 0) {
@@ -599,9 +607,9 @@ parse_skin_files(const char* skinDirPath,
}
if (opts->dynamic_skin) {
- if (load_dynamic_skin(hwConfig, skinDirPath, width, height, root)) {
- snprintf(tmp, sizeof tmp, "%s/dynamic/", skinDirPath);
- path = tmp;
+ char *dynamicSkinDirPath;
+ if (load_dynamic_skin(hwConfig, &dynamicSkinDirPath, width, height, root)) {
+ path = dynamicSkinDirPath;
D("loaded dynamic skin width=%d height=%d bpp=%d\n", width, height, bpp);
goto FOUND_SKIN;
}