diff options
| author | 2024-03-27 00:41:08 +0000 | |
|---|---|---|
| committer | 2024-04-05 11:34:18 +0000 | |
| commit | ce32edc3ce1023a24e712bf0a64676b40a961acf (patch) | |
| tree | 58d29f824b8f5882260b1f1853429c8856cb3384 | |
| parent | 46cbe8e1d1b94bdf12a20b63d201df9e402c84ac (diff) | |
Fix CtsRootBugreportTestCases on the following assumption
Assumption:
Since consent has already been denied, this call should
fail because consent cannot be requested twice for the
same bugreport.
The assumption comes from the CtsRootBugreportTestCases itself.
The bug was identified while diagnosing b/330056624
Failure,
expected: 6 (BUGREPORT_ERROR_NO_BUGREPORT_TO_RETRIEVE)
but was : 4 (BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT)
at
...testRetrieveBugreportConsentDenied(...)
Test: atest CtsRootBugreportTestCases
Bug: 330056624
Change-Id: I689d3558693c6766b5000cc1730620167db8827f
| -rw-r--r-- | services/core/java/com/android/server/os/BugreportManagerServiceImpl.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java index 4eb8b2b980cb..c8fd7e47d80a 100644 --- a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java +++ b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java @@ -184,6 +184,16 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub { throwInvalidBugreportFileForCallerException( bugreportFile, callingInfo.second); } + + boolean keepBugreportOnRetrieval = false; + if (onboardingBugreportV2Enabled()) { + keepBugreportOnRetrieval = mBugreportFilesToPersist.contains( + bugreportFile); + } + + if (!keepBugreportOnRetrieval) { + bugreportFilesForUid.remove(bugreportFile); + } } else { ArraySet<String> bugreportFilesForCaller = mBugreportFiles.get(callingInfo); if (bugreportFilesForCaller != null |