246 Commits

Author SHA1 Message Date
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
Felipe Leme
b1a523b458 Merge "Allows users to add details about a bugreport in progress." 2015-12-16 19:39:11 +00:00
Felipe Leme
bc73ffc06f 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
2015-12-16 11:36:04 -08:00
Geoff Mendal
6839593db5 Import translations. DO NOT MERGE
Change-Id: I310f81e9ec34340edf42d9f5c0c6161b75b861a8
Auto-generated-cl: translation import
2015-12-16 05:51:29 -08:00
Felipe Leme
2d76c84cf4 Merge "Fixed ActivityChooser logic for the initial case." 2015-12-14 03:34:10 +00:00
Felipe Leme
84c0aeffae Merge "Cleaned up unit tests." 2015-12-12 04:22:49 +00:00
Felipe Leme
fb7b4a5bf1 Fixed ActivityChooser logic for the initial case.
When ActionSendMultipleConsumerActivity is not the default action, it
just need to be selected, without clicking 'Just Once'

BUG: 25752530
Change-Id: I111063aa0dbba37e0cac8f0572f43a48c659e975
2015-12-11 19:03:35 -08:00
Felipe Leme
32cdcb838f Merge "Created initial bugreports dir if it doesn't exist." 2015-12-12 03:01:56 +00:00
Geoff Mendal
ed22ec9b5b Import translations. DO NOT MERGE
Change-Id: Id475f3e48918972cc697cf3340212b92d6b2ab0b
Auto-generated-cl: translation import
2015-12-11 18:52:14 -08:00
Felipe Leme
e2b4f49795 Created initial bugreports dir if it doesn't exist.
BUG: 25752530
Change-Id: Iec65b88231e26aaa62d301a26b2f51cf92651c72
2015-12-11 18:19:26 -08:00
Felipe Leme
93702abf6e Cleaned up unit tests.
This refactoring will make it easier to add new test cases for the
upcoming bugreport details notification.

BUG: 25794470
Change-Id: I0bf6ab54a7b4aa1dfa51ad0354682e5764b8a209
2015-12-11 17:15:56 -08:00
Felipe Leme
a5d3cfa983 Merge "Unhardcoded file paths." 2015-12-11 18:25:04 +00:00
Felipe Leme
a0bf0336f0 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
2015-12-11 10:15:43 -08:00
Felipe Leme
457ef13c14 Merge "Refactored what happens when a BUGREPORT_FINISHED is received." 2015-12-11 01:02:04 +00:00
Felipe Leme
2bfa0858a8 Added test annotation.
BUG: 25752530
Change-Id: Ia84233371481be89b1c9c852dfbb990020f0e6c0
2015-12-10 12:43:31 -08:00
Felipe Leme
46d47911ea 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
2015-12-09 18:02:07 -08:00
Felipe Leme
ba477939f0 Improved test case by checking for dangling service.
This check will make it easier to refactor how the bugreport is shared, which is a requirement for showing the bugreport details window.

BUG: 25794470
Change-Id: If29f0515586c6680a44e0d52c4fc587808e668aa
2015-12-09 11:28:11 -08:00
Geoff Mendal
7e050948bf Import translations. DO NOT MERGE
Change-Id: I461b9fb136ac4ccb6ae9fb655a06da057c7fdca0
Auto-generated-cl: translation import
2015-12-09 05:40:42 -08:00
Felipe Leme
811e636046 Merge "Improved test cases so they handle the initial warning." 2015-12-08 23:51:38 +00:00
Felipe Leme
6bbb6b9caf Improved test cases so they handle the initial warning.
BUG: 25752530
Change-Id: I78cd8b534fd3aeeadad0a2cf6712432a2438ca5a
2015-12-07 17:50:15 -08:00
Felipe Leme
21d4b20f23 Merge "Changed ActivityManager.requestBugreport() to take a 'progress' parameter." 2015-12-07 18:02:40 +00:00
Geoff Mendal
6c7a00208e Import translations. DO NOT MERGE
Change-Id: Ia3f58d3662cffb305e2e5d41f497595e5e57e2f6
Auto-generated-cl: translation import
2015-12-07 05:39:02 -08:00
Felipe Leme
4cc863338d 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
2015-12-05 10:30:18 -08:00
Felipe Leme
5662dd8379 Merge "Refactoring: pulled ServiceHandler methods to its parent class." 2015-12-04 22:14:05 +00:00
Felipe Leme
62607a4de0 Merge "Changed workflow so max progress can be dynamically updated." 2015-12-04 22:12:20 +00:00
Felipe Leme
923afa9fe1 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
2015-12-04 14:05:17 -08:00
Felipe Leme
719aaae3c1 Changed workflow so max progress can be dynamically updated.
BUG: 25794470
Change-Id: I75dfdabf9febf54f2fb714441d48b339f8d3d293
2015-12-04 11:50:58 -08:00
Felipe Leme
d57dc996f5 Improved phrasing for "in progress" message.
BUG: 25948539
Change-Id: Ie746a12207da337ec26e85dfbbd4188aa751c20d
2015-12-03 17:42:31 -08:00
Felipe Leme
a413143afc Improved helper used to choose an activity.
- Decrease delay by first checking if the activity is the default
  selection.
- Handle scrolling so it won't fail if the activity is not visible.

Change-Id: I8fce920bad207c3f35375316a139f20c1dcb9343
2015-12-03 11:09:53 -08:00
Felipe Leme
ec52d7983c Merge "Adds a notification action to cancel a bugreport in progress." 2015-12-03 00:18:34 +00:00