diff options
author | Tim Kilbourn <tkilbourn@google.com> | 2014-03-07 15:12:50 -0800 |
---|---|---|
committer | Tim Kilbourn <tkilbourn@google.com> | 2014-03-07 16:47:42 -0800 |
commit | 0a5a5d6996e54a927af750e122a1275d64f77ee5 (patch) | |
tree | 2530e6edb6200ff28ee87f58fbb28e2a0b15dc37 /tools/aapt/Command.cpp | |
parent | d1862dac05e4302761c8d741a3286fe5eb6f1174 (diff) | |
download | frameworks_base-0a5a5d6996e54a927af750e122a1275d64f77ee5.zip frameworks_base-0a5a5d6996e54a927af750e122a1275d64f77ee5.tar.gz frameworks_base-0a5a5d6996e54a927af750e122a1275d64f77ee5.tar.bz2 |
Dump leanback info in aapt dump badging.
Leanback launcher activities are reported, including the banner.
Change-Id: Ifa496736ad3ba4239ec95e166768af895ff4dc53
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 5d4232d..d9e2dc5 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -375,6 +375,7 @@ enum { LARGEST_WIDTH_LIMIT_DP_ATTR = 0x01010366, PUBLIC_KEY_ATTR = 0x010103a6, CATEGORY_ATTR = 0x010103e8, + BANNER_ATTR = 0x10103f2, }; const char *getComponentName(String8 &pkgName, String8 &componentName) { @@ -677,6 +678,7 @@ int doDump(Bundle* bundle) bool withinActivity = false; bool isMainActivity = false; bool isLauncherActivity = false; + bool isLeanbackLauncherActivity = false; bool isSearchable = false; bool withinApplication = false; bool withinSupportsInput = false; @@ -787,6 +789,7 @@ int doDump(Bundle* bundle) String8 activityName; String8 activityLabel; String8 activityIcon; + String8 activityBanner; String8 receiverName; String8 serviceName; Vector<String8> supportedInput; @@ -810,15 +813,27 @@ int doDump(Bundle* bundle) withinApplication = false; withinSupportsInput = false; } else if (depth < 3) { - if (withinActivity && isMainActivity && isLauncherActivity) { + if (withinActivity && isMainActivity) { const char *aName = getComponentName(pkg, activityName); - printf("launchable-activity:"); - if (aName != NULL) { - printf(" name='%s' ", aName); + if (isLauncherActivity) { + printf("launchable-activity:"); + if (aName != NULL) { + printf(" name='%s' ", aName); + } + printf(" label='%s' icon='%s'\n", + activityLabel.string(), + activityIcon.string()); + } + if (isLeanbackLauncherActivity) { + printf("leanback-launchable-activity:"); + if (aName != NULL) { + printf(" name='%s' ", aName); + } + printf(" label='%s' icon='%s' banner='%s'\n", + activityLabel.string(), + activityIcon.string(), + activityBanner.string()); } - printf(" label='%s' icon='%s'\n", - activityLabel.string(), - activityIcon.string()); } if (!hasIntentFilter) { hasOtherActivities |= withinActivity; @@ -836,7 +851,7 @@ int doDump(Bundle* bundle) withinService = false; withinReceiver = false; hasIntentFilter = false; - isMainActivity = isLauncherActivity = false; + isMainActivity = isLauncherActivity = isLeanbackLauncherActivity = false; } else if (depth < 4) { if (withinIntentFilter) { if (withinActivity) { @@ -1231,6 +1246,13 @@ int doDump(Bundle* bundle) goto bail; } + activityBanner = getResolvedAttribute(&res, tree, BANNER_ATTR, &error); + if (error != "") { + fprintf(stderr, "ERROR getting 'android:banner' attribute: %s\n", + error.string()); + goto bail; + } + int32_t orien = getResolvedIntegerAttribute(&res, tree, SCREEN_ORIENTATION_ATTR, &error); if (error == "") { @@ -1412,6 +1434,8 @@ int doDump(Bundle* bundle) if (withinActivity) { if (category == "android.intent.category.LAUNCHER") { isLauncherActivity = true; + } else if (category == "android.intent.category.LEANBACK_LAUNCHER") { + isLeanbackLauncherActivity = true; } } } |