From caf797c84a6a2829662872e0df93fcd61da78d51 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Fri, 22 Aug 2014 12:56:26 -0700 Subject: AAPT: Dump installLocation in badging Bug:17033144 Change-Id: I87dea9af47eef8bcba1465df9b49e355ac6346ec --- tools/aapt/Command.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tools') diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index bdbf47b..b394671 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -438,6 +438,7 @@ enum { LARGE_SCREEN_ATTR = 0x01010286, XLARGE_SCREEN_ATTR = 0x010102bf, REQUIRED_ATTR = 0x0101028e, + INSTALL_LOCATION_ATTR = 0x010102b7, SCREEN_SIZE_ATTR = 0x010102ca, SCREEN_DENSITY_ATTR = 0x010102cb, REQUIRES_SMALLEST_WIDTH_DP_ATTR = 0x01010364, @@ -1177,6 +1178,33 @@ int doDump(Bundle* bundle) splitName.string()).string()); } printf("\n"); + + int32_t installLocation = getResolvedIntegerAttribute(&res, tree, + INSTALL_LOCATION_ATTR, &error, -1); + if (error != "") { + fprintf(stderr, "ERROR getting 'android:installLocation' attribute: %s\n", + error.string()); + goto bail; + } + + if (installLocation >= 0) { + printf("install-location:'"); + switch (installLocation) { + case 0: + printf("auto"); + break; + case 1: + printf("internalOnly"); + break; + case 2: + printf("preferExternal"); + break; + default: + fprintf(stderr, "Invalid installLocation %d\n", installLocation); + goto bail; + } + printf("'\n"); + } } else if (depth == 2) { withinApplication = false; if (tag == "application") { -- cgit v1.1