Merge "Print API for N: Fix docs and change interfaces as requested." into nyc-dev am: 50a871857d
am: a70594be57
* commit 'a70594be57fb4cdd636a63d642e09d13a4fa2158':
Print API for N: Fix docs and change interfaces as requested.
Change-Id: Iff2290944bc7f23ab995eff1ebb381b3ffa5e996
This commit is contained in:
@@ -30330,7 +30330,7 @@ package android.print.pdf {
|
|||||||
|
|
||||||
package android.printservice {
|
package android.printservice {
|
||||||
|
|
||||||
public class CustomPrinterIconCallback {
|
public final class CustomPrinterIconCallback {
|
||||||
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32829,7 +32829,7 @@ package android.print.pdf {
|
|||||||
|
|
||||||
package android.printservice {
|
package android.printservice {
|
||||||
|
|
||||||
public class CustomPrinterIconCallback {
|
public final class CustomPrinterIconCallback {
|
||||||
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30402,7 +30402,7 @@ package android.print.pdf {
|
|||||||
|
|
||||||
package android.printservice {
|
package android.printservice {
|
||||||
|
|
||||||
public class CustomPrinterIconCallback {
|
public final class CustomPrinterIconCallback {
|
||||||
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import android.util.Log;
|
|||||||
/**
|
/**
|
||||||
* Callback for {@link PrinterDiscoverySession#onRequestCustomPrinterIcon}.
|
* Callback for {@link PrinterDiscoverySession#onRequestCustomPrinterIcon}.
|
||||||
*/
|
*/
|
||||||
public class CustomPrinterIconCallback {
|
public final class CustomPrinterIconCallback {
|
||||||
/** The printer the call back is for */
|
/** The printer the call back is for */
|
||||||
private final @NonNull PrinterId mPrinterId;
|
private final @NonNull PrinterId mPrinterId;
|
||||||
private final @NonNull IPrintServiceClient mObserver;
|
private final @NonNull IPrintServiceClient mObserver;
|
||||||
|
|||||||
@@ -347,18 +347,15 @@ public final class PrintJob {
|
|||||||
* <p />
|
* <p />
|
||||||
* This overrides any previously set status set via {@link #setStatus(CharSequence)},
|
* This overrides any previously set status set via {@link #setStatus(CharSequence)},
|
||||||
* {@link #setStatus(int)}, {@link #block(String)}, or {@link #fail(String)},
|
* {@link #setStatus(int)}, {@link #block(String)}, or {@link #fail(String)},
|
||||||
* <p />
|
|
||||||
* To clear the status use {@link #setStatus(CharSequence) <code>setStatus(null)</code>}
|
|
||||||
*
|
*
|
||||||
* @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
|
@MainThread
|
||||||
public void setStatus(@StringRes int status) {
|
public void setStatus(@StringRes int statusResId) {
|
||||||
PrintService.throwIfNotCalledOnMainThread();
|
PrintService.throwIfNotCalledOnMainThread();
|
||||||
Preconditions.checkArgument(status != 0, "status has to be != 0");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mPrintServiceClient.setStatusRes(mCachedInfo.getId(), status,
|
mPrintServiceClient.setStatusRes(mCachedInfo.getId(), statusResId,
|
||||||
mContext.getPackageName());
|
mContext.getPackageName());
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(LOG_TAG, "Error setting status for job: " + mCachedInfo.getId(), re);
|
Log.e(LOG_TAG, "Error setting status for job: " + mCachedInfo.getId(), re);
|
||||||
|
|||||||
@@ -408,15 +408,15 @@ public abstract class PrinterDiscoverySession {
|
|||||||
public abstract void onStartPrinterStateTracking(@NonNull PrinterId printerId);
|
public abstract void onStartPrinterStateTracking(@NonNull PrinterId printerId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request the custom icon for a printer. Once the icon is available use
|
* Called by the system to request the custom icon for a printer. Once the icon is available the
|
||||||
* {@link CustomPrinterIconCallback#onCustomPrinterIconLoaded} to send the data to the print
|
* print services uses {@link CustomPrinterIconCallback#onCustomPrinterIconLoaded} to send the
|
||||||
* service.
|
* icon to the system.
|
||||||
*
|
*
|
||||||
* @param printerId The printer to icon belongs to.
|
* @param printerId The printer to icon belongs to.
|
||||||
* @param cancellationSignal Signal used to cancel the request
|
* @param cancellationSignal Signal used to cancel the request.
|
||||||
* @param callback Callback for returning the icon to the print spooler.
|
* @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,
|
public void onRequestCustomPrinterIcon(@NonNull PrinterId printerId,
|
||||||
@NonNull CancellationSignal cancellationSignal,
|
@NonNull CancellationSignal cancellationSignal,
|
||||||
|
|||||||
Reference in New Issue
Block a user