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
diff --git a/core/java/android/print/PrintManager.java b/core/java/android/print/PrintManager.java
index 636b9d4..531dcb2 100644
--- a/core/java/android/print/PrintManager.java
+++ b/core/java/android/print/PrintManager.java
@@ -374,14 +374,14 @@
@Override
public void onLayoutFinished(PrintDocumentInfo info, boolean changed) {
+ if (info == null) {
+ throw new NullPointerException("document info cannot be null");
+ }
final ILayoutResultCallback callback;
synchronized (mLock) {
callback = mCallback;
clearLocked();
}
- if (info == null) {
- throw new IllegalArgumentException("info cannot be null");
- }
if (callback != null) {
try {
callback.onLayoutFinished(info, changed, mSequence);