796 Commits

Author SHA1 Message Date
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
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
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
d86e8d813b Merge "Do not disable the add printer icon and have special empty view if no print services are enabled" 2015-11-12 23:07:04 +00: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
6dc9114ef8 Merge "Deal correctly with suggested print attributes" 2015-11-12 17:17:30 +00: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
b4efdb4726 Deal correctly with suggested print attributes
An app might suggest certain attribute for an print job. This patch
fixes

- PrintActivity should not silently overwrite the attributes with
  the default values
- Handle duplex mode in PrintAttributes similar to the other attributes.
  I.e. have an "unset" value (0). This is an API change. But the only
  use case for PrintAttributes was to pass them to print() and thereby
  the PrintActivity. This was broken (see above), hence we are changing
  and API that could have never been used.

Bug: 23629618
Change-Id: I43c25704497c799352fb806126dc93f6db4879f5
2015-11-10 17:09:30 -08:00
Svetoslav Ganov
59cf3086a9 Merge "Avoid NPE in printspooler when changing language" am: 8d8515e708 am: 5522efb130
am: 16009a6dea

* commit '16009a6deaff272c94046facbeb567bafdaacc69':
  Avoid NPE in printspooler when changing language
2015-11-10 02:36:02 +00:00
Svetoslav Ganov
16009a6dea Merge "Avoid NPE in printspooler when changing language" am: 8d8515e708
am: 5522efb130

* commit '5522efb1300cfa87a8434bd396093a2ae076fa69':
  Avoid NPE in printspooler when changing language
2015-11-10 01:07:27 +00:00
Svetoslav Ganov
5522efb130 Merge "Avoid NPE in printspooler when changing language"
am: 8d8515e708

* commit '8d8515e708f0cebf69587750bbb3abcb315cc61e':
  Avoid NPE in printspooler when changing language
2015-11-10 01:03:05 +00: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
Masaaki Iwaguchi
86d13f3daf Avoid NPE in printspooler when changing language
PrintActivity is recreated when the language setting is changed.
As a result of the recreation mCurrentPrinter is null, which causes
a NullPointerException when onActivityResult() is called.

The issue is solved with a simple null check.

Change-Id: Ic58f0ca01577d2ec02d494739f3bc2f06240dd44
2015-11-05 17:39:21 +00:00
Baligh Uddin
40fa6b1e91 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 25433205
Change-Id: I44df802e45a340d7ef7f094c6c06001d350bb0c5
2015-11-04 15:46:28 -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
Elliott Hughes
434a481b21 am ea1831d2: am b57dd722: resolved conflicts for a884d81e to stage-aosp-master
* commit 'ea1831d211ea0e6b2d161c714bb0786369ef2df5':
  constify JNINativeMethod function pointer tables
2015-09-24 17:23:00 +00:00
Elliott Hughes
b57dd722f1 resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
76f6a86de2 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04: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
Chris Wren
2741a28bee am 75cc74b6: am a757636e: am b35152cb: am ca3a3650: am 6e75e7dd: Merge "Instrument printing service for metrics collection." into mnc-dev
* commit '75cc74b62a9fa8888c0ca52099557deb7d8ad53c':
  Instrument printing service for metrics collection.
2015-08-01 17:54:55 +00:00
Chris Wren
a757636e11 am b35152cb: am ca3a3650: am 6e75e7dd: Merge "Instrument printing service for metrics collection." into mnc-dev
* commit 'b35152cb182a0d25c896d27acf4bedb93f03cadc':
  Instrument printing service for metrics collection.
2015-08-01 16:53:49 +00:00
Chris Wren
b35152cb18 am ca3a3650: am 6e75e7dd: Merge "Instrument printing service for metrics collection." into mnc-dev
* commit 'ca3a3650e41449eb9d3b9643e844b7506d77759f':
  Instrument printing service for metrics collection.
2015-08-01 16:38:10 +00:00
Chris Wren
6fe9424837 am 6e75e7dd: Merge "Instrument printing service for metrics collection." into mnc-dev
* commit '6e75e7dd988d7704a01528f479421ab5e6012c99':
  Instrument printing service for metrics collection.
2015-08-01 00:18:31 +00:00