Merge "Take interactive bugreports on Android TV" into rvc-dev

This commit is contained in:
Robin Lee
2020-05-22 09:58:53 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 7 deletions

View File

@@ -613,7 +613,7 @@ public class BugreportProgressService extends Service {
return;
}
ParcelFileDescriptor screenshotFd = null;
if (isDefaultScreenshotRequired(bugreportType)) {
if (isDefaultScreenshotRequired(bugreportType, /* hasScreenshotButton= */ !mIsTv)) {
screenshotFd = info.getDefaultScreenshotFd();
if (screenshotFd == null) {
Log.e(TAG, "Failed to start bugreport generation as"
@@ -651,10 +651,12 @@ public class BugreportProgressService extends Service {
}
private static boolean isDefaultScreenshotRequired(
@BugreportParams.BugreportMode int bugreportType) {
@BugreportParams.BugreportMode int bugreportType,
boolean hasScreenshotButton) {
// Modify dumpstate#SetOptionsFromMode as well for default system screenshots.
// We override dumpstate for interactive bugreports.
return bugreportType == BugreportParams.BUGREPORT_MODE_FULL
// We override dumpstate for interactive bugreports with a screenshot button.
return (bugreportType == BugreportParams.BUGREPORT_MODE_INTERACTIVE && !hasScreenshotButton)
|| bugreportType == BugreportParams.BUGREPORT_MODE_FULL
|| bugreportType == BugreportParams.BUGREPORT_MODE_WEAR;
}