diff options
| author | Philip P. Moltmann <moltmann@google.com> | 2015-12-01 14:44:24 -0800 |
|---|---|---|
| committer | Philip P. Moltmann <moltmann@google.com> | 2015-12-21 09:54:57 -0800 |
| commit | bb9f686b40743df2642b7d3b7778dbf7284ae665 (patch) | |
| tree | 739c0a8bb1458793decc646a901adff34804adba /core/java/android/printservice/PrintService.java | |
| parent | b819f8983f72b0642a3e1f889a3de31d35484c22 (diff) | |
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
Diffstat (limited to 'core/java/android/printservice/PrintService.java')
| -rw-r--r-- | core/java/android/printservice/PrintService.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/core/java/android/printservice/PrintService.java b/core/java/android/printservice/PrintService.java index 6295822c7e4a..acebd9d84a3e 100644 --- a/core/java/android/printservice/PrintService.java +++ b/core/java/android/printservice/PrintService.java @@ -391,6 +391,12 @@ public abstract class PrintService extends Service { } @Override + public void requestCustomPrinterIcon(PrinterId printerId) { + mHandler.obtainMessage(ServiceHandler.MSG_REQUEST_CUSTOM_PRINTER_ICON, + printerId).sendToTarget(); + } + + @Override public void stopPrinterStateTracking(PrinterId printerId) { mHandler.obtainMessage(ServiceHandler.MSG_STOP_PRINTER_STATE_TRACKING, printerId).sendToTarget(); @@ -423,10 +429,11 @@ public abstract class PrintService extends Service { public static final int MSG_STOP_PRINTER_DISCOVERY = 4; public static final int MSG_VALIDATE_PRINTERS = 5; public static final int MSG_START_PRINTER_STATE_TRACKING = 6; - public static final int MSG_STOP_PRINTER_STATE_TRACKING = 7; - public static final int MSG_ON_PRINTJOB_QUEUED = 8; - public static final int MSG_ON_REQUEST_CANCEL_PRINTJOB = 9; - public static final int MSG_SET_CLIENT = 10; + public static final int MSG_REQUEST_CUSTOM_PRINTER_ICON = 7; + public static final int MSG_STOP_PRINTER_STATE_TRACKING = 8; + public static final int MSG_ON_PRINTJOB_QUEUED = 9; + public static final int MSG_ON_REQUEST_CANCEL_PRINTJOB = 10; + public static final int MSG_SET_CLIENT = 11; public ServiceHandler(Looper looper) { super(looper, null, true); @@ -508,6 +515,17 @@ public abstract class PrintService extends Service { } } break; + case MSG_REQUEST_CUSTOM_PRINTER_ICON: { + if (DEBUG) { + Log.i(LOG_TAG, "MSG_REQUEST_CUSTOM_PRINTER_ICON " + + getPackageName()); + } + if (mDiscoverySession != null) { + PrinterId printerId = (PrinterId) message.obj; + mDiscoverySession.requestCustomPrinterIcon(printerId); + } + } break; + case MSG_STOP_PRINTER_STATE_TRACKING: { if (DEBUG) { Log.i(LOG_TAG, "MSG_STOP_PRINTER_STATE_TRACKING " |
