375 Commits

Author SHA1 Message Date
Baligh Uddin
6c9b9a0040 Import translations. DO NOT MERGE
Change-Id: I937913df9ba9c5bcb8ca110826e8bb61730eab93
Auto-generated-cl: translation import
2016-04-14 19:11:22 -07:00
Bill Yi
4a1171ea92 Import translations. DO NOT MERGE
Change-Id: If767f0a767da0172ba79fb9d8feaff6c1a8c9157
Auto-generated-cl: translation import
2016-04-09 04:14:00 -07:00
Philip P. Moltmann
6c2bed24ec Merge "Print Activity: Use a single (re-implemented) parsing logig for page ranges." into nyc-dev 2016-04-06 16:08:49 +00:00
Bill Yi
f65a843661 Import translations. DO NOT MERGE
Change-Id: Ib8200b22451664277e49d59489e1727b281fa960
Auto-generated-cl: translation import
2016-04-05 00:18:26 -07:00
Philip P. Moltmann
c6c319e988 Print Activity: Use a single (re-implemented) parsing logig for page ranges.
- Support unbounded ranges, e.g. 4- == 4-pageCount and -2 == 1-2
- Do not allow reverse ranges, i.e. 7-3 is not allowed anymore
- restrict characters that can be typed into field
- force numeric keyboard

- Fix bug that we update the selected pages even if the page ranges are
  invalid

Fixes: 13126748
Change-Id: I515d9346ceb152a41b7260792c5dd9bd91b27cab
2016-04-01 14:35:04 -07:00
Bill Yi
25b12ac54e Merge "Import translations. DO NOT MERGE" into nyc-dev 2016-03-31 04:18:13 +00:00
Bill Yi
30443bf699 Import translations. DO NOT MERGE
Change-Id: Icc3eb7aed5c4991a4628cd3978a0d8339ec785a9
Auto-generated-cl: translation import
2016-03-30 20:09:56 -07:00
Philip P. Moltmann
9dcb86a48d Add the print service recommendation service
This service connects through the print manager to the print spooler:

PrintSpooler.AddPrintersActivity <-> PrintManager <-> PrintManagerService <-> UserState <-> RemotePrintServiceRecommendationService <-> PrintRecommendationService <-> PrintRecommendationServiceImpl

Hence there is a lot of mindless plumming.

The actual changes are only in the AddPrintersActivity which is extended
to show another list of services: The recommended services.

The PrintServiceRecommendationService is based on the experimenal print
service stubs provider. This provider was contributed the Android by
Mopria. As this services uses Android own network discovery service most
code from the experimental provider goes away. In fact the only logic
left over is the selections of mdns-txt fields to look at and the
printer vendor configuration.

This relies on the Android MDNS to get fixed (Bug: 27696905). This also
does not deal with how to update the recommendation service.

Bug: 24533249
Change-Id: I6edc6e25fc08a50d478b61c71bb8ea158b08624c
2016-03-30 17:21:07 -07:00
Geoff Mendal
60e532a47f Import translations. DO NOT MERGE
Change-Id: If53b6bafc90089964ee5de76e683bf196160c171
Auto-generated-cl: translation import
2016-03-28 07:27:25 -07:00
Bill Yi
397fb345ba Import translations. DO NOT MERGE
Change-Id: I311ab683a598426efc4739408be109d766aad721
Auto-generated-cl: translation import
2016-03-25 19:34:39 -07:00
Philip P. Moltmann
30b0752ef5 Remove unnecessary strings and labels.
Bug: 27815807
Change-Id: I6388055938afbbadc954c913ce0554f9a4a313e8
2016-03-23 13:32:35 -07:00
Philip P. Moltmann
49435a7295 Merge "Deal with print-preview renderings that do not match the correct number of pages." into nyc-dev 2016-03-23 17:17:40 +00:00
Geoff Mendal
c07f2d99da Import translations. DO NOT MERGE
Change-Id: I0d693f0c99347f9d04c7240e07bdd6ea526cb987
Auto-generated-cl: translation import
2016-03-19 14:01:30 +05:30
Philip P. Moltmann
066bf81b98 Deal with print-preview renderings that do not match the correct number
of pages.

If the printing app declares more pages than the print preview pdf has
we used to throw an exception in the PDFManupulationService. This caused
the bitmap to be never written and the read-bitmap function to hang
forever. This was because read() return 0 meaning "pipe is closed" which
lead to an infinite loop. Now a read of 0 page might cause an exception
if the page is not fully read. This exception then causes the
preview_page_error to be displayed.

Bug: 27556666
Change-Id: I7b9de50dce930629e8d38efd4e2659a00b70cc4e
2016-03-18 10:57:32 -07:00
Geoff Mendal
03a76f7c9e Import translations. DO NOT MERGE
Change-Id: Iebdb30818688a27d0c8edb60c5686a37e69f3444
Auto-generated-cl: translation import
2016-03-14 07:19:18 -07:00
Bill Yi
f4735aa23a Import translations. DO NOT MERGE
Change-Id: I72b2693c21cc8536a5642b6c0526f611a28631bc
Auto-generated-cl: translation import
2016-03-10 18:50:20 -08:00
Geoff Mendal
70431d0653 Import translations. DO NOT MERGE
Change-Id: If1e61e7ff8623456b114a06e38ecaa4e7b65e7b8
Auto-generated-cl: translation import
2016-03-09 07:19:29 -08:00
Philip P. Moltmann
66c96591e2 Add "app printer activity" and always keep the print service state
updated. Also fiddle with the UI to use more standard values.

To be sure the print service state alwasy updated I changed
PrintManager.getPrintServices to return a loader which just wraps a
registerListener/getList/removeListener combo.

I also added a new function to enabled/disable a print service to be
keep all updating logic inside the PrintManagerService->UserState.

Then I changed all code to use this new interface.

Detailed comments:

PrintServiceInfo:
- I had to add the enabled state to the PrintServiceInfo as some users
  of PrintManager.getPrintServices want all services but then display
  different data depending on the enabled state. Of course I could have
  created two PrintManager.getPrintServices-loaders to load the two
  separate list of services. I think it is much easier to add this
  property though. It is updated every time new data is returned to the
  PrintManager.getPrintServices-loader.

AddPrinterActivity:
- This is shown as a dialog-style overlay to indicate that the user will
  return to the select-printers activity. It contains of three list that
  are updated via separate loaders.
- The recommended services will be added later to keep this path set
  small.

PrintActivity:
- There are two small places where we have to update the data when we
  get a new list of print services.
  - In very, very rare conditions it can happen that the print service
    of the current printer gains or looses the "advancedOptions"
    activity
  - If we have no enabled print services we want to show "Add printer"
    instead of "All printers...".
- Also the print registry is not the only loader anymore, hence we have
  to assign loader ids to it to not conflict with the other loaders in
  this activity.
- Small bug in onPrintersChanged: If a printer is selected and the print
  service of this printer gets disabled the holder goes into "removed"
  state which disables the printer. When the print service is then
  enabled again, we forgot to re-enable the holder.

PrinterRegistry:
- The registry assumed that the FusedPrinterProvider was the only loader
  in the activity. This is not true anymore, hence it has to assign the
  appropriate loader ids.
- The FusedPrinterProvider has an internal loader, hence we have to
  forward a loader Id into it.
- The PrintRegistry is only called backed for a single loader, hence no
  need to check the loader-id.

SelectPrinterActivity:
- The AddPrinterDialog was removed as we now have the
  AddPrinterActivity.
- Added a loader for the enabled services to update the empty state.
- Added dedicated loader Id for the PrinterRegistry again.
- If we have no enabled services, the SelectPrinterActivity chainloads
  the AddPrinterActivity as this is the only thing the user can do
  anyway. "Save a click". This should only happen when the activity is
  create the first time.
- Moved the "add printer" from the menu item to the list of printers as
  suggested by UX and Zach.

PrintManagerService, UserState and IPrintManagerParamtersTest:
- As the only place where the print service state is updated is now the
  userstate, we have no more sychronization problems. Whohoo.
- The users can now register for changes to the print services similar
  as they can register for changes to the print jobs.
- UserState.getPrintServices is the only function can exposes any
  knowledge of the print services to the outside world.

Change-Id: I9be2c7300431e06aaff9bdf7eb36120d869b56ac
2016-03-07 09:58:08 -08:00
Philip P. Moltmann
e93cf151fb Merge "Allow the PDF Printer to "print" non-locale-default paper sizes." 2016-02-02 16:34:48 +00:00
Philip P. Moltmann
18fc58f13d Merge "UI improvements for the print spooler" 2016-02-01 23:42:05 +00:00
Philip P. Moltmann
443075ab97 UI improvements for the print spooler
- gray out printer icons of unavailable printers
- Increase touch target of more into button
- Use same info icon as in the Settings
- Align text correctly in destination drop down
- In general use same layout as generic list-item (as much as possible)
- remove unnecesary color file

Change-Id: I8b0339df0cb6a5130b5530f21c4ef86cb75a683b
2016-01-29 10:49:29 -08:00
Philip P. Moltmann
0b953a24c7 Size recyclerview correctly.
Bug: 26769843
Change-Id: I00715ab028f8da10b74db11aaef08843a8cc009f
2016-01-28 13:12:43 -08:00
Geoff Mendal
93f18cefca Import translations. DO NOT MERGE
Change-Id: Id69e1f05426df237d87764464acd6997ed22cff8
Auto-generated-cl: translation import
2016-01-25 05:40:21 -08:00
Philip P. Moltmann
4959caf149 Allow the PDF Printer to "print" non-locale-default paper sizes.
The MediaSizeComparator already sorts the media sizes correctly.

Bug: 12675943
Change-Id: I6fa4b1a8885a60704bc175ec849ea483ffb4bcd8
2016-01-21 15:10:29 -08:00
Geoff Mendal
2874739bf6 Import translations. DO NOT MERGE
Change-Id: I9339fe99c83fe70cec438b7d36abe36116ed0a8a
Auto-generated-cl: translation import
2016-01-20 05:47:05 -08:00
Geoff Mendal
82ec4e9949 Import translations. DO NOT MERGE
Change-Id: I22202310da38844825b48d612c8097ea559b71d7
Auto-generated-cl: translation import
2016-01-18 05:50:11 -08:00
Geoff Mendal
3e3a451f79 Import translations. DO NOT MERGE
Change-Id: I488d48ed5a95fb2764dd2129fc512fa1c2db5fdb
Auto-generated-cl: translation import
2016-01-13 05:37:19 -08:00
Philip P. Moltmann
f7b5018028 Merge "Display toast when print services are disabled." 2016-01-11 19:41:25 +00:00
Geoff Mendal
d7483de165 Import translations. DO NOT MERGE
Change-Id: I519c2c15b3ae10ec47a76de7afff6fea223ba1c9
Auto-generated-cl: translation import
2016-01-11 05:41:24 -08:00
Philip P. Moltmann
1f46779f5e Display toast when print services are disabled.
Change-Id: Id1ebcbbf39eb558bc15c7c69c03fe8124b9c79d7
2016-01-08 14:03:01 -08:00
Philip P. Moltmann
a1cdb4bacb Use notification grouping for print notification.
Change-Id: Ifb5bc0f233611a056db511b15379165ac6fe0edf
2016-01-07 09:19:54 -08:00
Geoff Mendal
b0d78d487c Import translations. DO NOT MERGE
Change-Id: I57fcb1091c20531411b67a6ff0fab6ba973b8d3a
Auto-generated-cl: translation import
2015-12-28 05:44:56 -08:00
Geoff Mendal
de557669b2 Import translations. DO NOT MERGE
Change-Id: I26b3d71c972ae0f9757845441999564e504f9183
Auto-generated-cl: translation import
2015-12-23 05:37:14 -08:00
Philip P. Moltmann
bb9f686b40 Allow a print service to specify per printer icons, description and
info-activities

The icon is loaded from the discovery session only when it is displayed
to avoid having to store too many icons in memory.

Also the icons are not maintained in the historical printers. Only if
the printers are available nice icons are shown. A historical printer is
updated with the appropriate properties (including icon) once it becomes
available.

Bug: 24135005
Change-Id: Iec389bab514b024634be8fb5fc8928371cba8740
2015-12-21 09:54:57 -08:00
Geoff Mendal
6f3143de02 Import translations. DO NOT MERGE
Change-Id: Ife17cc8816a60ab0966694d1e4212b70f2340ec7
Auto-generated-cl: translation import
2015-12-16 05:48:19 -08:00
Geoff Mendal
7684a41009 Import translations. DO NOT MERGE
Change-Id: I46e625b01bd8cdec98ad7c097c4c12e1e211f6d2
Auto-generated-cl: translation import
2015-11-23 05:48:40 -08:00
Geoff Mendal
b3197f8c04 Import translations. DO NOT MERGE
Change-Id: I49c49dae609cc2b2770652a0979693124f30a824
Auto-generated-cl: translation import
2015-11-18 05:36:36 -08:00
Philip P. Moltmann
354bd63726 Merge "Show "select a printer" as "destination" the first the the user prints" 2015-11-16 21:43:22 +00:00
Philip P. Moltmann
ca3f938326 Merge "Switch add icons to the default menu add icon" 2015-11-16 20:16:23 +00:00
Philip P. Moltmann
5e54896d0b Show "select a printer" as "destination" the first the the user prints
The Spinner does not support a prompt, hence temporarily hijack the
first element and install an alternate view. Once the Spinner is touched
revert to the old behavior.

If we showed a prompt the views in the spinner cannot be recycled.

Bug: 24132864
Change-Id: Iaf97878f85388a8c6351e716117b16f34919ad84
2015-11-16 12:14:18 -08:00
Philip P. Moltmann
7dfe4f64dc Switch add icons to the default menu add icon
Also use the material search icon.

Bug: 22563699
Change-Id: Iff7c6b5cac8a9f0bf282e061d2ed09c4c0fb480a
2015-11-16 11:58:46 -08:00
Geoff Mendal
97f8aae2f8 Import translations. DO NOT MERGE
Change-Id: Ifa6072a51df82cd0f473908393b500ff8a0d5ec0
Auto-generated-cl: translation import
2015-11-16 05:34:04 -08:00
Geoff Mendal
0477e97830 Import translations. DO NOT MERGE
Change-Id: I1378e54201336a2458b2cf4f8f2982922e8e6ac5
Auto-generated-cl: translation import
2015-11-14 06:08:16 -08:00
Philip P. Moltmann
953639cb82 Do not disable the add printer icon and have special empty view if no
print services are enabled

The add printer icon is always visible as this is used for both adding
a printer and adding addition print services

We have three different empty views now:
1. No print services
2. No printers found (not search filter set)
3. No printers found (search filter set)

Bug: 24132367
Change-Id: Ic30812b60986f1e0f023488cefc6aa901ce20824
2015-11-12 11:48:09 -08:00
Philip P. Moltmann
3aa1fc5aec Allow ellipsizing of copy count and media size in PrintActivity main view.
Bug: 25589299
Change-Id: I231c156de1180b18a140ee8ad896bd4226196bc9
2015-11-11 10:30:21 -08:00
Geoff Mendal
5fcbc95825 Import translations. DO NOT MERGE
Change-Id: Id20219220ba0cace66145a7f51c64ba6e3157f86
Auto-generated-cl: translation import
2015-11-11 05:38:05 -08:00
Philip P. Moltmann
853a6f564a Add a alert that allows the user to approve a print service when
we print using it the first time.

This warning used to be shown when the print settings app was used
to enable a service.

If two warning as shown for the same print service we automcatially
dismiss all dialogs once one dialog is confirmed. Please note that
we are not confirming the printjob as it is unexpeced to have a
single click to confirm multiple print jobs.

Change-Id: I8bb0a49bac2063c1c55e2f24bd34df2c44e2df89
Bug: 24135353
2015-11-09 09:49:26 -08:00
Baligh Uddin
198127cac3 Import translations. DO NOT MERGE
Change-Id: I9b1c6ef0255a30142b1c7fd98d2b3e2b04b0ba93
Auto-generated-cl: translation import
2015-09-25 22:52:20 -07:00
Geoff Mendal
1c85ac66c0 Import translations. DO NOT MERGE
Change-Id: I6c5aed9a246676b5b0c3c636f7ef034da7d1de01
Auto-generated-cl: translation import
2015-08-31 05:43:06 -07:00
Geoff Mendal
b851c2102b Import translations. DO NOT MERGE
Change-Id: I074e138929dbd329a281adbf55521e0d4a521485
Auto-generated-cl: translation import
2015-07-29 05:32:05 -07:00