diff --git a/api/current.txt b/api/current.txt index 7fe5728ec0d09..00a2b7a9a1d16 100644 --- a/api/current.txt +++ b/api/current.txt @@ -30330,7 +30330,7 @@ package android.print.pdf { package android.printservice { - public class CustomPrinterIconCallback { + public final class CustomPrinterIconCallback { method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon); } diff --git a/api/system-current.txt b/api/system-current.txt index dfaae6bf694bc..120f97b54de1c 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -32829,7 +32829,7 @@ package android.print.pdf { package android.printservice { - public class CustomPrinterIconCallback { + public final class CustomPrinterIconCallback { method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon); } diff --git a/api/test-current.txt b/api/test-current.txt index 88031cf9d505d..d5ecfd11fda2b 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -30402,7 +30402,7 @@ package android.print.pdf { package android.printservice { - public class CustomPrinterIconCallback { + public final class CustomPrinterIconCallback { method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon); } diff --git a/core/java/android/printservice/CustomPrinterIconCallback.java b/core/java/android/printservice/CustomPrinterIconCallback.java index 6b9d0d81dc558..a1fbdab8a3d49 100644 --- a/core/java/android/printservice/CustomPrinterIconCallback.java +++ b/core/java/android/printservice/CustomPrinterIconCallback.java @@ -27,7 +27,7 @@ import android.util.Log; /** * Callback for {@link PrinterDiscoverySession#onRequestCustomPrinterIcon}. */ -public class CustomPrinterIconCallback { +public final class CustomPrinterIconCallback { /** The printer the call back is for */ private final @NonNull PrinterId mPrinterId; private final @NonNull IPrintServiceClient mObserver; diff --git a/core/java/android/printservice/PrintJob.java b/core/java/android/printservice/PrintJob.java index 7a7ca2353b1d8..3226f343ce66b 100644 --- a/core/java/android/printservice/PrintJob.java +++ b/core/java/android/printservice/PrintJob.java @@ -347,18 +347,15 @@ public final class PrintJob { *

* This overrides any previously set status set via {@link #setStatus(CharSequence)}, * {@link #setStatus(int)}, {@link #block(String)}, or {@link #fail(String)}, - *

- * To clear the status use {@link #setStatus(CharSequence) setStatus(null)} * - * @param status The new status as a String resource. + * @param statusResId The new status as a String resource. If 0 the status will be empty. */ @MainThread - public void setStatus(@StringRes int status) { + public void setStatus(@StringRes int statusResId) { PrintService.throwIfNotCalledOnMainThread(); - Preconditions.checkArgument(status != 0, "status has to be != 0"); try { - mPrintServiceClient.setStatusRes(mCachedInfo.getId(), status, + mPrintServiceClient.setStatusRes(mCachedInfo.getId(), statusResId, mContext.getPackageName()); } catch (RemoteException re) { Log.e(LOG_TAG, "Error setting status for job: " + mCachedInfo.getId(), re); diff --git a/core/java/android/printservice/PrinterDiscoverySession.java b/core/java/android/printservice/PrinterDiscoverySession.java index 7b9533d732161..4987e8bd7ccbe 100644 --- a/core/java/android/printservice/PrinterDiscoverySession.java +++ b/core/java/android/printservice/PrinterDiscoverySession.java @@ -408,15 +408,15 @@ public abstract class PrinterDiscoverySession { public abstract void onStartPrinterStateTracking(@NonNull PrinterId printerId); /** - * Request the custom icon for a printer. Once the icon is available use - * {@link CustomPrinterIconCallback#onCustomPrinterIconLoaded} to send the data to the print - * service. + * Called by the system to request the custom icon for a printer. Once the icon is available the + * print services uses {@link CustomPrinterIconCallback#onCustomPrinterIconLoaded} to send the + * icon to the system. * * @param printerId The printer to icon belongs to. - * @param cancellationSignal Signal used to cancel the request - * @param callback Callback for returning the icon to the print spooler. + * @param cancellationSignal Signal used to cancel the request. + * @param callback Callback for returning the icon to the system. * - * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon() + * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon(boolean) */ public void onRequestCustomPrinterIcon(@NonNull PrinterId printerId, @NonNull CancellationSignal cancellationSignal,