• Home
  • History
  • Annotate
  • only in /frameworks/base/packages/Shell/src/
History log of /frameworks/base/packages/Shell/src/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
86805aa3afb5b08e916da424d0daf05149fae7ee 29-Aug-2016 Ben Lin <linben@google.com> Push delete notification when Bug reports are deleted.

Bug: 28768706
Change-Id: I6d3e91fe7d12be44918f97cef12c99d936401270
om/android/shell/BugreportStorageProvider.java
6dd4e88210e80a61ded2b2764aff0a3cee614d3c 03-Aug-2016 Felipe Leme <felipeal@google.com> Fixed year on copyright notice.

BUG: 30429392
Change-Id: If6477ccde5820dd118ad92bb5d4f74d938cf0d83
om/android/shell/Screenshooter.java
aba9743643d85e9bf5627da9d1fdc8ded25f22de 29-Jul-2016 Felipe Leme <felipeal@google.com> Use SurfaceControl.screenshot() instead of screencap for screenshots.

Change-Id: I5a9e7bbc5f3ae176ac5ae7209a133526992e92d4
Fixes: 30429392
om/android/shell/BugreportProgressService.java
om/android/shell/Screenshooter.java
9f3554176019543e654be7dba5410de2bbe3b55f 13-Jul-2016 Wei Liu <luciferleo@google.com> Use the Shell app to show the bugreport notification on Wear.

b/30041885

Change-Id: I998aa1606eb12f74a407fbafd9abc11c9454fb66
om/android/shell/BugreportProgressService.java
c6905cfb1133627dfd500491c60b6528a3e593e0 17-May-2016 Ben Lin <linben@google.com> Register change Uri and notify changes in bugreportServices.

Bug: 28767380
Change-Id: Ia4d1f5a2e44881d300f2869c628d4990406caf40
(cherry picked from commit 6c9ff513c6d7d3de7ab8920d88111c2b1dc1bb1f)
(cherry picked from commit 93fafd67a6127a35ba9b7a0f7de3a0b54309d4c2)
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportStorageProvider.java
53a528bb4f4cdb5a8d07b0d91405fdb2edb62201 27-Apr-2016 Steve McKay <smckay@google.com> Add archive support to Bug report docs provider.

Bug: 28386918
Change-Id: I2270324be3f020d73a68151002f885f70eb1449c
om/android/shell/BugreportStorageProvider.java
af096719c0e45a2b7d67e9267b40cffdc16f441a 25-Apr-2016 Felipe Leme <felipeal@google.com> Don't opt-out of warning dialog by default on user builds.

BUG: 28341946
Change-Id: I9ce6bf52a02a14055d4ded41aac50c79abdb4ee9
om/android/shell/BugreportWarningActivity.java
45a905bbafcbcbf89933e9b9226977995bae1afa 22-Apr-2016 Felipe Leme <felipeal@google.com> Show a toast when details cannot be added to zip file.

BUG: 28291423
Change-Id: I7febf66ef23f38b41fb1909324ee2260444518f6
om/android/shell/BugreportProgressService.java
69c53e65b941235a8d2e193d5b9a783f7787af0d 15-Apr-2016 Felipe Leme <felipeal@google.com> Set BugreportProgressService to run on foreground.

BugreportProgressService do not persist the user-provided
information (like details and screenshot paths), so if it's killed by
the framework, that info is lost.

Running it as foreground mitigates the changes of it being killed.

BUG: 27431998
BUG: 28291423
Change-Id: I2f58507beb38309628f2f19d3f7f950d07eca16f
om/android/shell/BugreportProgressService.java
03046888822d07ec020eb7a2f685be4f7bcded31 20-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Only try to add details to zip once." into nyc-dev
51a4ede593b1bba96d7cc14fca54e8e5f02850e0 20-Apr-2016 Felipe Leme <felipeal@google.com> Only try to add details to zip once.

When the user enters details (title or description) to the bugreport,
Shell tries to add a title.txt (and/or description.txt) to the zip and
uses 2 instance variables (addedDetailsToZip and addingDetailsToZip) to
control its state.

The problem with the current approach is that if there is a failure
adding the entries (for example, if the entries already exist), these
variables are not updated and hence when the user taps Share, it will
try to add the entries again, which most likely would fail.

BUG: 28291423
Change-Id: I56a71256be4f8de15f8126b815334277319e8e8a
om/android/shell/BugreportProgressService.java
65a9c6760ef6cf1c8e1762a271aa43c626d27048 19-Apr-2016 Felipe Leme <felipeal@google.com> Show "Android System" instead of "Shell" on notifications.

BUG: 26517701
Change-Id: If2543b8db0fdd913365df6f69cf26146d32d4b15
om/android/shell/BugreportProgressService.java
079f89614c49364bb907783b008827fbc306dd73 18-Apr-2016 Felipe Leme <felipeal@google.com> Remove initial screenshot on interactive bugreport.

One of the changes in the 'interactive bugreport' bugreport workflow
introduced on N is that the initial screenshot was taken right away (by
Shell, not dumpstate).

Unfortunately, such initial screenshot is often delayed when the system
is overload. Also, if the user is not interested in a screenshot, it
would be adding more load on the system unnecessarily.

Given these issues, and the fact that the user can still easily take an
initial screenhsot by selecting the proper notification action, the
initial screenshot is being removed.

BUG: 28167977

Change-Id: I2cf6616ce3124102b62ec9a36dc5a0ce6455a909
om/android/shell/BugreportProgressService.java
7fd1cbd49d0ace00c65229f65252136902aedaf3 13-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert warning logic so it has a "don't show again" message." into nyc-dev
fcca68dfb137c061952d23e1873e995e6bcf172d 12-Apr-2016 Felipe Leme <felipeal@google.com> Revert warning logic so it has a "don't show again" message.

BUG: 28140003

Change-Id: I93e7b1494a0f4c5ca080fbe9dd94dc2168092ffa
om/android/shell/BugreportPrefs.java
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportWarningActivity.java
a43d139359346ad57604e8335d92de57f3d47171 13-Apr-2016 Felipe Leme <felipeal@google.com> Removed redundant notification title.

When a bugreport is finished with a pending notification, it already
display a subtext explaining the situation - not only the extra title is
redundant, but it's too large.

BUG: 27583025
Change-Id: I8d8171faf7b8b86b34f6d860555839918be10550
om/android/shell/BugreportProgressService.java
e1b1ce77da273da6fc89d04a9c8ec09d0d8adca1 12-Apr-2016 Felipe Leme <felipeal@google.com> Merge "Minor improvements useful for debugging." into nyc-dev
bc3b0458bf4281a92f65dc98d87ad6ff40c92f98 06-Apr-2016 Selim Cinek <cinek@google.com> Fixed the contentinfo api usage in the bugreport

Removed the percentage shown in the header and
migrated the name to the subtext as contentinfo
was deprecated.

Change-Id: Ifd79a67cad8958049bd29b8eb4c9bcbb4822688b
om/android/shell/BugreportProgressService.java
abeab723d10b56302b86b1929ea994cf4a861fd0 04-Apr-2016 Felipe Leme <felipeal@google.com> Minor improvements useful for debugging.

- Better dump of received intents by displayed the relevant extras.
- Gracefully handles the case where the bugreport file URI is invalid
during development.

BUG: 27996121
Change-Id: I97a48d1e9641142a43c66c1dded2f7f322dc66aa
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
774cc932fc29705c9580775abf7c1e7a80c2bbe3 31-Mar-2016 Aga Wronska <agawronska@google.com> Add menu option to show/hide internal storage.

This reverts commit 7c4395804e450533afb553ab992c47f737da8a9b.

Bug: 27683276
Change-Id: Id1a310b57ab7fa3c8c14b464786473f211eaf41f
om/android/shell/BugreportStorageProvider.java
f8cf39563614026f47437253317aad4025c9ae9d 28-Mar-2016 Felipe Leme <felipeal@google.com> Removed FLAG_ADVANCED.

On M, internal storage such as bugreport files were only shown when user
selected the "Show internal storage", but such UI has changed on N.

BUG: 27862860
Change-Id: I1edf086a9f9345303595ee952e4646764709d36d
om/android/shell/BugreportStorageProvider.java
1ae5a69bc495154d0baf504caa95d7eddbc7177c 23-Mar-2016 Felipe Leme <felipeal@google.com> Proper handle of duplicated BUGREPORT_STARTED.

When Shell receives a BUGREPORT_STARTED intent for a process it's
already monitoring, it should completely ignore it, but current it's
taking an extra screenshot.

BUG: 27804637
Change-Id: I733cacfee5e9c82646a3295b50c3856b6e0352c3
om/android/shell/BugreportProgressService.java
9545d8e3377e73eb7d781360910b733760d3b0fb 22-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Changed logic when dumpstate's max progress increases." into nyc-dev
3fc44b9a6274254e8d3a53b6b1e245c5f9177229 22-Mar-2016 Felipe Leme <felipeal@google.com> Changed logic when dumpstate's max progress increases.

When dumpstate starts, it estimates its maximum duration and sends it
through an extra on BUGREPORT_STARTED; as it progress, it sets a system
property with its current progress and if the progress value overflows
the estimated max, it increases the max as well.

Shell uses the max/progress to display the progress % in the
system notification, and need to handle the scenario where the max
changes. The initial implementation would recalculate the progress, with
makes it swing back and forth as dumpstate increases the max.

This CL changes the Shell logic so the progress never go back, just
forward. The drawback of this approach is that if dumpstate
underestimate the maximum, the progress might get stuck in a high
value (99%) early on, but such issue will be addressed in the long
term by tuning the estimated max value.

BUG: 26354314
Change-Id: I3a5416acaffaaa43fd28d2f1f8ec8ea12aa0d91e
om/android/shell/BugreportProgressService.java
1719b3555dc9bff5394045585051e7d5684bceb1 21-Mar-2016 Aga Wronska <agawronska@google.com> Add config flag to show/hide internal storage.
Hide internal storage by default.

Revert "Always show intern storage."

This reverts commit 7c4395804e450533afb553ab992c47f737da8a9b.

Bug: 27683276

Change-Id: I04ea8b9a307babcea003f9bec200d41265a42c7f
om/android/shell/BugreportStorageProvider.java
f3a65fd31798f8c7ecfa0f3db292d115c10c3dbc 16-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Minor UI improvements and code cleanup:" into nyc-dev
1f7659ba3421fa391af24ccd5c2e9823a9b6cb95 15-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Log received intent." into nyc-dev
39355fb5f71e42bb71e10c940ae543826743d567 15-Mar-2016 Felipe Leme <felipeal@google.com> Log received intent.

BUG: 27660862
Change-Id: Ibe49080c15448ac2672f5e1d5eeaf6d9ff8d282e
om/android/shell/BugreportReceiver.java
213e355c77993c718298c89bc04908a0d6c5addd 15-Mar-2016 Felipe Leme <felipeal@google.com> Handle AccountManager failures so Shell doesn't crash.

BUG: 27665208
Change-Id: Iccb6ce810c8e1c93bded58871d7ec220b7d14ba9
om/android/shell/BugreportProgressService.java
208b1881ae924cd0c2bed326555e4aa18424d927 15-Mar-2016 Felipe Leme <felipeal@google.com> Minor UI improvements and code cleanup:

- 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
om/android/shell/BugreportProgressService.java
bded63d9c9a01c73d3f41d5883b24b93a4816e41 12-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Don't log metrics for initial screenshot." into nyc-dev
52ca701cd4e1363d562b0f418d45b3420e207a6b 11-Mar-2016 Felipe Leme <felipeal@google.com> Don't log metrics for initial screenshot.

BUG: 26759986
Change-Id: Ie1ff6626bb3174efa12c7cefe14782f4c18fb6d2
om/android/shell/BugreportProgressService.java
010859739552709ae2f0e51472bf5a650967280e 09-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Warn user when bugreport is finished but screenshot is pending." into nyc-dev
509d407e308079e562663608473fc7ee9c009382 09-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Vibrate after a screenshot is taken, not before." into nyc-dev
5ee846dd18022307341c9808c9aacded2b2f60fd 09-Mar-2016 Felipe Leme <felipeal@google.com> Warn user when bugreport is finished but screenshot is pending.

BUG: 27524556
Change-Id: Iaecdd01605dc4b01cdf669baf443eaee7fb20f6f
om/android/shell/BugreportProgressService.java
aa00f2d909dcc48b61b9338cd2ab7c33850a69d9 09-Mar-2016 Felipe Leme <felipeal@google.com> Vibrate after a screenshot is taken, not before.

BUG: 27389320
Change-Id: I383b4252a80ae2f1d820a97b9deb930dccf50313
om/android/shell/BugreportProgressService.java
d06e5afd6fef030e731d6c92166dbff70844f88f 08-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Minor improvements on BugreportProgressService:" into nyc-dev
4f663f6c25488a83a438a01dfef8372aa4e6b2aa 08-Mar-2016 Felipe Leme <felipeal@google.com> Minor improvements on BugreportProgressService:

- Removed unnecessary ContextWrapper used to get files dir.
- Immproved logging.

BUG: 27548183
BUG: 27524556
Change-Id: Ia04c6b7640969e0013ae282efbb1142fc0fc5695
om/android/shell/BugreportProgressService.java
0f2daaf2f7f0f9a35512e452231fd34e743ddc51 08-Mar-2016 Felipe Leme <felipeal@google.com> Call stopSelfWhenDone() *after* canceling the notification.

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
om/android/shell/BugreportProgressService.java
2552f8aec44d03aa001759a0376c25411ec62c28 04-Mar-2016 Michal Karpinski <mkarpinski@google.com> Do not re-define remote bugreport constants defined in DevicePolicyManager

Bug: 26226230
Change-Id: Ib26d8ba872b1ebdf24b43312daa1d04b90a7f393
om/android/shell/BugreportProgressService.java
om/android/shell/RemoteBugreportReceiver.java
7c4395804e450533afb553ab992c47f737da8a9b 02-Mar-2016 Steve McKay <smckay@google.com> Always show intern storage.

Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
om/android/shell/BugreportStorageProvider.java
bbd91e58444f092e1080f5a0a746fcd4b21ce113 27-Feb-2016 Felipe Leme <felipeal@google.com> Make bugreport details dialog confirm to Material Guidelines for Dialogs.

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
om/android/shell/BugreportProgressService.java
1e33af88edf3109bc8e6484c5f66e259a247cd01 26-Feb-2016 Felipe Leme <felipeal@google.com> Merge "Open bugreport info when touching notification (as well as DETAILS button)." into nyc-dev
db31363aa9670dbbc5837af7a04bdd8012493fd7 26-Feb-2016 Felipe Leme <felipeal@google.com> Open bugreport info when touching notification (as well as DETAILS button).

Also added test case for CANCEL button on system notification.

BUG: 26906985
Change-Id: I92eac2e5ec18a8d1d4412f5c1832a52705caf3b3
om/android/shell/BugreportProgressService.java
17fc60e13c2a3b78c0f613d46355e23664fd69f3 26-Feb-2016 Felipe Leme <felipeal@google.com> Merge "Using Message.obtain() to decrease number of Messages allocated." into nyc-dev
8648a15406d43c8af12e9cfe2355b1eee201d479 26-Feb-2016 Felipe Leme <felipeal@google.com> Using Message.obtain() to decrease number of Messages allocated.

BUG: 26906985
Change-Id: Ide8c6e308dcc83e9627ec775a4d977d17cd2f0a9
om/android/shell/BugreportProgressService.java
5d9000aa45c19de0e7ec4131c1aca3d366e9a793 25-Feb-2016 Felipe Leme <felipeal@google.com> Removed toast messsage sent after screenshot is taken.

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
om/android/shell/BugreportProgressService.java
262887834c7938b7a7bbbd7ef026b5965d6412fc 25-Feb-2016 Felipe Leme <felipeal@google.com> Reset UI fields when dialog is reused, otherwise it might contain fields
from a previous bug report.

BUG: 26524513
Change-Id: If9d176806b28120b57dddeb62b636065f8ff7cf6
om/android/shell/BugreportProgressService.java
85ae3cf46ad66d71e5a29a93e89a0f569d74288b 25-Feb-2016 Felipe Leme <felipeal@google.com> Final (?) fixes on id / pid split.

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
om/android/shell/BugreportProgressService.java
510e922e47fec69839dd48c5473540f93d79a508 23-Feb-2016 Felipe Leme <felipeal@google.com> Created counter (tron_varz_dumpstate_duration) for dumpstate duration.

BUG: 26759986
Change-Id: I18534c127b35776a03e31b9d5cd190d864dff9e6
om/android/shell/BugreportProgressService.java
6605bd89c53494b59717a826f9a17641bc32da41 23-Feb-2016 Felipe Leme <felipeal@google.com> Initial implementation of logging metrics for bugreport.

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
om/android/shell/BugreportProgressService.java
f58179a24b4de90d0d1a5601530f7c19a57405f6 17-Feb-2016 Michal Karpinski <mkarpinski@google.com> Merge "Be less aggressive in removing old remote bugreport files" into nyc-dev
a57f0e6b14754aa39e8454d82b9fa08e3f2b53a5 17-Feb-2016 Michal Karpinski <mkarpinski@google.com> Be less aggressive in removing old remote bugreport files

Always keep all the files of the remote bugreport
operation and keep them for at least a day.

Bug: 27215341
Change-Id: I514956004bf982e868a87b39c705d7c4a4a7b001
om/android/shell/RemoteBugreportReceiver.java
1eee1996f5d57b42d4beed2790321480fbe03a4c 16-Feb-2016 Felipe Leme <felipeal@google.com> Cancel notifications when user tap on Details or Take Screenshot after
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
om/android/shell/BugreportProgressService.java
fd8ea077c0ded14002c32ee346df4fa22a30625a 09-Feb-2016 Felipe Leme <felipeal@google.com> Split bugreport identifier into id and pid.

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
om/android/shell/BugreportProgressService.java
e86b63bd17da3d347b9392f897e361919655edd6 08-Feb-2016 Felipe Leme <felipeal@google.com> Add pid on main bugreport notifications.

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
om/android/shell/BugreportProgressService.java
af6fd4086c8f24e8b70a810fe83081b67e5db236 30-Jan-2016 Felipe Leme <felipeal@google.com> Added extra sanity checks.

BUG: 26795255
BUG: 26805503
Change-Id: Ib95b337e54a174f178f70205f9d108223f192a62
om/android/shell/BugreportProgressService.java
c8e2b6092c0fbf87e71f81fd2cffbb29ff8d9039 29-Jan-2016 Felipe Leme <felipeal@google.com> Fixed check for empty title.

Otherwise, if user entered "Details" but not "Summary", the
ACTION_SEND_MULTIPLE subject would be empty.

BUG: 26768595
Change-Id: I955ab5e8f05eba9fbfa6fe65eabb6a8a8e28c5b4
om/android/shell/BugreportProgressService.java
18b5892950b7f21e66c9268129323cbc0e865699 29-Jan-2016 Felipe Leme <felipeal@google.com> Added entries to zip file before sending the share notification.

BUG: 26616935
Change-Id: I072d57456b2090c7c5e75eea7834d3cdce44ed4a
om/android/shell/BugreportProgressService.java
2758d5d93970f26867d778c944605371e55b751e 19-Jan-2016 Felipe Leme <felipeal@google.com> Updates notification while bugreport zip is being changed.

BUG: 26616935

Change-Id: I3bcbaf30621c23541f2c568355948b6faa578e06
om/android/shell/BugreportProgressService.java
b9d598c47b69406174b015ec9f064448e4b3b8b5 19-Jan-2016 Felipe Leme <felipeal@google.com> Skip zip regeneration when user didn't provide extra info.

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
om/android/shell/BugreportProgressService.java
c4f6467702e308844ef0769ba17dcb7b7b32a9e6 13-Jan-2016 Felipe Leme <felipeal@google.com> Save bugreport info on share intent.

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
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
226940ed8550c02875a987f7e46699e6003ec1c0 15-Dec-2015 Michal Karpinski <mkarpinski@google.com> Modifying Shell to accomodate remote bugreports

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
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
om/android/shell/RemoteBugreportReceiver.java
4967f737d9906e3d5c9bf3a0584a7b7cf83b5a8c 06-Jan-2016 Felipe Leme <felipeal@google.com> Include title and description on bugreport.zip

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
om/android/shell/BugreportProgressService.java
2288129d5208cd26ab41191db69a418d15ead9ee 06-Jan-2016 Felipe Leme <felipeal@google.com> Fixed corner-case scenario where a screenshot is finished after the share
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
om/android/shell/BugreportProgressService.java
d1e0f12979441733753b538611f6d73e5527c43c 19-Dec-2015 Felipe Leme <felipeal@google.com> Handle bugreport screenshots on Shell.

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
om/android/shell/BugreportProgressService.java
bc73ffc06fd2b5b30802cc7e8874a986626b897d 12-Dec-2015 Felipe Leme <felipeal@google.com> Allows users to add details about a bugreport in progress.

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
om/android/shell/BugreportProgressService.java
a5d3cfa9837e63486ed63ef7ad76b5bcac565f1e 11-Dec-2015 Felipe Leme <felipeal@google.com> Merge "Unhardcoded file paths."
a0bf0336f0b6ff39cd90aabe0eb48b022d008ed6 11-Dec-2015 Felipe Leme <felipeal@google.com> Unhardcoded file paths.

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
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
46d47911ea8bbbe0b8d7a6029b80da6b1eb94393 09-Dec-2015 Felipe Leme <felipeal@google.com> Refactored what happens when a BUGREPORT_FINISHED is received.

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
om/android/shell/BugreportProgressService.java
4cc863338d5e43b6189e05498d7cb53ebba135e1 05-Dec-2015 Felipe Leme <felipeal@google.com> Changed ActivityManager.requestBugreport() to take a 'progress' parameter.

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
om/android/shell/BugreportProgressService.java
923afa9fe1bbc9a5395309622e596ad03c3d8481 04-Dec-2015 Felipe Leme <felipeal@google.com> Refactoring: pulled ServiceHandler methods to its parent class.

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
om/android/shell/BugreportProgressService.java
719aaae3c167c2b15525dbe5c7db514a2c0c8269 01-Dec-2015 Felipe Leme <felipeal@google.com> Changed workflow so max progress can be dynamically updated.

BUG: 25794470
Change-Id: I75dfdabf9febf54f2fb714441d48b339f8d3d293
om/android/shell/BugreportProgressService.java
9cadb75714bea7d435f34c8b7d06f698fa907a8d 30-Nov-2015 Felipe Leme <felipeal@google.com> Adds a notification action to cancel a bugreport in progress.

BUG: 25794470
Change-Id: I6f9c58fa7257f0826ab77007562cbff7db3e4cf0
om/android/shell/BugreportProgressService.java
69c0292affe8be51e10afb2dbf58f0133918a2c3 25-Nov-2015 Felipe Leme <felipeal@google.com> Created a new bug report workflow so user can keep track of its progress.

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
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
b9238b37838d653c38ce4e712421adb61978fc22 25-Nov-2015 Felipe Leme <felipeal@google.com> Refactored the BUGREPORT_RECEIVED logic into a new service.

Although this Change doesn't modify the workflow logic itself, it paves
the way for upcoming changes where the overall bug report progress will
be monitored by this service.

BUG: 25794470
Change-Id: Id0c867b04b595b5d31d11531405408f3423dd68b
om/android/shell/BugreportProgressService.java
om/android/shell/BugreportReceiver.java
e53e85f6051d20cbd477bc25d446a41996411fab 18-Nov-2015 Felipe Leme <felipeal@google.com> Initial integration test for BugReportReceiver.

These tests rely in the UI Automator to interact with the UI and
follow the workflow below:

* creates the bug report files
* generates the BUGREPORT_FINISHED intent
* emulate user actions to share the intent with a custom activity
* asserts the extras received by the custom activity

It still have some limitations, like requiring the phone to be unlocked
and having the bugreport warning already checked, and those will be
addressed in future CLs.

BUG: 25752530
Change-Id: I01d7fad9f94daf156b728cbb9ef228bbfa6ee0f5
om/android/shell/BugreportReceiver.java
3bf521a32e91a65cc00a9fb777bf74e40b51f6f1 18-Nov-2015 Felipe Leme <felipeal@google.com> Improves how cornercase scenarios are handled:

- Bug reports without screenshots are supported.
- Shows a toast message when the bugreport file cannot be read.

BUG: 25751868
Change-Id: I4ed2c47a89b373cf878720ebcba90c96bd51342b
om/android/shell/BugreportReceiver.java
a89c6e421ed837d4ae3a687b7cbe3bc9b8db4409 30-Oct-2015 Felipe Leme <felipeal@google.com> Added serial number in the bugreport message body.

Also labeled information contained in the body (i.e., Build Info: and Serial Number:).

BUG: 21454488

Change-Id: I5f2a62147ca3e1989aebfbd465f3e42b96b655df
om/android/shell/BugreportReceiver.java
96b11959563a2db83984c76838e5ca84ff2ea67a 29-Oct-2015 Felipe Leme <felipeal@google.com> Set ClipData with attachments URIs on bugreport notification.

The ACTION_SEND_MULTIPLE contract expects the EXTRA_TEXT to be an
ArrayList<String>, but it's currently set as String, which causes an
exception when exporting the EXTRA_STREAM as ClipData.

The right approach would be changing the EXTRA_TEXT content, but that
would break some clients like GMail, so a safer fix is to explicitly
set the ClipData.

Also removed unused variables and imports.

BUG: 21735884
BUG: 21729227

Changes to be committed:
modified: src/com/android/shell/BugreportReceiver.java

Change-Id: If9954e8cae4af7b74f077a32806f25eb7d55dffb
om/android/shell/BugreportReceiver.java
e28d7fc21c40eedcac35c7c00b6464fdf8e34b44 13-Jul-2015 Felipe Leme <felipeal@google.com> Set last modified timestamp for the bugreport entry in the zipped file from original file, otherwise it uses the date the zip was created.

BUG: 20447313
Change-Id: Iecbaf3ce2f0e3d82ac31a6c7bfbd8fb3037de5e4
om/android/shell/BugreportReceiver.java
c16a26a2b947d4cec0dd87d7b6bf266fd9918fbc 23-Jun-2015 Ian Pedowitz <ijpedowitz@google.com> Merge "Renaming bugreport.txt to bugreportFile.getName()" into mnc-dev
9fbee9ba98585382bc5f974a614d8949a362eb8b 19-Jun-2015 Wei Liu <luciferleo@google.com> resolved conflicts for merge of 1dac6bd9 to mnc-dev

Change-Id: I000b35f5e2658a065c780396254bcb88f1cbce5e
bd82c7d364ac9b38b4e6b22cfa9634185d04b836 18-Jun-2015 Ian Pedowitz <ijpedowitz@google.com> Renaming bugreport.txt to bugreportFile.getName()

Many times to file a bug, its necessary to take several bugreports and
attach them all to the same bug. With the current implementation, all
extracted files are bugreport.txt which makes it difficult to attach
several bugreports to the same bug, and reference them throughout the
bug uniquely.

Bug: 20447313
Change-Id: I22d2286d06c8dfb82273b5b98c48b21f77941b15
om/android/shell/BugreportReceiver.java
ae363d2db4398a695606c254b88be8940139edd1 13-Jun-2015 Wei Liu <luciferleo@google.com> Wear doesn't need Shell to send notification when bugreport captured.

b/19179040

Change-Id: Iec74e1e55adee16c8674f28a6e7d697499b85acf
om/android/shell/BugreportReceiver.java
00f4a6ecbca4a0286c7f283850e1af3c424818a0 16-Jun-2015 Felipe Leme <felipeal@google.com> Improved zipping logic so it zips chunks, instead of the whole file at once, to avoid OOM.

BUG: 20447313
Change-Id: I66f90cdd2a07288f9e37a38185f1583c57cf65c8
om/android/shell/BugreportReceiver.java
55beae09e57f987e23f8737d25c611a34fd7fc81 01-Jun-2015 Felipe Leme <felipeal@google.com> Changed BugReportReceiver to send zipped bugreports.

When BugReporterReceiver receives a android.permission.DUMP, it will handle the bugreport file (extra android.intent.extra.BUGREPORT) depending on its format:

- If it's a plain-text file (extension .txt), it will create a zip file with the plain-text report renamed as bugreport.txt.
- If there is an error creating the zip file, the plain-text bugreport will be sent instead.
- If it's not a plain-text file, it fill send the file as is (so if 'dumpstate' is later changed to generate a zipped file directly, nothing has to be done here).

Note that only the bugreport itself is included in the zip file, the screenshot is still sent separately (extra android.intent.extra.SCREENSHOT), so the receiver of the bugreport intent can display a screenshot thumbnail without unzipping the other file (which is useful when sending the bugreport through GMail, for example).

BUG: 20447313
BUG: 21868658
Change-Id: I3fa1e0c89190bfe6fa5c418f0f01ce1fb376f537
om/android/shell/BugreportReceiver.java
dd98034edce7ebbfefadf3f8a351c1b7ee7c2a73 17-Mar-2015 Ryo Hashimoto <hashimoto@google.com> Add BugreportStorageProvider

BugreportStorageProvider provides storage backend for bugreports.

BUG:18070208
Change-Id: I8506dd90d69907090295d99df7427fc747b83698
om/android/shell/BugreportStorageProvider.java
4a357cd2e55293402d7172766f7f9419815fc1e8 19-Mar-2015 Alan Viverette <alanv@google.com> Replace usages of deprecated Resources.getColor() and getColorStateList()

Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
om/android/shell/BugreportReceiver.java
e255e4e5365c56b9f49b74d8e3fae14b714cda5b 06-Oct-2014 Wei Liu <luciferleo@google.com> Hide bug report notification in Android Framework from watches.

Bug: 17806348
Change-Id: I1a90a9bc68d8ef4ff540dbbd9e4af4bfed8a61ae
om/android/shell/BugreportReceiver.java
255dd04271088590fedc46c8e22b2fd4ab142d39 19-Aug-2014 Selim Cinek <cinek@google.com> Added notification color to all system notifications

Bug: 17128331
Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb
om/android/shell/BugreportReceiver.java
e37e9ba3ca3aed4109eb75b2e9ac622a7322caca 20-Mar-2013 Jeff Sharkey <jsharkey@android.com> Show notification ticker for finished bugreports.

Change-Id: I7d326b0da83c3ae334739cdb8cb4ca18f948c50f
om/android/shell/BugreportReceiver.java
d9526907d1a51ef0b35bfbbeee43fa209d8b5bbf 14-Mar-2013 Jeff Sharkey <jsharkey@android.com> Move deleteOlderFiles() to framework, tests.

Supports both age and count based constraints. Added light docs and
tests to verify behavior.

Bug: 8387555
Change-Id: If4d0dac8bc54ce705c2a339bc09a60ea748728b8
om/android/shell/BugreportReceiver.java
02ffba940ca96988ed3e7774c606b43c58373b5e 09-Mar-2013 Jeff Sharkey <jsharkey@android.com> Handle finished bugreports, share from private.

Show notification when a bugreport is finished, letting the user
launch a SEND_MULTIPLE intent to share them. Add dialog that warns
user about contents before sharing. Since bugreports are now stored
in private app data of the Shell app, use FileProvider to build Uris
that we can grant others access to.

Define BUGREPORT_FINISHED as being a protected broadcast. Delete
older bugreports automatically to reclaim disk space. Migrate any
Intent extras to ClipData when building PendingIntents.

Add --receiver-permission support to am shell command.

Bug: 7005318
Change-Id: If6c607dbcf137362d5887eac482ff7391563890f
om/android/shell/BugreportPrefs.java
om/android/shell/BugreportReceiver.java
om/android/shell/BugreportWarningActivity.java