Loading core/java/android/os/BugreportParams.java +11 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,8 @@ public final class BugreportParams { @IntDef(flag = true, prefix = { "BUGREPORT_FLAG_" }, value = { BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA, BUGREPORT_FLAG_DEFER_CONSENT, BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL, BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT }) public @interface BugreportFlag {} Loading Loading @@ -178,4 +179,13 @@ public final class BugreportParams { @FlaggedApi(Flags.FLAG_ONBOARDING_BUGREPORT_V2_ENABLED) public static final int BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL = IDumpstate.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL; /** * Flag for taking screenshots of all displays. * @hide */ @FlaggedApi(android.os.Flags.FLAG_BUGREPORT_MULTI_DISPLAY_SCREENSHOT_ENABLED) public static final int BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT = IDumpstate.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT; } services/core/java/com/android/server/os/BugreportManagerServiceImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -666,7 +666,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub { flags = clearBugreportFlag(flags, BugreportParams.BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA | BugreportParams.BUGREPORT_FLAG_DEFER_CONSENT | BugreportParams.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL); | BugreportParams.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL | BugreportParams.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT); if (flags != 0) { Slog.w(TAG, "Unknown bugreport flags: " + flags); throw new IllegalArgumentException("Unknown bugreport flags: " + flags); Loading services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,20 @@ public class BugreportManagerServiceImplTest { assertThat(thrown.getMessage()).contains("not affiliated to the device owner"); } @Test @RequiresFlagsEnabled(android.os.Flags.FLAG_BUGREPORT_MULTI_DISPLAY_SCREENSHOT_ENABLED) public void testStartBugreportWithMultiDisplayScreenshotFlag() { mService.startBugreport(mCallingUid, mContext.getPackageName(), new FileDescriptor(), new FileDescriptor(), BugreportParams.BUGREPORT_MODE_FULL, BugreportParams.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT, new Listener(new CountDownLatch(1)), /* isScreenshotRequested= */ true, /* skipUserConsentUnused = */ false); assertThat(mInjector.isBugreportStarted()).isTrue(); } @Test public void testRetrieveBugreportWithoutFilesForCaller() throws Exception { CountDownLatch latch = new CountDownLatch(1); Loading Loading
core/java/android/os/BugreportParams.java +11 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,8 @@ public final class BugreportParams { @IntDef(flag = true, prefix = { "BUGREPORT_FLAG_" }, value = { BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA, BUGREPORT_FLAG_DEFER_CONSENT, BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL, BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT }) public @interface BugreportFlag {} Loading Loading @@ -178,4 +179,13 @@ public final class BugreportParams { @FlaggedApi(Flags.FLAG_ONBOARDING_BUGREPORT_V2_ENABLED) public static final int BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL = IDumpstate.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL; /** * Flag for taking screenshots of all displays. * @hide */ @FlaggedApi(android.os.Flags.FLAG_BUGREPORT_MULTI_DISPLAY_SCREENSHOT_ENABLED) public static final int BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT = IDumpstate.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT; }
services/core/java/com/android/server/os/BugreportManagerServiceImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -666,7 +666,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub { flags = clearBugreportFlag(flags, BugreportParams.BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA | BugreportParams.BUGREPORT_FLAG_DEFER_CONSENT | BugreportParams.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL); | BugreportParams.BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL | BugreportParams.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT); if (flags != 0) { Slog.w(TAG, "Unknown bugreport flags: " + flags); throw new IllegalArgumentException("Unknown bugreport flags: " + flags); Loading
services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,20 @@ public class BugreportManagerServiceImplTest { assertThat(thrown.getMessage()).contains("not affiliated to the device owner"); } @Test @RequiresFlagsEnabled(android.os.Flags.FLAG_BUGREPORT_MULTI_DISPLAY_SCREENSHOT_ENABLED) public void testStartBugreportWithMultiDisplayScreenshotFlag() { mService.startBugreport(mCallingUid, mContext.getPackageName(), new FileDescriptor(), new FileDescriptor(), BugreportParams.BUGREPORT_MODE_FULL, BugreportParams.BUGREPORT_FLAG_CAPTURE_MULTI_DISPLAY_SCREENSHOT, new Listener(new CountDownLatch(1)), /* isScreenshotRequested= */ true, /* skipUserConsentUnused = */ false); assertThat(mInjector.isBugreportStarted()).isTrue(); } @Test public void testRetrieveBugreportWithoutFilesForCaller() throws Exception { CountDownLatch latch = new CountDownLatch(1); Loading