summaryrefslogtreecommitdiff
path: root/packages/Shell/src
AgeCommit message (Collapse)Author
2016-03-16Merge "Minor UI improvements and code cleanup:" into nyc-devFelipe Leme
2016-03-15Merge "Log received intent." into nyc-devFelipe Leme
2016-03-15Log received intent.Felipe Leme
BUG: 27660862 Change-Id: Ibe49080c15448ac2672f5e1d5eeaf6d9ff8d282e
2016-03-15Handle AccountManager failures so Shell doesn't crash.Felipe Leme
BUG: 27665208 Change-Id: Iccb6ce810c8e1c93bded58871d7ec220b7d14ba9
2016-03-14Minor UI improvements and code cleanup:Felipe Leme
- Removed initial selection of name field. - Set notification type as system. - Refactored some notification code. - Removed initial focus on details UI. BUG: 26906985 BUG: 27494227 Change-Id: I5aab95c06830da3850331a2dba09abae88cf59fc
2016-03-12Merge "Don't log metrics for initial screenshot." into nyc-devFelipe Leme
2016-03-11Don't log metrics for initial screenshot.Felipe Leme
BUG: 26759986 Change-Id: Ie1ff6626bb3174efa12c7cefe14782f4c18fb6d2
2016-03-09Merge "Warn user when bugreport is finished but screenshot is pending." into ↵Felipe Leme
nyc-dev
2016-03-09Merge "Vibrate after a screenshot is taken, not before." into nyc-devFelipe Leme
2016-03-09Warn user when bugreport is finished but screenshot is pending.Felipe Leme
BUG: 27524556 Change-Id: Iaecdd01605dc4b01cdf669baf443eaee7fb20f6f
2016-03-08Vibrate after a screenshot is taken, not before.Felipe Leme
BUG: 27389320 Change-Id: I383b4252a80ae2f1d820a97b9deb930dccf50313
2016-03-08Merge "Minor improvements on BugreportProgressService:" into nyc-devFelipe Leme
2016-03-08Minor improvements on BugreportProgressService:Felipe Leme
- Removed unnecessary ContextWrapper used to get files dir. - Immproved logging. BUG: 27548183 BUG: 27524556 Change-Id: Ia04c6b7640969e0013ae282efbb1142fc0fc5695
2016-03-08Call stopSelfWhenDone() *after* canceling the notification.Felipe Leme
When a bugreport is shared it's necessary to remove its system notification and stop the service if there is no more pending bugreports. Since the service will might be killed as a result, to call to cancel the notification must be done prior to calling stopSelf(). BUG: 27524556 Change-Id: Iae9a263b6cee0e4a0a7df3e52621e56b50983fec
2016-03-04Do not re-define remote bugreport constants defined in DevicePolicyManagerMichal Karpinski
Bug: 26226230 Change-Id: Ib26d8ba872b1ebdf24b43312daa1d04b90a7f393
2016-03-02Always show intern storage.Steve McKay
Only show debug root when devel mode is enabled. Remove all traces of "advanced". Bug: 27297398 Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-02-29Make bugreport details dialog confirm to Material Guidelines for Dialogs.Felipe Leme
Changes: - Removed hints. - Added TextViews for field labels. - Added padding for inner dialog - Adedd autoCorrect and capSentences to title and summary - Changed strings. - Set name to be selectAllOnFocus initially. Also improved some logging statements. BUG: 26324085 Change-Id: I32597a7c2839ca706dbbcf13660e976469ab8dd0
2016-02-26Merge "Open bugreport info when touching notification (as well as DETAILS ↵Felipe Leme
button)." into nyc-dev
2016-02-25Open bugreport info when touching notification (as well as DETAILS button).Felipe Leme
Also added test case for CANCEL button on system notification. BUG: 26906985 Change-Id: I92eac2e5ec18a8d1d4412f5c1832a52705caf3b3
2016-02-26Merge "Using Message.obtain() to decrease number of Messages allocated." ↵Felipe Leme
into nyc-dev
2016-02-25Using Message.obtain() to decrease number of Messages allocated.Felipe Leme
BUG: 26906985 Change-Id: Ide8c6e308dcc83e9627ec775a4d977d17cd2f0a9
2016-02-25Removed toast messsage sent after screenshot is taken.Felipe Leme
That toast was kind of reduntant (since the phone already vibrates before taking a screenshot) and often useless (because it was displayed seconds after requested). BUG: 26577203 Change-Id: I0ba6f974eefd473d158f7fefb12f6a5d2a50b772
2016-02-25Reset UI fields when dialog is reused, otherwise it might contain fieldsFelipe Leme
from a previous bug report. BUG: 26524513 Change-Id: If9d176806b28120b57dddeb62b636065f8ff7cf6
2016-02-25Final (?) fixes on id / pid split.Felipe Leme
The main goal of this CL was to change the test cases to send an EXTRA_ID instead of EXTRA_PID, but in changing that it was revealed 2 minor bugs: - When setting the name property, it was using id instead of pid (which is what dumpstate expects). - When the pid is replaced by the name in the screenshots, it would be replaced twice if the pid was small enough (because the call to String.replace() would also replace the counter). This CL fixes these issues, and removes the temporary assignment of id = pid when the former is missing. BUG: 27076108 Change-Id: I70e7ce7d145019438272594686ac0d4d5dbe1723
2016-02-23Created counter (tron_varz_dumpstate_duration) for dumpstate duration.Felipe Leme
BUG: 26759986 Change-Id: I18534c127b35776a03e31b9d5cd190d864dff9e6
2016-02-23Initial implementation of logging metrics for bugreport.Felipe Leme
This change logs the following user actions: - Interactive bug report initiated from power menu. - Full bug report initiated from power menu. - Bug report canceled using system notification. - Bug report details screen open using system notification. - Additional Bug report screen shot taken using system notification. - User changed bug report name using the details screen. - User changed bug report title using the details screen. - User changed bug report description using the details screen. - Changes made on bug report details screen were saved by user. - Changes made on bug report details screen were canceled by user. BUG: 26759986 Change-Id: I1aae98b87a4dea66a1030a024dd799b97c25dd6d
2016-02-17Merge "Be less aggressive in removing old remote bugreport files" into nyc-devMichal Karpinski
2016-02-17Be less aggressive in removing old remote bugreport filesMichal Karpinski
Always keep all the files of the remote bugreport operation and keep them for at least a day. Bug: 27215341 Change-Id: I514956004bf982e868a87b39c705d7c4a4a7b001
2016-02-16Cancel notifications when user tap on Details or Take Screenshot afterFelipe Leme
service died. There are scenarios when the user is running low on resources and it kills Shell after it start monitoring a dumpstate process, in which case the BugreportInfo is not available anymore when the user tap a notification action. We could add a mechanism to recover that info (like persistenting the user-provided values in a shared preference), but would incur in more costs when the device is already in a resource-constrained state, so it's better to just stop monitoring and switch back to the traditional model where the user is notified after the bugreport finishes (the drawback is that all user-provided information will be lost). Also improved how info.name is checked to avoid crash in similar cases. BUG: 27186542 BUG: 27203559 Change-Id: I57076b098a3fce493e1a27121b6e070366808668
2016-02-09Split bugreport identifier into id and pid.Felipe Leme
Although 'pid' is more useful when diagnosing problems with the bugreport workflow, it could be confusing to the end user. Hence, a sequential id (started at 1 after a reboot) would be more useful, and this CL changes Shell to accommodate such id (dumpstate will be changed separately). BUG: 27076108 Change-Id: I5c42dc49a100b43266787d4f79698a22a4e533a9
2016-02-08Add pid on main bugreport notifications.Felipe Leme
Showing the pid is useful in many cases, like when one bug report is finished and another one is in progress. BUG: 26906985 Change-Id: Ib8ae462c85246b99234f8dac63edb608d1eafeb0
2016-02-01Added extra sanity checks.Felipe Leme
BUG: 26795255 BUG: 26805503 Change-Id: Ib95b337e54a174f178f70205f9d108223f192a62
2016-01-29Fixed check for empty title.Felipe Leme
Otherwise, if user entered "Details" but not "Summary", the ACTION_SEND_MULTIPLE subject would be empty. BUG: 26768595 Change-Id: I955ab5e8f05eba9fbfa6fe65eabb6a8a8e28c5b4
2016-01-29Added entries to zip file before sending the share notification.Felipe Leme
BUG: 26616935 Change-Id: I072d57456b2090c7c5e75eea7834d3cdce44ed4a
2016-01-20Updates notification while bugreport zip is being changed.Felipe Leme
BUG: 26616935 Change-Id: I3bcbaf30621c23541f2c568355948b6faa578e06
2016-01-19Skip zip regeneration when user didn't provide extra info.Felipe Leme
If the user provides a title or description, it's necessary to create a new zip file with the contents of the old file plus the new entries, which takes time. Hence, if the user didn't provide more info (title or description), we should skip that step. BUG: 26616935 Change-Id: Ice14f88b5763d463d8db2f942e823797e80bfde9
2016-01-13Save bugreport info on share intent.Felipe Leme
When a bugreport is finished, BugreportProgressService sends a INTENT_BUGREPORT_SHARE intent containing the bugreport pid; then when the user clicks the share notification, BugreportProgressService uses the pid to retrieve the bugreport info. The problem with this approach is that if the service dies before the user clicks the notification, the bugreport won't be shared. This change fix this scenario by saving the bugreport info in the share intent. BUG: 26513652 Also added more logging statements. Change-Id: Iba86d06369f843ad88194fb1dad0c8b69764df78
2016-01-07Modifying Shell to accomodate remote bugreportsMichal Karpinski
After receiving android.intent.action.REMOTE_BUGREPORT_FINISHED in newly created RemoteBugreportReceiver, Shell will generate URI to the bugreport zip file and send the broadcast android.intent.action.REMOTE_BUGREPORT_DISPATCH. Bug: 26152603 Change-Id: I058d626e021b488c9347b45467a4e3505134e79c
2016-01-06Include title and description on bugreport.zipFelipe Leme
Prior to this change, the user-provide title and description were only used in the ACTION_SEND_MULTIPLE intent, which was fine for the cases where the user share the bug report with an app that used intent extras (like an email app). But if the app did not use the extras, or if the user did not share the bug report right away, the info supplied by the user would be lost. With this change, such info will be saved into 2 new zip entries, title.txt and description.txt BUG: 26403310 Change-Id: I888364d14d67fb4e2f2c26cb66b21576d7ce13b4
2016-01-06Fixed corner-case scenario where a screenshot is finished after the shareFelipe Leme
notification is sent. Prior to this change, if a screenshot finished after the share notification was sent, it would replace the share notification with a progress notification, and the share notification would never be sent again. Also improved the test cases that automatically generate a screenshot but don't use it to wait for the screenshot to finish before proceeding, otherwise it could cause a future test to fail (if the screenshot is finished after the initial test is completed). Change-Id: I6e2a6549ebb48e5bebf5aa78d1bda94404c1812b
2015-12-21Handle bugreport screenshots on Shell.Felipe Leme
Currently, the bugreport screenshots are taken by dumpstate and passed to Shell as a path on BUGREPORT_RECEIVED; this change not only delegates the screenshot taking to Shell, but also allows user to take more screenshots while the bugreport is being generated. As a result of this change, the final ACTION_SEND_MULTIPLE intent might contain multiple screenshot attachments, all of them named "screenshot-PREFIX-NUMBER.png", where PREFIX is the bugreport name (either initial date provided by dumpstate or a name entered by the user) and NUMBER is the sequential number of the screenshot as taken by the user. The screenshot is taken using screencap, which not only is simpler than using Framework APIs, but also faster and less intrusive. The only drawback is that it might fail if an OEM is not providing screencap; if that happens in the field, we'll need to add fallback option to do it using such APIs. Prior to this change, all work done on BugreportProgressService was executed in one single thread (through the ServiceHandler class) but the code was guarded by unnecessary synchronization. Now there is another thread (ScreenshotHandler) that will be used just for taking the screenshot (so it doesn't handle the main thread). Despite the addition of a new thread, the code was simplified to remove most synchronization locks, excepted for the areas touched by both threads. Once this change is submitted, the bugreport service will be changed so it does not ask dumpstate to take a screenshot. BUG: 26274653 Change-Id: I1df883e3c0ca6e3e3cad2522a6a99585f71abb75
2015-12-16Allows users to add details about a bugreport in progress.Felipe Leme
The "bugreport in progress" notification now have a "DETAILS" button that when clicked opens a dialog window displaying the following fields: - Name: short name for the bugreport, will be used as part of the final files (and by default is the timestamp sent by dumpstate) - Title: a 1-line title for the bugreport, will be used as the subject in the final message. - Description: a detailed description for the bug. The main advantage of such dialog is that it allows users to enter more info about a bugreport while it's being generated, rather then when the bugreport is finished (since of the user doesn't remember what the context was when the problem happened). BUG: 25794470 BUG: 10676443 Change-Id: I0d1dba2a94ad989e541415a2a59475619a2e3d13
2015-12-11Merge "Unhardcoded file paths."Felipe Leme
2015-12-11Unhardcoded file paths.Felipe Leme
Also added a sanity check when deleting old files to avoid a runtime exception in the AsyncTask when the file doesn't exist. BUG: 25752530 Change-Id: Ic4a118ae7cc5750cc96c2ac82f2c7dcc6a0cb506
2015-12-09Refactored what happens when a BUGREPORT_FINISHED is received.Felipe Leme
Previously on 24: when a BUGREPORT_FINISHED was received, BugreportProgressService would remove the watched BugreportInfo from its map and if there was no info left, it would stop self and send the SEND_MULTIPLE_ACTION intent. Soon we're going to allow the user to enter more details (like a title and description) for the bugreport, but if the service is stopped while the user is still entering data, that window will be killed. Hence, although this refactoring doesn't change the current logic, it paves the way for such new feature. BUG: 25794470 Change-Id: Ic5283ddc3e07d88ba2a9a925f9534426857e7606
2015-12-05Changed ActivityManager.requestBugreport() to take a 'progress' parameter.Felipe Leme
When progress is set to 'true', it calls the new, enhanced 'bugreportplus' service, while when 'false' it calls the regular 'bugreport' service. 'bugreportplus' is more user-friendly (it shows a system notification with the progress, allow user to cancel, etc...), at the cost of consuming more resources. As such, the "Take Bug Report" UI will be changed to offer the user a combo with these 2 options, but for now it's always going to be 'bugreportplus' BUG: 26034608 Change-Id: I21a6b5b092a85614e91d523b8f4df1fb00e49b3b
2015-12-04Refactoring: pulled ServiceHandler methods to its parent class.Felipe Leme
Now ServiceHandler only have 2 methods: - handleMessage(): part of its interface. - poll(): delegates work to parent, but sends a delayed message so it keeps polling. Also changed hardcoded "N/A" to a resource. BUG: 25794470 Change-Id: I486fff46c1532685bfd6f5903349d14e55059219
2015-12-04Changed workflow so max progress can be dynamically updated.Felipe Leme
BUG: 25794470 Change-Id: I75dfdabf9febf54f2fb714441d48b339f8d3d293
2015-12-02Adds a notification action to cancel a bugreport in progress.Felipe Leme
BUG: 25794470 Change-Id: I6f9c58fa7257f0826ab77007562cbff7db3e4cf0
2015-11-25Created a new bug report workflow so user can keep track of its progress.Felipe Leme
The old workflow was: 1. dumpstate starts. 2. When dumpstate finishes, it sends a BUGREPORT_FINISHED intent. 3. Shell's BugreportReceiver receives the BUGREPORT_FINISHED and issues a system notification so user can share the bug report. The new workflow is: 1. When dumpstate starts, it sends a BUGREPORT_STARTED with its pid and the estimated total effort. 2. When Shell's BugreportReceiver receives the BUGREPORT_STARTED, it: 2.1 Issues a system notification so user can watch the progresss (which is 0% initially). 2.2 Starts a service (BugreportProgressService) responsible for polling the dumpstate progress (using system properties and the pid) and updating the system notification. 3. As dumpstate progress, it updates the proper system property. 4. When dumpstate finishes, it sends a BUGREPORT_FINISHED event. 5. When Shell's BugreportReceiver receives the BUGREPORT_FINISHED, it: 5.1 Finishes the service if necessary. 5.2 Issues a system notification so user can share the bug report. This CL handles the Shell changes only, the dumpstate changes will be changed in a separate CL. BUG: 25794470 Change-Id: Icbd0b42dd48e8db376b60544348b6818c6374338