History log of /frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1c664b6defd20ab4a83c4a83d01b9ed8603f7c2c 04-Nov-2013 Svetoslav <svetoslavganov@google.com> Add way for the user to forget previously used printers.

We keep track of historical printers but some of them may disappear
forever, say the user changes his printer. In such a case the print
system has no idea that the previous printer will never appear so
this change allows the user to remove historical printers.

In the all printers list the user can now long press on a printer
and if the printer is available he can select it from the context
menu. If the printer was used before regardless if it is active the
user may choose to forget it.

bug:11282742

Change-Id: Idc2dda70920ad045149eea1bcfc75ad1992827e9
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
d3c197d97250af93041e6aa05ef0dfca323f1767 12-Oct-2013 Svetoslav Ganov <svetoslavganov@google.com> The callbacks for tracking a printer called more than once without printer change.

When the user selectes a printer in the UI we ask the print service to start tracking
the printer, i.e. to observe changes of the printer state and capabilities. The callback
for the initially selected printer is called twice which breaks the contract and also
may trigger potentially expensive operations on the print service side.

More precisely the printer does not change and we ask the service to start tracking,
stop tracking, and again start tracking.

bug:11199851

Change-Id: Ib761e6da03f670b3098c69b1c0927177a8e4ae6b
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
24c686b8b56950d5a1881cc660e53816d47e5e03 06-Oct-2013 Svetoslav Ganov <svetoslavganov@google.com> Update all printers activity's empty state and avoid selected printer flicker.

1. Updated the empty state of the all printers activity to show no printers message
if the user is searching and there are no matches and a searching for printers
message if the user is not filtering the printers list.

2. Adding the fake PDF printer after the historical printers are loaded to avoid the case
where we select the PDF printer and immediately after that the most used printer is
selected resulting in an undesirable UI flicker.

3. Fixed a bug where if the most used printer which is initially considered unavailable
is reported by the print service as available but the UI is not properly updated
leaving the user in no way to click on the print button.

bug: 10983508

Change-Id: I60fdb7761332850fd5b9ffc0cb572a6213024dba
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
d8dbc13b47bec3248a86a505a30af9d0474240dc 28-Sep-2013 Svetoslav <svetoslavganov@google.com> Ignore historical printer records for installed services

When loading historical records for previously used printers we
now ignore the ones whose target print service is not installed.

bug:10955652

Change-Id: Ib295e7d88ed3c308ef6d8a11bdc1792ebbb6d526
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
953c4143e846b071da4869cb7cfd8039a086b1da 26-Sep-2013 Svetoslav Ganov <svetoslavganov@google.com> Missed signal in FusedPrintersLoader.

1. In the FusedPrintersLoader we start observing the printers on
the device and if they change we send the result. If however,
the printers are already loaded in our session (because it
joined an ongoing printer discovery) and the pritners do not
change, the loader never sends its result. Now we are registring
the callback only after historical printers are loaded. We
also immediately check after starting discovery whether the
there are printers in the discovery session and if so deliver
them.

2. Improved logging in the FusedPrintersLoader.

bug:10940712

Change-Id: Ieb9b897d64780742125b29309462dea3eda170a6
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
b5f180608db6de123b54ae94de569ff1ebca705c 24-Sep-2013 Svetoslav <svetoslavganov@google.com> Multiple printer discovery session instances and other bugs.

1. The fused printers provider was dropping on the floor received printers
if it was not active. It is in fact a loaded and if not active it should compute
the printers and not deliver them until activated. This fixes an issue where
opening the print dialog, then enabling a print service results in the printers
reported by the service not showing up in the print dialog.

2. Printer discovery session was created twice which leads to incorrect behavior
as the pint system is designed around the contract that there is a single
printer discovery session per service at a time. This was possible due to an
incorrect initialization of a member variable resulting in double session creation
when the print service is connected.

3. When a print service is enabled during discovery we did not use the correct
condition to start printer discovery resulting in starting it all the time even if
not needed. Also if some of the printers that had to be tracked are reported
by the service just enabled (typically historical printers) we did not ask the
service to start tracking them.

4. Removed some logging.

bug:10903343

Change-Id: I46c049471a4b099fc668df3aee2aaedc8d7786ac
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
10ee84ba18255f259edf6fa2e3aa33c02ac5340d 18-Sep-2013 Svetoslav Ganov <svetoslavganov@google.com> The printers in print dialog should not change position.

The FusedPrintersProvider was not ensuring the existing printers
are at the same position when a new dataset is loaded. As a result
the printers were moving in the UI and sometimes the currently
selected one changed. Now the provider makes sure printers are in
the same position.

bug:10748884

Change-Id: I7c6cd5b1b38fdb615ceaae87806b413272ffba18
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
651dd4e6ee6510caf9f15c51094a11121af17ec2 12-Sep-2013 Svetoslav <svetoslavganov@google.com> Remove unneeded print APIs and update the min margins APIs.

1. Removed unneeded code in Resolution that was storing its
label as resource and package name. We do not have predefined
resolutions, therefore we always persist the label.

2. Renamed the print attribute margins to minMargins to reflect
that these are the minimal margins the printer support. Updated
the docs as well.

3. Renamed the create method of all builder to build.

bug:10727487

Change-Id: Ie72ab8aaa5215b8bd2853885011b3b4efa4deb2e
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
c6066799ad130140159230d14451b429eb828755 11-Sep-2013 Svetoslav <svetoslavganov@google.com> Handle print serivce crashes.

1. Now after a print service crashes we are bringing it to the same
state of its lifecycle. For example, if a service does a discovery
and crashes we recreate the discovery session call the start
discovery method and so on.

2. Turned off debugging logs since we have fully fledged state dump.

bug:10697779

Change-Id: Id790537461428e96b197eef12258996bda2bd1ce
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
a36285f3f2f74b1d2d5d0336ffe519ab9f6e062a 05-Sep-2013 Svetoslav <svetoslavganov@google.com> Bug fixes in the print dialog

1. Read/write async tasks of the persistence manger used by
the FusedPrintersProvider could be run more that once, so
create a new one every time.

2. The fake printer used to save to PDF should not be added
to printer history.

3. Removed print preview leftover code from the print dialog.

4. Save to PDF was not working on the second consecutive attempt.

5. The fisrt time the orientation change was ignored - regression

Change-Id: I8960ef2cf92dfeeec22fa8751ba8475092b5b65c
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
9186d0cb2bd325d9b52da15dbd513937c1e42caa 03-Sep-2013 Svetoslav Ganov <svetoslavganov@google.com> Bug fixes in the printer dialog activity and fused printer loader.

1. Fused printers loader was not using the discovered printers to update the
historical ones. Now if a historical printer is discovered we update its state
with the discovered, i.e. most recent, information.

2. Fixed a bug in the destination adapter of the print job config dialog that
was leading to a crash if all printers item is selected when there are no
discovered printers.

3. Updated the add printers asset in the all printers screen.

4. Historical printers were not persisted by the print dialog activity.

5. Reduced the number of printers we send per transation to avoid the binder
transaction size limit. Added sending of printers in chunks in a place
this was missing.

Change-Id: I88b54888360bc0e53b06bd260c2b832d0d6454b6
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
d26d4898fcc9b78f4b66118895c375384098205e 28-Aug-2013 Svetoslav Ganov <svetoslavganov@google.com> Print spooler security and some new print service facing APIs.

1. Updated the security mode of the print spooler. Now the spooler
is not signed with the system key, it is not a privileged app so if
it gets compromised (PDF rendering is a potential attack vector)
it cannot access dangerous permissions. Also only the system
can bind to the spooler.

2. Added APIs for asking a print service to start and stop tracking
a given printer. This is need for the case when the user selects
the printer and the print service should do a best effort to keep
the system updated for the current state of the printer.

3. Added APIs for putting a print job in a blocked state. A print
service would report the print job as blocked if for some reason
the printer cannot proceed, e.g. 99 pages are printed but there
is no paper for the last one. The user has to add more paper
and the print service can resume the job.

4. Changed the read/write APIs to use ParcelFileDescriptor instead
of FileDescriptor since the latter does not have a clean API for
detaching the wrapped Linux file descriptor when one wants to
push it to native.

5. Added API for getting the size of the printed document so the
print service can avoid handling big filed over cellular network
or ask the user if needed.

6. Now the print services that are preinstalled on the system image
are automatically enabled.

Change-Id: Ia06c311d3d21cabb9e1368f13928e11cd0030918
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
44720af55a8fdf991929983dad5d53c02851dd1e 21-Aug-2013 Svetoslav Ganov <svetoslavganov@google.com> Print UI bug fixing and printer discovery refactoring.

1. Added support for selecting a printer from the all printers activity
that is not in the initial printer selection drop down. The user
initially sees a sub set of the printers in the drop down and the
last option is to see all printers in a separate activity. Some
of the printers in the all printers activity are not shown in the
initial drop down.

2. Refactored printer discovery by adding (private for now) printer
discovery app facing APIs. These APIs are needed to support multiple
printer selection activities (print dialog and all printers activities)
and also the settings for showing all printers for a service.

Now multiple apps can request observing for printers and there is
a centralized mediator that ensures the same printer discovery
session is used. The mediator dispatches printer discovery specific
requests to print services. It also aggregates discovered printers
and delivers them to the interested apps. The mediator minimizes
printer discovery session creation and starting and stopping discovery
by sharing the same discovery session and discovery window with
multiple apps. Lastly, the mediator takes care of print services
enabled during discovery by bringing them up to the current
discovery state (create discovery session and start discovery if
needed). The mediator also reports disappearing of the printers
of a service removed during discovery and notifies a newly
registered observers for the currnet printers if the observers are
added during an active printer discovery session.

3. Fixed bugs in the print UI and implemented some UX tweaks.

Change-Id: I4d0b0c5a6c6f1809b2ba5dbc8e9d63ab3d48f1ef
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
269403b032f965ff3847eb982c2f697229dc5a92 15-Aug-2013 Svetoslav <svetoslavganov@google.com> Implemented advanced printer selection and API refactoring.

1. Added past printer history tracking and merging favorite printers
with discovered printers.

2. Added save as PDF support.

3. Added all printers activity with search capability and optional
add printers chooser (if any print service provides add printers
activity)

4. Refactored the printer discovery session APIs. Now one session
can have multiple window discovery windows and the session stores
the printers found during past discovery periods.

5. Merged the print spooler and the print spooler service - much
simpler and easier to maintain.

Change-Id: I4830b0eb6367e1c748b768a5ea9ea11baf36cfad
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java