Merge "Take interactive bugreports on Android TV" into rvc-dev am: 1d22ea4eca
Change-Id: Ia42d4881c58e876758eb3d1168ed22749774b33f
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -693,7 +693,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
accessibilityShortcutActivated();
|
||||
break;
|
||||
case MSG_BUGREPORT_TV:
|
||||
requestFullBugreportOrLaunchHandlerApp();
|
||||
requestBugreportForTv();
|
||||
break;
|
||||
case MSG_ACCESSIBILITY_TV:
|
||||
if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) {
|
||||
@@ -3037,13 +3037,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
return mAccessibilityTvScheduled;
|
||||
}
|
||||
|
||||
private void requestFullBugreportOrLaunchHandlerApp() {
|
||||
private void requestBugreportForTv() {
|
||||
if ("1".equals(SystemProperties.get("ro.debuggable"))
|
||||
|| Settings.Global.getInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) {
|
||||
try {
|
||||
if (!ActivityManager.getService().launchBugReportHandlerApp()) {
|
||||
ActivityManager.getService().requestFullBugReport();
|
||||
ActivityManager.getService().requestInteractiveBugReport();
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Error taking bugreport", e);
|
||||
|
||||
Reference in New Issue
Block a user