* commit '032305fbcf1f1923030723d60621d8bbfa138511': Dump leanback info in aapt dump badging.
This commit is contained in:
@@ -375,6 +375,7 @@ enum {
|
|||||||
LARGEST_WIDTH_LIMIT_DP_ATTR = 0x01010366,
|
LARGEST_WIDTH_LIMIT_DP_ATTR = 0x01010366,
|
||||||
PUBLIC_KEY_ATTR = 0x010103a6,
|
PUBLIC_KEY_ATTR = 0x010103a6,
|
||||||
CATEGORY_ATTR = 0x010103e8,
|
CATEGORY_ATTR = 0x010103e8,
|
||||||
|
BANNER_ATTR = 0x10103f2,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *getComponentName(String8 &pkgName, String8 &componentName) {
|
const char *getComponentName(String8 &pkgName, String8 &componentName) {
|
||||||
@@ -678,6 +679,7 @@ int doDump(Bundle* bundle)
|
|||||||
bool withinActivity = false;
|
bool withinActivity = false;
|
||||||
bool isMainActivity = false;
|
bool isMainActivity = false;
|
||||||
bool isLauncherActivity = false;
|
bool isLauncherActivity = false;
|
||||||
|
bool isLeanbackLauncherActivity = false;
|
||||||
bool isSearchable = false;
|
bool isSearchable = false;
|
||||||
bool withinApplication = false;
|
bool withinApplication = false;
|
||||||
bool withinSupportsInput = false;
|
bool withinSupportsInput = false;
|
||||||
@@ -788,6 +790,7 @@ int doDump(Bundle* bundle)
|
|||||||
String8 activityName;
|
String8 activityName;
|
||||||
String8 activityLabel;
|
String8 activityLabel;
|
||||||
String8 activityIcon;
|
String8 activityIcon;
|
||||||
|
String8 activityBanner;
|
||||||
String8 receiverName;
|
String8 receiverName;
|
||||||
String8 serviceName;
|
String8 serviceName;
|
||||||
Vector<String8> supportedInput;
|
Vector<String8> supportedInput;
|
||||||
@@ -811,15 +814,27 @@ int doDump(Bundle* bundle)
|
|||||||
withinApplication = false;
|
withinApplication = false;
|
||||||
withinSupportsInput = false;
|
withinSupportsInput = false;
|
||||||
} else if (depth < 3) {
|
} else if (depth < 3) {
|
||||||
if (withinActivity && isMainActivity && isLauncherActivity) {
|
if (withinActivity && isMainActivity) {
|
||||||
const char *aName = getComponentName(pkg, activityName);
|
const char *aName = getComponentName(pkg, activityName);
|
||||||
printf("launchable-activity:");
|
if (isLauncherActivity) {
|
||||||
if (aName != NULL) {
|
printf("launchable-activity:");
|
||||||
printf(" name='%s' ", aName);
|
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) {
|
if (!hasIntentFilter) {
|
||||||
hasOtherActivities |= withinActivity;
|
hasOtherActivities |= withinActivity;
|
||||||
@@ -837,7 +852,7 @@ int doDump(Bundle* bundle)
|
|||||||
withinService = false;
|
withinService = false;
|
||||||
withinReceiver = false;
|
withinReceiver = false;
|
||||||
hasIntentFilter = false;
|
hasIntentFilter = false;
|
||||||
isMainActivity = isLauncherActivity = false;
|
isMainActivity = isLauncherActivity = isLeanbackLauncherActivity = false;
|
||||||
} else if (depth < 4) {
|
} else if (depth < 4) {
|
||||||
if (withinIntentFilter) {
|
if (withinIntentFilter) {
|
||||||
if (withinActivity) {
|
if (withinActivity) {
|
||||||
@@ -1232,6 +1247,13 @@ int doDump(Bundle* bundle)
|
|||||||
goto bail;
|
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,
|
int32_t orien = getResolvedIntegerAttribute(&res, tree,
|
||||||
SCREEN_ORIENTATION_ATTR, &error);
|
SCREEN_ORIENTATION_ATTR, &error);
|
||||||
if (error == "") {
|
if (error == "") {
|
||||||
@@ -1413,6 +1435,8 @@ int doDump(Bundle* bundle)
|
|||||||
if (withinActivity) {
|
if (withinActivity) {
|
||||||
if (category == "android.intent.category.LAUNCHER") {
|
if (category == "android.intent.category.LAUNCHER") {
|
||||||
isLauncherActivity = true;
|
isLauncherActivity = true;
|
||||||
|
} else if (category == "android.intent.category.LEANBACK_LAUNCHER") {
|
||||||
|
isLeanbackLauncherActivity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user