History log of /frameworks/base/core/java/android/print/PrinterId.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
798bed6cc7d273e72b0253288605db9cd2b57740 11-Aug-2013 Svetoslav Ganov <svetoslavganov@google.com> Refinement of the print service APIs.

1. Factored out the printer discovery APIs of a print service in a
dedicated session object that is created by the print service on
demand. This ensures that added/removed/updated printers from
one session do not interfere with another session.

2. Updated the app facing APIs to pass in a document info along
with a printed file. Also exposed the print file adapter so
apps that create a temporary file for printing can intercept
when it is read by the system so the file can be deleted.

3. Updated the print service documentation.

Change-Id: I3473d586c26d8bda1cf7e2bdacb441aa9df982ed
/frameworks/base/core/java/android/print/PrinterId.java
8c43376ea83a67414bd6823a472b76d41160239e 02-Aug-2013 Svetoslav Ganov <svetoslavganov@google.com> First cut of the print notifications.

1. Added notifications for a queued print job, for a started print job,
for ongoing canceling a print job, and for a failed print job. The
notifications for queued and started state have a cancel action. The
notification for failed print job has a cancel and a restart action.

2. Propagating failure message from the print service to the notifications.

3. PrintJobConfigActivity was not setting the initial value for the
print job copies and was not updating the UI immediately after creation.

4. Refactored PrintJobConfigActivity to avoid using the hack to avoid
reaction for item selection change in a spinner for an event that
happened before the callback was registered.

5. Removed the label attribute from PrinterInfo and now PrinterId is
composed of the printer name and the service component name. This
is nice since for restarting print jobs we do not need to store
information about the printer except the printer id which is
already part of the PrintJobInfo's data. Also the printer name
is not expected to change anyway.

6. Allowing cancellation of a queued print job. Also no print job is
cancelled without asking the managing print service to do that.
Before we were immediately canceling print jobs in queued state
but it was possible for a buggy print service to not set the
print job state to started before starting to do expensive work
that will not be canceled.

7. PrintServiceInfo was throwing an exception the the meta-data
XML for the print service was not well-formed which would crash
the system process. Now we just ignore not well-formed meta-data.

8. Removed unused permissions from the PrintSpooler's manifest.

Change-Id: Iba2dd14b487f56e137b90d1da17c3033422ab5e6
/frameworks/base/core/java/android/print/PrinterId.java
55b409a97cf6376399a0940313ea852368727d6f 01-Aug-2013 Svetoslav Ganov <svetoslavganov@google.com> Iteration of the print sub-system.

1. Added APIs for adding partially initialized PrintInfo objects
enabling light-weight lookps for print serivces that want to
populate the list of available printers without querying each
of them for its capabilities. This includes APIs for the system
to request from a print service to update certain printers.

2. Fixed a bug in PrinterId#equals().

3. Added equals and hasCode implementaion to PrinterInfo. Also
the defaul in PrinterInfo are now an array instead of a
SparseArray - cheaper.

4. Now PrintJobConfigActivity works with partially specified
printers. Specifically, if such a printer is selected the
activity is requesting from the print service to update
the printer. We are currently not handling the timeout case.
It also handles udpated pritners.

Change-Id: I5e83e924ef597c9e22cbd06a971d4f4d3bd3a9c1
/frameworks/base/core/java/android/print/PrinterId.java
88d199130d44c6bacb383a7757e782cf97483c68 22-Jul-2013 Svetoslav Ganov <svetoslavganov@google.com> Implement persistence/restoring of print spooler state.

1. Implemented the persistence and restoring of the print spooler state.
The print spooler state is saved as an XML on every print job change
and is restored when we bind to the spooler. The system does not
unbind from the spooler until the state persistence completes. We
are now storing the entire state, i.e. all print jobs, when a single
one changes. This is not optimal but we are not expecting to have
many such at the same time, so for now we err for simplicity of
implementation.

2. Enforcing a non-empty print job name.

3. Hidden the STATE_CREATED print job state which should never be visible to a
client since this is the state of a print job during construction, i.e. the
print dialog is up and we are doing back and forth with the app.

4. Fixed some PrintAttributes APIs that were incorrectly taking in a PackageManager
instance.

5. Updated the PrintSpooler build file due to splitting the framework into multiple
jars.

Change-Id: I52c88eaa1ec9c64920359cc143c79832a4c3d25b
/frameworks/base/core/java/android/print/PrinterId.java
a00271533f639c8ed36429c663889ac9f654bc72 25-Jun-2013 Svetoslav Ganov <svetoslavganov@google.com> Refactoring of the print sub-system and API clean up.

1. Now a user state has ins own spooler since the spooler app is
running per user. The user state registers an observer for the state
of the spooler to get information needed to orchestrate unbinding
from print serivces that have no work and eventually unbinding from
the spooler when all no service has any work.

2. Abstracted a remote print service from the perspective of the system
in a class that is transparently managing binding and unbinding to
the remote instance.

3. Abstracted the remote print spooler to transparently manage binding
and unbinding to the remote instance when there is work and when
there is no work, respectively.

4. Cleaned up the print document adapter (ex-PrintAdapter) APIs to
enable implementing the all callbacks on a thread of choice. If
the document is really small, using the main thread makes sense.

Now if an app that does not need the UI state to layout the printed
content, it can schedule all the work for allocating resources, laying
out, writing, and releasing resources on a dedicated thread.

5. Added info class for the printed document that is now propagated
the the print services. A print service gets an instance of a
new document class that encapsulates the document info and a method
to access the document's data.

6. Added APIs for describing the type of a document to the new document
info class. This allows a print service to do smarts based on the
doc type. For now we have only photo and document types.

7. Renamed the systemReady method for system services that implement
it with different semantics to systemRunning. Such methods assume
the the service can run third-party code which is not the same as
systemReady.

8. Cleaned up the print job configuration activity.

9. Sigh... code clean up here and there. Factoring out classes to
improve readability.

Change-Id: I637ba28412793166cbf519273fdf022241159a92
/frameworks/base/core/java/android/print/PrinterId.java
4b9a4d16872bbb50712e007b419ac0b35ff1582d 12-Jun-2013 Svetoslav Ganov <svetoslavganov@google.com> Print - platform APIs

Related changes:
Skia (inlcude PDF APIs): https://googleplex-android-review.googlesource.com/#/c/305814/
Canvas to PDF: https://googleplex-android-review.googlesource.com/#/c/319367/
Settings (initial version): https://googleplex-android-review.googlesource.com/#/c/306077/
Build: https://googleplex-android-review.googlesource.com/#/c/292437/
Sample print services: https://googleplex-android-review.googlesource.com/#/c/281785/

Change-Id: I104d12efd12577f05c7b9b2a5e5e49125c0f09da
/frameworks/base/core/java/android/print/PrinterId.java