Loading core/java/android/print/PrintJobInfo.java +5 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public final class PrintJobInfo implements Parcelable { /** The name of the printer - internally used */ private String mPrinterName; /** The status of the print job. */ /** The state of the print job. */ private int mState; /** The id of the app that created the job. */ Loading Loading @@ -555,7 +555,7 @@ public final class PrintJobInfo implements Parcelable { builder.append("PrintJobInfo{"); builder.append("label: ").append(mLabel); builder.append(", id: ").append(mId); builder.append(", status: ").append(stateToString(mState)); builder.append(", state: ").append(stateToString(mState)); builder.append(", printer: " + mPrinterId); builder.append(", tag: ").append(mTag); builder.append(", creationTime: " + mCreationTime); Loading Loading @@ -583,6 +583,9 @@ public final class PrintJobInfo implements Parcelable { case STATE_STARTED: { return "STATE_STARTED"; } case STATE_BLOCKED: { return "STATE_BLOCKED"; } case STATE_FAILED: { return "STATE_FAILED"; } Loading core/java/android/print/PrintManager.java +17 −6 Original line number Diff line number Diff line Loading @@ -146,11 +146,14 @@ public final class PrintManager { switch (message.what) { case MSG_NOTIFY_PRINT_JOB_STATE_CHANGED: { SomeArgs args = (SomeArgs) message.obj; PrintJobStateChangeListener listener = (PrintJobStateChangeListener) args.arg1; PrintJobStateChangeListenerWrapper wrapper = (PrintJobStateChangeListenerWrapper) args.arg1; PrintJobStateChangeListener listener = wrapper.getListener(); if (listener != null) { PrintJobId printJobId = (PrintJobId) args.arg2; args.recycle(); listener.onPrintJobStateChanged(printJobId); } args.recycle(); } break; } } Loading Loading @@ -217,6 +220,7 @@ public final class PrintManager { if (mPrintJobStateChangeListeners.isEmpty()) { mPrintJobStateChangeListeners = null; } wrappedListener.destroy(); try { mService.removePrintJobStateChangeListener(wrappedListener, mUserId); } catch (RemoteException re) { Loading Loading @@ -769,12 +773,19 @@ public final class PrintManager { PrintJobStateChangeListener listener = mWeakListener.get(); if (handler != null && listener != null) { SomeArgs args = SomeArgs.obtain(); args.arg1 = listener; args.arg1 = this; args.arg2 = printJobId; handler.obtainMessage(MSG_NOTIFY_PRINT_JOB_STATE_CHANGED, args).sendToTarget(); } } public void destroy() { mWeakListener.clear(); } public PrintJobStateChangeListener getListener() { return mWeakListener.get(); } } } packages/PrintSpooler/src/com/android/printspooler/NotificationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ public class NotificationController { if (i == printJobCount - 1) { builder.setLargeIcon(((BitmapDrawable) mContext.getResources().getDrawable( computeNotificationIcon(printJob))).getBitmap()); builder.setSmallIcon(com.android.internal.R.drawable.ic_print); builder.setSmallIcon(computeNotificationIcon(printJob)); builder.setContentTitle(computeNotificationTitle(printJob)); builder.setContentText(printJob.getPrinterName()); } Loading services/java/com/android/server/print/RemotePrintService.java +1 −1 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ final class RemotePrintService implements DeathRecipient { final long identity = Binder.clearCallingIdentity(); try { return service.mSpooler.getPrintJobInfos(service.mComponentName, PrintJobInfo.STATE_ANY_VISIBLE_TO_CLIENTS, PrintManager.APP_ID_ANY); PrintJobInfo.STATE_ANY_SCHEDULED, PrintManager.APP_ID_ANY); } finally { Binder.restoreCallingIdentity(identity); } Loading Loading
core/java/android/print/PrintJobInfo.java +5 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public final class PrintJobInfo implements Parcelable { /** The name of the printer - internally used */ private String mPrinterName; /** The status of the print job. */ /** The state of the print job. */ private int mState; /** The id of the app that created the job. */ Loading Loading @@ -555,7 +555,7 @@ public final class PrintJobInfo implements Parcelable { builder.append("PrintJobInfo{"); builder.append("label: ").append(mLabel); builder.append(", id: ").append(mId); builder.append(", status: ").append(stateToString(mState)); builder.append(", state: ").append(stateToString(mState)); builder.append(", printer: " + mPrinterId); builder.append(", tag: ").append(mTag); builder.append(", creationTime: " + mCreationTime); Loading Loading @@ -583,6 +583,9 @@ public final class PrintJobInfo implements Parcelable { case STATE_STARTED: { return "STATE_STARTED"; } case STATE_BLOCKED: { return "STATE_BLOCKED"; } case STATE_FAILED: { return "STATE_FAILED"; } Loading
core/java/android/print/PrintManager.java +17 −6 Original line number Diff line number Diff line Loading @@ -146,11 +146,14 @@ public final class PrintManager { switch (message.what) { case MSG_NOTIFY_PRINT_JOB_STATE_CHANGED: { SomeArgs args = (SomeArgs) message.obj; PrintJobStateChangeListener listener = (PrintJobStateChangeListener) args.arg1; PrintJobStateChangeListenerWrapper wrapper = (PrintJobStateChangeListenerWrapper) args.arg1; PrintJobStateChangeListener listener = wrapper.getListener(); if (listener != null) { PrintJobId printJobId = (PrintJobId) args.arg2; args.recycle(); listener.onPrintJobStateChanged(printJobId); } args.recycle(); } break; } } Loading Loading @@ -217,6 +220,7 @@ public final class PrintManager { if (mPrintJobStateChangeListeners.isEmpty()) { mPrintJobStateChangeListeners = null; } wrappedListener.destroy(); try { mService.removePrintJobStateChangeListener(wrappedListener, mUserId); } catch (RemoteException re) { Loading Loading @@ -769,12 +773,19 @@ public final class PrintManager { PrintJobStateChangeListener listener = mWeakListener.get(); if (handler != null && listener != null) { SomeArgs args = SomeArgs.obtain(); args.arg1 = listener; args.arg1 = this; args.arg2 = printJobId; handler.obtainMessage(MSG_NOTIFY_PRINT_JOB_STATE_CHANGED, args).sendToTarget(); } } public void destroy() { mWeakListener.clear(); } public PrintJobStateChangeListener getListener() { return mWeakListener.get(); } } }
packages/PrintSpooler/src/com/android/printspooler/NotificationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ public class NotificationController { if (i == printJobCount - 1) { builder.setLargeIcon(((BitmapDrawable) mContext.getResources().getDrawable( computeNotificationIcon(printJob))).getBitmap()); builder.setSmallIcon(com.android.internal.R.drawable.ic_print); builder.setSmallIcon(computeNotificationIcon(printJob)); builder.setContentTitle(computeNotificationTitle(printJob)); builder.setContentText(printJob.getPrinterName()); } Loading
services/java/com/android/server/print/RemotePrintService.java +1 −1 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ final class RemotePrintService implements DeathRecipient { final long identity = Binder.clearCallingIdentity(); try { return service.mSpooler.getPrintJobInfos(service.mComponentName, PrintJobInfo.STATE_ANY_VISIBLE_TO_CLIENTS, PrintManager.APP_ID_ANY); PrintJobInfo.STATE_ANY_SCHEDULED, PrintManager.APP_ID_ANY); } finally { Binder.restoreCallingIdentity(identity); } Loading