275 Commits

Author SHA1 Message Date
Geoff Mendal
1ddc11be55 Import translations. DO NOT MERGE
Change-Id: Id4836eb0d7454cbb028a40032ecd229e4a4d90d3
Auto-generated-cl: translation import
2016-03-02 07:20:37 -08:00
Felipe Leme
bbd91e5844 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
2016-02-29 16:46:54 -08:00
Felipe Leme
1e33af88ed Merge "Open bugreport info when touching notification (as well as DETAILS button)." into nyc-dev 2016-02-26 17:49:54 +00:00
Felipe Leme
db31363aa9 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
2016-02-25 17:09:46 -08:00
Felipe Leme
17fc60e13c Merge "Using Message.obtain() to decrease number of Messages allocated." into nyc-dev 2016-02-26 00:32:29 +00:00
Felipe Leme
8648a15406 Using Message.obtain() to decrease number of Messages allocated.
BUG: 26906985
Change-Id: Ide8c6e308dcc83e9627ec775a4d977d17cd2f0a9
2016-02-25 16:24:43 -08:00
Felipe Leme
5d9000aa45 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
2016-02-25 13:10:14 -08:00
Felipe Leme
262887834c Reset UI fields when dialog is reused, otherwise it might contain fields
from a previous bug report.

BUG: 26524513
Change-Id: If9d176806b28120b57dddeb62b636065f8ff7cf6
2016-02-25 12:10:43 -08:00
Felipe Leme
85ae3cf46a 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
2016-02-25 11:14:03 -08:00
Felipe Leme
510e922e47 Created counter (tron_varz_dumpstate_duration) for dumpstate duration.
BUG: 26759986
Change-Id: I18534c127b35776a03e31b9d5cd190d864dff9e6
2016-02-23 09:40:13 -08:00
Felipe Leme
6605bd89c5 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
2016-02-23 09:08:56 -08:00
Felipe Leme
6a05eee2bd Fixed permissions so Shell can call netpolicy methods.
BUG: 27127112
Change-Id: I5548aba70a1c25be139462fbabe9a854fa96d2a6
2016-02-19 17:47:46 -08:00
Michal Karpinski
f58179a24b Merge "Be less aggressive in removing old remote bugreport files" into nyc-dev 2016-02-17 17:18:19 +00:00
Felipe Leme
6cb955826b Merge "Cancel notifications when user tap on Details or Take Screenshot after service died." into nyc-dev 2016-02-17 16:11:16 +00:00
Geoff Mendal
878b249c90 Import translations. DO NOT MERGE
Change-Id: If833e6af6b9206411e02db9c081d410c4893d73e
Auto-generated-cl: translation import
2016-02-17 07:14:57 -08:00
Michal Karpinski
a57f0e6b14 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
2016-02-17 13:47:17 +00:00
Felipe Leme
1eee1996f5 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
2016-02-16 13:17:53 -08:00
Geoff Mendal
68e221ec0c Import translations. DO NOT MERGE
Change-Id: I5450d165959f42088148bf3aa9789d73137475bc
Auto-generated-cl: translation import
2016-02-15 07:19:37 -08:00
Felipe Leme
e2dd62ea5a Merge "Split bugreport identifier into id and pid." into nyc-dev 2016-02-12 00:40:40 +00:00
Geoff Mendal
b817910b14 Import translations. DO NOT MERGE
Change-Id: Iba4fcac2427bf5213b78626aefdbabf17131e652
Auto-generated-cl: translation import
2016-02-10 07:23:03 -08:00
Felipe Leme
fd8ea077c0 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
2016-02-09 10:18:23 -08:00
Felipe Leme
000b84451d Merge "Add pid on main bugreport notifications." into nyc-dev 2016-02-08 23:25:39 +00:00
Felipe Leme
ed330c7f7d Merge "Replaced 'touch' by 'tap'." into nyc-dev 2016-02-08 18:10:18 +00:00
Felipe Leme
8067aed5c7 Replaced 'touch' by 'tap'.
BUG: 26884266
Change-Id: Ic3d7be8a10b768101b161644e46c92cd872621db
2016-02-08 09:42:52 -08:00
Felipe Leme
e86b63bd17 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
2016-02-08 09:40:56 -08:00
Geoff Mendal
b727d99a5e Import translations. DO NOT MERGE
Change-Id: Ic6f472559385699038b2d8f5e63d2ed0d5752c4d
Auto-generated-cl: translation import
2016-02-08 22:52:34 +05:30
Felipe Leme
af6fd4086c Added extra sanity checks.
BUG: 26795255
BUG: 26805503
Change-Id: Ib95b337e54a174f178f70205f9d108223f192a62
2016-02-01 09:26:52 -08:00
Felipe Leme
c8e2b6092c 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
2016-01-29 14:05:31 -08:00
Felipe Leme
18b5892950 Added entries to zip file before sending the share notification.
BUG: 26616935
Change-Id: I072d57456b2090c7c5e75eea7834d3cdce44ed4a
2016-01-29 12:29:21 -08:00
Geoff Mendal
978a766274 Import translations. DO NOT MERGE
Change-Id: I8f61c185a1b79c10ec8e437401d82a44d28c4796
Auto-generated-cl: translation import
2016-01-27 05:41:07 -08:00
Felipe Leme
ec17538d46 Send broadcasts as foreground, otherwise test might fail when running
after reboot.

BUG: 26805230
Change-Id: I05dcf9871c9b4c4c9a465466d60ebe9a1ac63e51
2016-01-26 18:17:15 -08:00
Geoff Mendal
861a25200a Import translations. DO NOT MERGE
Change-Id: Ic795f08684fc10e54499e25b31f4a3db3cbec981
Auto-generated-cl: translation import
2016-01-25 05:43:23 -08:00
Felipe Leme
beda539051 Merge "Updates notification while bugreport zip is being changed." 2016-01-22 19:46:38 +00:00
Felipe Leme
2758d5d939 Updates notification while bugreport zip is being changed.
BUG: 26616935

Change-Id: I3bcbaf30621c23541f2c568355948b6faa578e06
2016-01-20 10:12:03 -08:00
Geoff Mendal
6f2fa50463 Import translations. DO NOT MERGE
Change-Id: Iaa55969cfb1d5ac3860e960ab7699cee38309259
Auto-generated-cl: translation import
2016-01-20 05:50:25 -08:00
Felipe Leme
97084b4bda Merge "Updated bugreport info strings to be consistent with its meaning." 2016-01-20 02:09:02 +00:00
Felipe Leme
da163bf56e Updated bugreport info strings to be consistent with its meaning.
Also removed DO NOT TRANSLATE from new bugreport strings whose phrasing
have been confirmed.

Change-Id: Ic0eafb6c007acd63f1d11f7a5043259533189df0
2016-01-19 17:41:44 -08:00
Felipe Leme
2ab08ed2cc Merge "Skip zip regeneration when user didn't provide extra info." 2016-01-19 19:26:59 +00:00
Felipe Leme
b9d598c47b 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
2016-01-19 10:42:17 -08:00
Geoff Mendal
78da55e200 Import translations. DO NOT MERGE
Change-Id: I577ab7113b9ad02f7556375115e7788a808efe24
Auto-generated-cl: translation import
2016-01-18 05:53:16 -08:00
Felipe Leme
c4f6467702 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
2016-01-13 13:01:07 -08:00
Michal Karpinski
226940ed85 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
2016-01-07 20:02:13 +00:00
Felipe Leme
4967f737d9 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
2016-01-06 14:53:53 -08:00
Felipe Leme
2288129d52 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
2016-01-06 10:14:36 -08:00
Geoff Mendal
f395bfd9f1 Import translations. DO NOT MERGE
Change-Id: I279881c50e7f1010a52f83b1ecb23477b8a8f44c
Auto-generated-cl: translation import
2015-12-28 05:48:01 -08:00
Geoff Mendal
7da42323ca Import translations. DO NOT MERGE
Change-Id: I7cf42c018cfec707dc5fc1e55716de2ed7f1cacf
Auto-generated-cl: translation import
2015-12-23 05:40:31 -08:00
Filip Gruszczynski
1ca4e549d9 Add a permission to shell for running multi window tests.
Bug: 19225708
Change-Id: Ia2de679b133acee992ccdab3bfddbdd9d78f5025
2015-12-22 09:22:34 -08:00
Felipe Leme
e3daf13a49 Merge "Handle bugreport screenshots on Shell." 2015-12-21 17:58:22 +00:00
Felipe Leme
d1e0f12979 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
2015-12-21 08:53:00 -08:00
Geoff Mendal
ff51290be5 Import translations. DO NOT MERGE
Change-Id: Iffacfe8c3bebd254f8fbddd71c2c3eab85d1628a
Auto-generated-cl: translation import
2015-12-21 05:45:54 -08:00