Loading packages/Shell/src/com/android/shell/BugreportProgressService.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -613,7 +613,7 @@ public class BugreportProgressService extends Service { return; return; } } ParcelFileDescriptor screenshotFd = null; ParcelFileDescriptor screenshotFd = null; if (isDefaultScreenshotRequired(bugreportType)) { if (isDefaultScreenshotRequired(bugreportType, /* hasScreenshotButton= */ !mIsTv)) { screenshotFd = info.getDefaultScreenshotFd(); screenshotFd = info.getDefaultScreenshotFd(); if (screenshotFd == null) { if (screenshotFd == null) { Log.e(TAG, "Failed to start bugreport generation as" Log.e(TAG, "Failed to start bugreport generation as" Loading Loading @@ -651,10 +651,12 @@ public class BugreportProgressService extends Service { } } private static boolean isDefaultScreenshotRequired( private static boolean isDefaultScreenshotRequired( @BugreportParams.BugreportMode int bugreportType) { @BugreportParams.BugreportMode int bugreportType, boolean hasScreenshotButton) { // Modify dumpstate#SetOptionsFromMode as well for default system screenshots. // Modify dumpstate#SetOptionsFromMode as well for default system screenshots. // We override dumpstate for interactive bugreports. // We override dumpstate for interactive bugreports with a screenshot button. return bugreportType == BugreportParams.BUGREPORT_MODE_FULL return (bugreportType == BugreportParams.BUGREPORT_MODE_INTERACTIVE && !hasScreenshotButton) || bugreportType == BugreportParams.BUGREPORT_MODE_FULL || bugreportType == BugreportParams.BUGREPORT_MODE_WEAR; || bugreportType == BugreportParams.BUGREPORT_MODE_WEAR; } } Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -693,7 +693,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { accessibilityShortcutActivated(); accessibilityShortcutActivated(); break; break; case MSG_BUGREPORT_TV: case MSG_BUGREPORT_TV: requestFullBugreportOrLaunchHandlerApp(); requestBugreportForTv(); break; break; case MSG_ACCESSIBILITY_TV: case MSG_ACCESSIBILITY_TV: if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) { if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) { Loading Loading @@ -3037,13 +3037,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mAccessibilityTvScheduled; return mAccessibilityTvScheduled; } } private void requestFullBugreportOrLaunchHandlerApp() { private void requestBugreportForTv() { if ("1".equals(SystemProperties.get("ro.debuggable")) if ("1".equals(SystemProperties.get("ro.debuggable")) || Settings.Global.getInt(mContext.getContentResolver(), || Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) { Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) { try { try { if (!ActivityManager.getService().launchBugReportHandlerApp()) { if (!ActivityManager.getService().launchBugReportHandlerApp()) { ActivityManager.getService().requestFullBugReport(); ActivityManager.getService().requestInteractiveBugReport(); } } } catch (RemoteException e) { } catch (RemoteException e) { Slog.e(TAG, "Error taking bugreport", e); Slog.e(TAG, "Error taking bugreport", e); Loading Loading
packages/Shell/src/com/android/shell/BugreportProgressService.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -613,7 +613,7 @@ public class BugreportProgressService extends Service { return; return; } } ParcelFileDescriptor screenshotFd = null; ParcelFileDescriptor screenshotFd = null; if (isDefaultScreenshotRequired(bugreportType)) { if (isDefaultScreenshotRequired(bugreportType, /* hasScreenshotButton= */ !mIsTv)) { screenshotFd = info.getDefaultScreenshotFd(); screenshotFd = info.getDefaultScreenshotFd(); if (screenshotFd == null) { if (screenshotFd == null) { Log.e(TAG, "Failed to start bugreport generation as" Log.e(TAG, "Failed to start bugreport generation as" Loading Loading @@ -651,10 +651,12 @@ public class BugreportProgressService extends Service { } } private static boolean isDefaultScreenshotRequired( private static boolean isDefaultScreenshotRequired( @BugreportParams.BugreportMode int bugreportType) { @BugreportParams.BugreportMode int bugreportType, boolean hasScreenshotButton) { // Modify dumpstate#SetOptionsFromMode as well for default system screenshots. // Modify dumpstate#SetOptionsFromMode as well for default system screenshots. // We override dumpstate for interactive bugreports. // We override dumpstate for interactive bugreports with a screenshot button. return bugreportType == BugreportParams.BUGREPORT_MODE_FULL return (bugreportType == BugreportParams.BUGREPORT_MODE_INTERACTIVE && !hasScreenshotButton) || bugreportType == BugreportParams.BUGREPORT_MODE_FULL || bugreportType == BugreportParams.BUGREPORT_MODE_WEAR; || bugreportType == BugreportParams.BUGREPORT_MODE_WEAR; } } Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -693,7 +693,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { accessibilityShortcutActivated(); accessibilityShortcutActivated(); break; break; case MSG_BUGREPORT_TV: case MSG_BUGREPORT_TV: requestFullBugreportOrLaunchHandlerApp(); requestBugreportForTv(); break; break; case MSG_ACCESSIBILITY_TV: case MSG_ACCESSIBILITY_TV: if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) { if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) { Loading Loading @@ -3037,13 +3037,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mAccessibilityTvScheduled; return mAccessibilityTvScheduled; } } private void requestFullBugreportOrLaunchHandlerApp() { private void requestBugreportForTv() { if ("1".equals(SystemProperties.get("ro.debuggable")) if ("1".equals(SystemProperties.get("ro.debuggable")) || Settings.Global.getInt(mContext.getContentResolver(), || Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) { Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) { try { try { if (!ActivityManager.getService().launchBugReportHandlerApp()) { if (!ActivityManager.getService().launchBugReportHandlerApp()) { ActivityManager.getService().requestFullBugReport(); ActivityManager.getService().requestInteractiveBugReport(); } } } catch (RemoteException e) { } catch (RemoteException e) { Slog.e(TAG, "Error taking bugreport", e); Slog.e(TAG, "Error taking bugreport", e); Loading