386 Commits

Author SHA1 Message Date
Bill Yi
aa7d40e410 Import translations. DO NOT MERGE
Change-Id: I52c644d3151d4144a31e7a11730a2d3f54fc3bc2
Auto-generated-cl: translation import
2016-04-04 22:53:33 -07:00
Bill Yi
533dc5022a Merge "Import translations. DO NOT MERGE" 2016-03-31 04:15:44 +00:00
Philip P. Moltmann
ddea724b36 Merge "Add the print service recommendation service" into nyc-dev am: 740a5f0
am: fa04bc7

* commit 'fa04bc7a5d49415bc7cd397bb9678316d3824f85':
  Add the print service recommendation service

Change-Id: I3da289dfe99e1caa3ed2ab3368902d597f16f738
2016-03-31 02:23:16 +00:00
Philip P. Moltmann
fa04bc7a5d Merge "Add the print service recommendation service" into nyc-dev
am: 740a5f0

* commit '740a5f023eea7b2fdb3e31efe8b8d5ac18aa8302':
  Add the print service recommendation service

Change-Id: Ie58ade9356f591781496581259b6d8a876780ac9
2016-03-31 02:17:26 +00:00
Bill Yi
2d0887e7cf Import translations. DO NOT MERGE
Change-Id: I46bd38a9a24fe0b270c419469a858425ba3eaa5e
Auto-generated-cl: translation import
2016-03-30 18:40:34 -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
Geoff Mendal
a05047cf6c Import translations. DO NOT MERGE
Change-Id: I20c740e74d15274a80933bf75219da873e0fd045
Auto-generated-cl: translation import
2016-03-28 05:41:19 -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
Bill Yi
2ef68aafb9 Import translations. DO NOT MERGE
Change-Id: I1e5f140ca6c5d0d8dd2140285772e26374c3449e
Auto-generated-cl: translation import
2016-03-25 18:05:47 -07:00
Philip P. Moltmann
75a6e7fb3b Merge "Remove unnecessary strings and labels." into nyc-dev am: a785c80
am: 31c3688

* commit '31c3688d0f67450a8d55c40d0c9e9ef1d2cab8c2':
  Remove unnecessary strings and labels.
2016-03-23 20:53:26 +00:00
Philip P. Moltmann
31c3688d0f Merge "Remove unnecessary strings and labels." into nyc-dev
am: a785c80

* commit 'a785c80a5ec3cdd4c14dc8519a2d8cbcc716a0f2':
  Remove unnecessary strings and labels.
2016-03-23 20:48:59 +00: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
2b47d01183 Merge "Deal with print-preview renderings that do not match the correct number of pages." into nyc-dev am: 49435a7
am: e2125f4

* commit 'e2125f4cdbb55dfa091a73a0a7db157f08c12b34':
  Deal with print-preview renderings that do not match the correct number of pages.
2016-03-23 17:36:30 +00:00
Philip P. Moltmann
e2125f4cdb Merge "Deal with print-preview renderings that do not match the correct number of pages." into nyc-dev
am: 49435a7

* commit '49435a72955fd6d2673ac33c34e2417c96fd87fb':
  Deal with print-preview renderings that do not match the correct number of pages.
2016-03-23 17:32:17 +00: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
Geoff Mendal
1ab0d7fa30 Import translations. DO NOT MERGE
Change-Id: I21e03e1fd18cd86cbdd9f1f44150ac1e91d0b807
Auto-generated-cl: translation import
2016-03-18 20:23:57 -07:00
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
Geoff Mendal
1fce970313 Import translations. DO NOT MERGE
Change-Id: I050a95827f0a1d39db09146de6bdc4ed8d1f017b
Auto-generated-cl: translation import
2016-03-14 05:39:38 -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
Bill Yi
f5d4362f35 Import translations. DO NOT MERGE
Change-Id: I64fed27ebaa912c01258321293682440a9eefb1f
Auto-generated-cl: translation import
2016-03-10 17:15:46 -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
Geoff Mendal
4b5d6a815b Import translations. DO NOT MERGE
Change-Id: Ic5b3b5b165a189fcaee1d30525310421a50b9289
Auto-generated-cl: translation import
2016-03-09 05:40:09 -08:00
Philip P. Moltmann
cb0f198995 Merge "Add "app printer activity" and always keep the print service state updated. Also fiddle with the UI to use more standard values." into nyc-dev am: 02a465ace7
am: 74b16200fd

* commit '74b16200fd6624f6fdaccd08509e912a54494677':
  Add "app printer activity" and always keep the print service state updated. Also fiddle with the UI to use more standard values.
2016-03-07 19:37:06 +00: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
Geoff Mendal
c3756608be Import translations. DO NOT MERGE
Change-Id: I88da55a0e461d0b63df8f651e9ac755407b3d3c5
Auto-generated-cl: translation import
2016-02-17 05:40:13 -08:00
Geoff Mendal
7063193efb Import translations. DO NOT MERGE
Change-Id: Iab86a97c022c0a0b688f89a85f58ef3b3279452f
Auto-generated-cl: translation import
2016-02-15 05:41:16 -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