summaryrefslogtreecommitdiff
path: root/packages/Shell/src
AgeCommit message (Collapse)Author
2025-03-11Merge "Rate limit BR notifications" into main Treehugger Robot
2025-03-11Rate limit BR notifications Ronish Kalia
To avoid notifications throttling, rate limit the notifications instead of delaying the final notification. The final delay doesn't worj in case the service get's killed, which can happen on a busy device. Note, this is in control of the system and not the service/client. Bug: 395488230 Change-Id: I9fb20868e163292c7e12c5cc12c4e79c7683aab9 Test: N/A couldn't repro Flag: EXEMPT Minor Change
2025-02-10Move BugreportPrefs constants to shared location between sysui and shell Rana Mouawi
bug:380825247 Manual test: - M -> to build - sh vendor/google/tools/flashall -> to install changes - Set watch to test mode: adb shell am broadcast -a com.google.android.clockwork.action.TEST_MODE - Select Take bug report and press in details when finished Flag: EXEMPT refactor Bugreport: https://drive.google.com/file/d/1vCUk5Q18jWH2IPEbhTBUCZf0K3WE74LD/view?usp=sharing&resourcekey=0-qTNzJx3VoCf3lpsUEBCUIg (cherry picked from https://partner-android-review.googlesource.com/q/commit:beeaf50d15a1bafb48f006b7cd77393d04180b3f) Merged-In: Id59ecadbecd84f79474184c0110aa6536ec8abf4 Change-Id: Id59ecadbecd84f79474184c0110aa6536ec8abf4
2025-01-02Always initialize ScreenshotLocationInfo. Rana Mouawi
If the screenshot size was less than 1, ScreenshotLocationInfo was not initialized and this led to a NullPointerException. Bug: b/383927821 Flag: EXEMPT bugfix Change-Id: Ie950d33ccc7c66d94d8a646de2e3e57aa75b1d3a
2024-12-12Merge "Delay final notification for bugreport generation" into main am: ↵ Treehugger Robot
e04c12bd1d am: c18864feb5 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3345004 Change-Id: I8af7c918ef1e7a2879644bc795bf58b9c9366683 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-09Delay final notification for bugreport generation Sebastian Achim
System discards notifications in case it comes too early. Bug: 344946064 Test: atest com.android.shell.BugreportReceiverTest#testStressProgress Change-Id: I9193bbfe487e81bf711112d673961cb285c81bbb
2024-12-05Merge "Use WearBugreportWarningActivity from SystemUI in Shell" into main Treehugger Robot
2024-12-04Use WearBugreportWarningActivity from SystemUI in Shell yash
Bug:378047645 Flag: EXEMPT minor change Test: Verified manually that correct activity is launched in wear bugreport flow: https://screenshot.googleplex.com/43gvuNFZxByh73V, https://screenshot.googleplex.com/CwYuE65wJyjP2RJ Change-Id: I709886407f6e81d6011c9e4d5c39dc6492b44596
2024-12-04Accept a URI for bugreport and screenshot paths to be forwarded to ↵ Rana Mouawi
BugreportManager API. This is limited to bugreports of type wear. Bug: b/378481755 Test: Manually tested Shell can successfully create a BR and forward the result to WearServices Flag: com.android.shell.flags.handle_bugreports_for_wear Change-Id: Ic3cf472750389333f8befe9dc13adc187947aa90
2024-11-13Send broadcast when bugreport aborted due to error. Kunduz Baryktabasova
Flag: EXEMPT minor bugfix Test: manual test BUG=367625300 Change-Id: I876830e0cda3dce7660d15559637e671798d67be
2024-11-08Fix Java crash in Shell : java.lang.NoSuchMethodError Samer Naoura
Linked to http://pa/2991096 Bug: 376287630 Test: TBA (cherry picked from https://partner-android-review.googlesource.com/q/commit:20bfeeb927bcea163e9b58d66001b2269274c6a0) Flag: EXEMPT crash fix Change-Id: Idb056f8bad1c909afd1d4bff762010ff89c8d8f6
2024-10-24Merge "Fix ANR in Process com.android.shell after BR is finished" into main Yash
2024-10-23[Record Issue QS Tile] Allow Bug report flow to also have screen Stefan Andonian
recording metadata Bug: 372973430 Test: Verified that the whole flow worked fine locally. Flag: EXEMPT small update Change-Id: I794a4c1cfb972a9aa0f5a3165671f7bfbdcffda7
2024-10-22Fix ANR in Process com.android.shell after BR is finished Samer Naoura
Linked to http://pa/2964369 Bug: 360800881 Fix: 360800881 Test: Watch: https://screenshot.googleplex.com/4hYd3RTfdUXU5mG https://screenshot.googleplex.com/6L4YkmCYey8sHL5, Phone: https://screenshot.googleplex.com/3GWMVACFivfukc7 Flag: EXEMPT minor bugfix Change-Id: I99443f172cf43bde9c3637e91a3af51859eb6f35
2024-04-29Fix bugreport storage limit Kholoud Mohamed
We've now introduced a separate limit for deferred bugreports files (.tmp files). Fixes: 330177040 Test: atest com.android.shell.BugreportProgressServiceTest Test: atest android.bugreport.cts_root.BugreportManagerTest#testBugreportsLimitReached Change-Id: Ie4eb8235b17e93baac250bd7ae662b2ba6cca7a3
2024-04-04Allow SystemUI to trigger a bugreport and share with BetterBug from the ↵ Stefan Andonian
Record Issue QS Tile. On the UI side of things, I added a switch to allow users to choose between sharing traces directly, or via bugreport. Bug: 305049544 Test: Locally verified that this worked on my device. https://b.corp.google.com/issues/331268833#comment5 is an example of this working properly. Screenshot: https://photos.app.goo.gl/LmNFhuWLCPyEygDw6 Flag: ACONFIG record_issue_qs_tile DEVELOPMENT Change-Id: I01547162989b7f909fe849aa21ffbb604905dfab
2023-06-13Merge "ScreenCaptureListenerWrapper - hold weak ref" into udc-dev am: ↵ Patrick Williams
f6a5990dd1 am: 3a64e30fd0 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23590700 Change-Id: Ieb21483dfa57ef41f704d22b041b4278ad5fda58 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-12ScreenCaptureListenerWrapper - hold weak ref Patrick Williams
This change should reduce the amount of time taken by Java's garbage collection to free hardware buffers. Without this change, cleaning up hardware buffers via GC required: * A GC cycle to collect ScreenCaptureListener * NativeAllocationRegistry to clean up ScreenCaptureListenerWrapper (this can be tens of seconds) * A second GC cycle to collect the consumer ScreenCaptureListenerWrapper referenced and the hardware buffer the consumer referenced With this change, ScreenCaptureListenerWrapper no longer holds a global reference to the consumer allowing GC to clean up unreferenced consumers immediately. The change also includes a small refactor of the interface used to create synchronous ScreenCaptureListeners. Bug: 283813337 Test: presumbits Change-Id: I318d73d6cbf2210db5e4386ab57e4ce3a3629166
2023-04-25Display WearBugreportWarningActivity on Wear after bugreport is done Yingzhe Li
Display WearBugreportWarningActivity as the bug report warning dialog after bugreport is done on Wear. WearBugreportWarningActivity is defined in ClockworkShell. Bug: 190226948 Test: manual test Take bugreport on Wear, verify that WearBugreportWarningActivity can be displayed when user choose to display warning dialog: screenshot.googleplex.com/4udFJuu6M9JmXE4, screenshot.googleplex.com/4GFT9G5EMHMkwVm also verify that no warning dialog will be displayed on future bugreports when user choose "Don't show again" from warning dialog https://screenshot.googleplex.com/BzyxTJ8siUTA6Xs (cherry picked from commit 0402d0b12d61f72ee8628b6ef9efad4e74e18fcd) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:470cbee933a650ec239f9300bdcbe95f8f3fe874) Merged-In: I81cfae4e79f0904b6ca18889fcca65b647c3db4b Change-Id: I81cfae4e79f0904b6ca18889fcca65b647c3db4b
2023-04-05Send ACTION_REMOTE_BUGREPORT_DISPATCH braodcast to the SYSTEM user Nikhil Kumar
Test: manually tested remote bug report flow on retail demo mode. Bug: 274543518 Change-Id: I67cf87abe8f8ae51222cc6aa774dc45478060888
2023-03-20Apply delivery group policies to CLOSE_SYSTEM_DIALOG broadcast. Sudheer Shanka
- The "set-defer-until-active" policy is applied so that the broadcast targeted to apps in the Cached state is deferred until they come out of that state. - The "deliver-most-recent" policy is applied so that if there are already pending broadcasts waiting to be delivered when a new broadcast is sent, the old ones are discarded. Bug: 271950524 Test: TH Change-Id: Iab6064cf1436e02dd3d46badeeb6ab8dd6198c69
2022-12-19Revert "Revert "Refactor Bug report flow to work for all ADMIN users"" Nikhil Kumar
This reverts commit 08e9422e84789774e41e0ae3531617b66da2703d and adds fix for b/262355071 Reason for revert: Adding fix for b/262355071 Refactored check in PendingReports.authorizeReportImpl to allow sameProfileGroup users to approve incident and bug reports. Change-Id: If074a230e912ae6c5cf9257836123f6b5995d340 Test: Tested manually able to take bugreports from the betterbug in work profile Bug: 262355071 Change-Id: Ib09851b9d991c809eb02a6d2fdfdbca2d03f5540
2022-12-13Revert "Refactor Bug report flow to work for all ADMIN users" Daniel Chapin
This reverts commit 4fe5d002a2e5bf342ae4ee10e780ff62aa713cf4. Reason for revert: DroidFood blocking bug: 262355071 Change-Id: I74ecd73b533d39f4737849105193ae731e2a782a
2022-12-06Refactor Bug report flow to work for all ADMIN users Nikhil Kumar
With the existing implementation only the primary user is allowed to take bug report and approve authorization for bug and inicdent reports to be taken. With hsum (Headlesss SYSTEM user mode) implementation primary user will always run in background. we need to refactor the bugreport flow so that it can be triggered by any admin user. The following components has been refactored to allow any ADMIN user to trigger the bugreport, see progress notification, pass user inputs in case of interactive bugreport and share the bugreport. Though the actual bugreport (dumpstate) will always run on user 0 only the user visible components and components responsible to trigger the bugreport and track progress ex- shell, any approved bundled app like betterbug will run on the current foreground admin user. 1. ActivityManagerService.requestBugReportWithDescription has been modified to send BUGREPORT_REQUESTED broadcast to the caller user. 2. BugReportManagerServiceImpl has been modified to enable any admin user to initiate the bug report. 3. BugReportProgressService has been modified to send BUGREPORT_FINISHED broadcast to the shell context user. 4. IncidentCompanionService and PendingReports has been modifed to let any admin user provide feedback and authorization for bug and inicdent reports to be taken. Bug: 256583570 Test: atest BugreportManagerTest Test: Manually tested that admin users are allowed to take bug report. Change-Id: Ib22775e7ad998369404cf15cdc220c9b4019b296
2022-09-22Replace screenshots using internal displayToken with new API Chavi Weingarten
In order to remove SurfaceControl.getInternalDisplayToken, we need to replace all usages of it. The primary use is for screen capturing since you could call directly into SF via ScreenCapture.captureDisplay if you had a display token. However, this isn't scalable with multi-display since you need to be explicity which display to capture. The change provides a new API into WMS to capture a display using the displayId. This is still a privilege call so only processes with READ_FRAME_BUFFER can use it. In most cases, the replacement for now is to use DEFAULT_DISPLAY, but they can be modified later to send the desired display. Test: power + volume down Test: assistant screencapture Test: SurfaceViewTests Bug: 242714168 Change-Id: I9b406b699d48ae34c6ffd91c34941f1580f38d28
2022-09-14Migrate screen capture code to ScreenCapture file Chavi Weingarten
Test: ScreenshotTests Bug: 242714168 Change-Id: I8061f1717cc4e293ee07672d6d415c2c36010ccd
2022-03-23Merge "Secure REMOTE_BUGREPORT_DISPATCH" into tm-dev am: a441d81b3a Rubin Xu
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17320104 Change-Id: I67dc59d95e36c64b6fe07b70cfdd5b0cdd4943ba
2022-03-22Secure REMOTE_BUGREPORT_DISPATCH Rubin Xu
In remote bugreport collection, Shell sends REMOTE_BUGREPORT_DISPATCH to DevicePolicyManagerService which in turn notifies Device Owners that a bug report is ready for collection. There existed a threat where a malicous user could spoof the REMOTE_BUGREPORT_DISPATCH broadcast via ADB to send a crafted bugreport to the Device Owner. Securing REMOTE_BUGREPORT_DISPATCH is not as easy as it appears: putting a permission on REMOTE_BUGREPORT_DISPATCH does not work since both the legitimate sender and the malicious user are UID_SHELL. Instead, we introduces a nonce which was sent from DPMS to Shell when bugreport is triggered, and DPM will only accept REMOTE_BUGREPORT_DISPATCH when a matching nonce is seen. Ignore-AOSP-First: security fix Bug: 171495100 Test: atest DeviceOwnerTest#testRemoteBugreportWithTwoUsers Test: atest DeviceOwnerTest#testAdminActionBookkeeping Test: atest BugreportManagerTest Change-Id: I7649b4f22b74647d152d76bb46d5ca70bfa3617d
2022-02-24remove redundant share intent for Wear bug report Abhijit Nukalapati
In ag/13068228, we amended the bug report functionality for Wear to include a share intent (ACTION_SEND_MULTIPLE) which would be sent once a bug report is complete. However, this intent is not required as Wear sends the bug report directly to WCS via TriggerBugReportService in ClockworkShell. TriggerBugReportService listens for the bug report finished action "com.android.internal.intent.action.BUGREPORT_FINISHED" and sends the bugreport files to WCS. A chooser activity is not launched on Wear. This issue surfaced due to a silent FileNotFoundException in the logs. This occurs because the bug report files are consumed and deleted by TriggerBugReportService in the standard Wear bug repot flow. By the time this share intent is read, the files no longer exist, leading to the exception. Most of the flow is illustrated in the following screenshot: https://screenshot.googleplex.com/8kjMkirzvPyFHg7 The changes here does two things: - remove code that introduced the share intent - remove redundant code after above change - add missing break statement BUG: 208822859 Change-Id: I38d1ee961caf2eead105acb9e84101eef45df9b0
2022-01-26Clean <plurals> in BugreportProgressService Calvin Pan
Bug: 199230228 Test: make Change-Id: I888c65c8819eb5443178ddfc2097d3519b89cefb
2022-01-11Merge "update bug report notification title" Josh Yang
2022-01-11Merge "Support adding System Traces to Wear Bugreports" Josh Yang
2021-11-24Share Wear bugreport right after it is taken Yeabkal Wubshit
In rvc-wear-dev, bugreports were not shared to phone until user tapped on the bugreport-complete notification. Now, we are sending bugreports to phones immediately after bugreport is taken. We still retain the bugreport-complete notification. The bugreport-complete notification will have an action button that leads the user to a bugreport-warning screen as long as the user has not opted out from seeing the warning. If the user chooses not to see that message again (which they can do in the warning screen), there will not be any action button on the bugreport-complete notification, and the user can just swipe to delete it. Refer to the look of the notification when no warning message is to be displayed (https://screenshot.googleplex.com/JStqotLwCaTXeL9) and when a warning message is to be displayed (https://screenshot.googleplex.com/AdGKWFqbky8Ad8s) Note: this change does NOT affect the functionality of the BugreportProgressService for any other device except Wear devices. Bug: 163083307 Test: the described feature tested with salmon running rvc-wear-dev Change-Id: If6890ef8cada60e454c9232d402bbdb8a1b0315e
2021-11-16update bug report notification title Abhijit Nukalapati
Since the existing notification style sets maxLines to 2, the title was being truncated and the percentage was thus not visible to the user. As recommended by UX, we are updating the string so that it is no longer truncated and the percentage text is visible. Screenshots: Before - https://screenshot.googleplex.com/9U6RKuMcnECQ3pV After - https://screenshot.googleplex.com/8U9NCJHhR5qkRCD BUG: 198747050 Change-Id: I2b94cc65e2b9c3af860dd35532e1060814f6a68e (cherry picked from commit 262e835016e340e5fd7b5eb00b7ac6579ca127ae)
2021-11-16Support adding System Traces to Wear Bugreports Yeabkal Wubshit
System Traces collected with the native System Tracing App (Traceur) are now added under a separate directory (systraces) for Wear bugreports. Note that this change is functionally no-op for non-Wear form-factors (changes only one log's wordings for non-Wear form-factors). Bug: 183239853 Test: manual Change-Id: Id6b9aa0d38a0d465b763ec86fb1192875379431c (cherry picked from commit 7111510c691ccf20baf372dab5cea2ac30ae0c23)
2021-10-13profcollect/betterbug integration with content uri Yi Kong
Test: manual Bug: 183487233 Bug: 194155753 Change-Id: I6bdec2d090126c53d3cf2fa9deece2441eeafd98
2021-05-12Don't allow non-system window overlays for bug report warnings. Varun Shah
Bug: 175614079 Test: test PoC app Change-Id: Ie4543c95a6b2d7de47360737b82a6dadde704053
2021-01-07Merge "Fix missing fields when parceling the BugreportInfo" am: 2042ea04aa ↵ Rhed Jao
am: 77d5168388 am: ffcba92063 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540911 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ifa5d63a7d7951bb9fcf337e859df786688ac2c6a
2021-01-07Merge "Fix missing fields when parceling the BugreportInfo" Rhed Jao
2021-01-07Fix missing fields when parceling the BugreportInfo Rhed Jao
Shell app exception resulted from two missing fields in BugreportInfo when it's parceling. Application ran into the duplicate logic to send notification and start foreground service then caused the exception. Bug: 176624074 Test: Request a bugreport; kill the com.android.shell; \ tap the share notification Change-Id: Ia80f5e77f5486addf9ea7822f566c3fd7d75f42a
2020-12-21Returns immediately if the bugreport file already exists Rhed Jao
There's a case that BugreportProgressService is invoked twice quickly, and both services create the same bugreport file name. The later one may delete current running bugreport file in its clean function, when it detects another bugreport is running. Bug: 174314124 Bug: 175287931 Test: atest BugreportReceiverTest Change-Id: I5e1802c5912f4414f1ad3b8bdaf7c7420332b9d6 Merged-In: I5e1802c5912f4414f1ad3b8bdaf7c7420332b9d6
2020-12-21Fixes an error handling in BugreportProgressService Rhed Jao
Calls onError function when bugreport is finished and file is empty. Bug: 174314124 Bug: 175287931 Test: atest BugreportReceiverTest Change-Id: I4542568fd2d2ad1c75c7c3b223accca4995938a3 Merged-In: I4542568fd2d2ad1c75c7c3b223accca4995938a3
2020-12-21Fix BugreportReceiverTest Rhed Jao
- Implements a local binder and #onBind in the service to return the service instance. - Mocks BugreportManager in the service to avoid service interacting with the dumpstate. - Fixes dialog name field did not disable after service is finished. - Fixes screenshot did not remove if the name is empty. - Extends screenshot delay timeout in tests. - Fine tune the UiBot to fit new bugreport notification. - Removes obsolete cases in the tests. Bug: 143130523 Bug: 175287931 Test: atest BugreportReceiverTest Change-Id: Iae89206da1d08a10891503869bbbf1ce18d4e31f Merged-In: Iae89206da1d08a10891503869bbbf1ce18d4e31f
2020-12-21Do not buzzing for each progress of bugreport notification Rhed Jao
Only alert bugreport notification at the begining and end. Bug: 146135200 Bug: 175287931 Test: Manually changing the notification settings to default from silent. Change-Id: Ie955266ad8a7a27a9dc74743e276b5e9c7a2d6fb Merged-In: Ie955266ad8a7a27a9dc74743e276b5e9c7a2d6fb
2020-12-10Returns immediately if the bugreport file already exists Rhed Jao
There's a case that BugreportProgressService is invoked twice quickly, and both services create the same bugreport file name. The later one may delete current running bugreport file in its clean function, when it detects another bugreport is running. Bug: 174314124 Test: atest BugreportReceiverTest Change-Id: I5e1802c5912f4414f1ad3b8bdaf7c7420332b9d6
2020-12-10Fixes an error handling in BugreportProgressService Rhed Jao
Calls onError function when bugreport is finished and file is empty. Bug: 174314124 Test: atest BugreportReceiverTest Change-Id: I4542568fd2d2ad1c75c7c3b223accca4995938a3
2020-11-23Replace broadcast with adding a method in BugreportCallback Paul Chang
BUG: 154298410 Test: BetterBug can work normally in bug report shortcut flow Change-Id: Ibc1a5a8ac308c303399d28eb8c177096b805fdf9 Merged-In: Ibc1a5a8ac308c303399d28eb8c177096b805fdf9 (cherry picked from commit ec91d7700d9316ba09d639ab55ce94fb72d0f8ec)
2020-11-14Replace broadcast with adding a method in BugreportCallback Paul Chang
BUG: 154298410 Test: BetterBug can work normally in bug report shortcut flow Change-Id: Ibc1a5a8ac308c303399d28eb8c177096b805fdf9
2020-11-11Add FLAG_IMMUTABLE to heap dump notification PendingIntent. Kweku Adams
Bug: 171987666 Test: Android builds Change-Id: I0be6f837e7948db8d7a50c5ef6497aeb1854acde
2020-10-28Add immutability flag to PendingIntents Gavin Corkery
Explicitly set FLAG_IMMUTABLE for all PendingIntents in BugreportProgressService. Test: Builds Bug: 170165227 Bug: 171830604 Change-Id: Iae1489b9c8fa323448e60615e99ad96aee1cd1d7