820 Commits

Author SHA1 Message Date
Philip P. Moltmann
e33b954165 Merge "Check parameters for callers of IPrintManager" 2016-01-26 22:52:58 +00:00
Philip P. Moltmann
b18cacfcad Merge "Carry over orientation when updating the printAttributes with the capabilities of the printer." 2016-01-26 18:24:15 +00: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
dc5765eb0c Carry over orientation when updating the printAttributes with the capabilities of the printer.
Bug: 19194758
Change-Id: Iaa9897bc730d8cefa63bed8a5ad02e0a5dc89c71
2016-01-22 09:39:41 -08:00
Philip P. Moltmann
76d7e3ee70 Check parameters for callers of IPrintManager
- Propagate nullness and non-null-ness up and down from the interfaces.
- Add non-CTS print tests for IPrintManager binder.

Change-Id: I0c310d9cea8aefba5ce386931521ffaf19712bbb
2016-01-21 13:27:30 -08:00
Philip P. Moltmann
5462e88c02 Treat empty strings similar to null-strings when composing the subtitle in the SelectPrinterActivity.
Change-Id: Ia0ee353df56b2f835f1ac291dc69eb3747425e6b
2016-01-20 13:55:38 -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
Philip P. Moltmann
c2ad22663b Clean up API for PrinterInfo.
- Make immutable
- Check parameters
- Check state while unparcelling

Change-Id: I13959845ca508936331488506380e894f49abf25
2016-01-14 12:48:31 -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
e978af63e6 Merge "Do not add far favorite printers more than once." 2016-01-11 20:22:40 +00:00
Philip P. Moltmann
fcb51b8270 Merge "ApprovedServices might be null, handle the case:" 2016-01-11 20:22:10 +00:00
Philip P. Moltmann
8d978ba1e7 Merge "In rare cases the printing client app might have been dieded before remotePrintDocument.start(). In this case the print spooler should not crash." 2016-01-11 19:41:55 +00: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
0d1e622000 ApprovedServices might be null, handle the case:
Bug: 26454066
Change-Id: I909d84d08a1f6d29f486e8ea6097e782b054864e
2016-01-08 16:26:44 -08:00
Philip P. Moltmann
9b99d76a71 Do not add far favorite printers more than once.
The favorite printer list contains a printer multiple times as it might
have been used at different locations. Hence it can be that a printer is
in the favorite printer list multipe times but never considered close.

Hence we go into the second loop and add it multiple times as we never
add it to alreadyAddedPrinter.

Change-Id: I4ca8a6a5a05f43645a0b2c891a55df2ccce05ad4
2016-01-08 16:20:12 -08:00
Philip P. Moltmann
f6114c4f1e In rare cases the printing client app might have been dieded before remotePrintDocument.start(). In this case the print spooler should not crash.
Change-Id: Ica1b46fadf6bccbd28e8f9c928f5d504cccff792
2016-01-08 14:49:56 -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
8141bdfa56 Store which print services are disabled instead of which are enabled
This make services that appreared while the print manager was not active
by default enabled.

In the case we upgrade from pre-N we convert the enabled-list into a
disabled-list.

Bug: 26249649
Change-Id: Iae783a8dd19f1a9d75d675710ea4348fdfbd34f3
2016-01-07 09:30:43 -08:00
Philip P. Moltmann
a5fcd5028a Remove debugging from print notification code.
Change-Id: I3f0fb6c68de0b3f4cd0fa67ddf8c405199d6498e
2016-01-07 09:25:49 -08:00
Philip P. Moltmann
a1cdb4bacb Use notification grouping for print notification.
Change-Id: Ifb5bc0f233611a056db511b15379165ac6fe0edf
2016-01-07 09:19:54 -08:00
Philip P. Moltmann
98edbe3e6d Merge "Show indeterminate progress bar when job is queued or started and the progress is not known." 2016-01-04 20:28:27 +00: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
f25c403337 Show indeterminate progress bar when job is queued or started and the progress is not known.
Bug: 24135025
Change-Id: Id8d365e41573a3ea7018cadeb8d6e857f0dbe1cf
2015-12-22 20:42:57 -08:00
Philip P. Moltmann
98963260dc Prefer printers that have been used physically close to the current
location of the user.

Commonly the users prints on a printer that this near the user current
location. Hence if possible we want to show the user printers that he
used before and that are close to him.

Hence store the location of the previous uses of a printer and prefer
printer that are close to the user.

Unfortunately getLastLocation might not report a usable location and it
will take at least 5 seconds until the first usable location arrives. At
this time the user might have already opened the destionation spinner.
It would be unexpected for the printers to suddenly change under the
users finger. Hence it might be that we did first show the printer
without any location information and then once the location is known we
cannot update thedestination spinner anymore.

The select printer activity does not have this issue, hence in the worst
case the user has to enter this activity to select a printer and by then
the location is usually determined.

This is not ideal but better than before.

Bug: 24133609
Change-Id: Ie7d20cf3d9dd163e57903f8f6ecc0b3fd4f4374e
2015-12-22 19:00:39 -08:00
Philip P. Moltmann
4c95567b5f Merge "Clean up print subsystem" 2015-12-23 02:11:01 +00:00
Philip P. Moltmann
30172e2561 Merge "Close closeguard of PageContentRepository." 2015-12-23 01:28:07 +00:00
Philip P. Moltmann
c43639c306 Clean up print subsystem
- Stop using deprecated APIs
- Fix all public and some internal javadoc
- Add @Decorations to public APIs
- Some minor cleanup, e.g. don't use variables with overlapping names in same scope
- remove unnecessary properties from manifest (they are set by the build
  system)

Change-Id: I0ce8849a516414763fe9de76c3a18ce17d896816
2015-12-22 17:27:27 -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
Philip P. Moltmann
38fdd4f486 Close closeguard of PageContentRepository.
Change-Id: I4ee143e94fde7ac4dbc25e6208caafdab819df31
2015-12-17 11:48:04 -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
Philip P. Moltmann
a958fc336b Unset is -1 not Nan
Change-Id: I6e7fac4b9f1c3dc6cc88c786db856ddecf3f8538
2015-12-02 15:39:35 -08:00
Philip P. Moltmann
b3078c235e Allow print service to specify progress of print and status
The status has always been there in error cases, it is now also visible
in non-error cases.

If the progress is not set, no progress bar is shown.

Bug: 24135025
Change-Id: Iea23f45d236365433c6f6739597833d236ed6d19
2015-12-01 15:42:49 -08:00
Yohei Yukawa
1f3257d766 Merge changes Iee47e374,Icc64942a
* changes:
  Use Context.getSystemService(Class<T>) for InputManager.
  Use Context.getSystemService(Class<T>) for InputMethodManager.
2015-11-26 08:16:33 +00:00
Yohei Yukawa
777ef95ebf Use Context.getSystemService(Class<T>) for InputMethodManager.
This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving
InputMethodManager.  Note those are bundled code.  Hence we don't need
to make sure Build.VERSION.SDK_INT >= 23.

Change-Id: Icc64942ad8f11e44bf84f8d4fe476b2fdd1257f3
2015-11-26 00:02:05 -08:00
Philip P. Moltmann
03755a1f12 Syncronosuly notify SelectPrinterActivity about changes to enabled print
services

If the SelectPrinterActivity is visible it shows different emptyState
depending on if there are print services available or not. Hence the
activity has to listen to changes to the list of enabled services.

This also fixes a small syncronsation problem if two observers are
registered for the enabled print services.

Bug: 25666802
Change-Id: I79af66f25f10e66347b48ce9bb99c1657b30a8dd
2015-11-25 16:28:34 -08:00
Philip P. Moltmann
c9137615e4 Merge changes from topic 'AddPrinters'
* changes:
  Create PrintDiscoverySession for future print services
  Update printer availability when printSpooler is paused. This makes the window update syncronously when in multi-window mode.
2015-11-24 21:33:39 +00:00
Svetoslav Ganov
abef6d6f2b Merge "Allow fragment state loss on fragment transaction" 2015-11-24 20:56:22 +00:00
Svetoslav
d25ddc3d0e Allow fragment state loss on fragment transaction
We are not saving the state of this fragment on onSaveState,
so its Okay to loose state while confirming the transaction.

bug:25847358

Change-Id: I2f6587d528b2d8b8f24a83954cc896a6ff514996
2015-11-24 12:54:21 -08:00
Philip P. Moltmann
c0c73271b0 Merge "printspooler.NotificationCOntroller: Remove deprecated APIs and silence other warnings." 2015-11-23 16:18:57 +00: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
Philip P. Moltmann
dd635ce95c printspooler.NotificationCOntroller: Remove deprecated APIs and silence other warnings.
Change-Id: I53000e49793dccd6f53b0813e5ce97c5c6929832
2015-11-20 16:51:51 -08:00
Philip P. Moltmann
e2b95e4c56 Update printer availability when printSpooler is paused. This makes the window update syncronously when in multi-window mode.
Change-Id: If802f32a011b24ec8cca9292eb12bbb399548a40
2015-11-20 11:53:12 -08:00
Philip P. Moltmann
adac7f3406 Do not restart printSpooler when switching portait mode / landscape mode
When the configration changes there are two modes to handle it:
1. do through a onDestroy - onCreate cycle
2. declare that your activity can handle certain changed and handle them
   in onConfigurationChanges

For most apps (1) is zero effort to implement, hence it is the default
behavior. You only want to do (2) if recreating your activity is
expensive.

As recreating the printActivity is expensive (and currently even
impossible) we want to handle the configuration change gracefully. There
is no code to be added as handling portrait mode / landscape mode switch
is not different from an orientation switch.

Bug: 25727559
Change-Id: Iac5b854c9dd080a4432957bc4551162dc3d480e9
2015-11-18 16:27:51 -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