Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -28864,6 +28864,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); } api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -30847,6 +30847,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); } api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -28745,7 +28745,9 @@ package android.print { method public java.lang.String getLabel(); method public android.print.PageRange[] getPages(); method public android.print.PrinterId getPrinterId(); method public float getProgress(); method public int getState(); method public java.lang.CharSequence getStatus(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.print.PrintJobInfo> CREATOR; field public static final int STATE_BLOCKED = 4; // 0x4 Loading Loading @@ -28864,6 +28866,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); } core/java/android/print/IPrintSpooler.aidl +17 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,23 @@ oneway interface IPrintSpooler { void createPrintJob(in PrintJobInfo printJob); void setPrintJobState(in PrintJobId printJobId, int status, String stateReason, IPrintSpoolerCallbacks callback, int sequence); /** * Set the progress of this print job * * @param printJobId The print job to update * @param progress The new progress */ void setProgress(in PrintJobId printJobId, in float progress); /** * Set the status of this print job * * @param printJobId The print job to update * @param status The new status, can be null */ void setStatus(in PrintJobId printJobId, in CharSequence status); void setPrintJobTag(in PrintJobId printJobId, String tag, IPrintSpoolerCallbacks callback, int sequence); void writePrintJobData(in ParcelFileDescriptor fd, in PrintJobId printJobId); Loading core/java/android/print/PrintJobInfo.java +91 −33 Original line number Diff line number Diff line Loading @@ -16,10 +16,15 @@ package android.print; import android.annotation.FloatRange; import android.annotation.Nullable; import android.annotation.TestApi; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.Preconditions; import java.util.Arrays; /** Loading Loading @@ -149,9 +154,6 @@ public final class PrintJobInfo implements Parcelable { /** How many copies to print. */ private int mCopies; /** Reason for the print job being in its current state. */ private String mStateReason; /** The pages to print */ private PageRange[] mPageRanges; Loading @@ -161,6 +163,12 @@ public final class PrintJobInfo implements Parcelable { /** Information about the printed document. */ private PrintDocumentInfo mDocumentInfo; /** The progress made on printing this job or -1 if not set. */ private float mProgress; /** A short string describing the status of this job. */ private CharSequence mStatus; /** Advanced printer specific options. */ private Bundle mAdvancedOptions; Loading @@ -169,7 +177,7 @@ public final class PrintJobInfo implements Parcelable { /** @hide*/ public PrintJobInfo() { /* do nothing */ mProgress = -1; } /** @hide */ Loading @@ -183,10 +191,11 @@ public final class PrintJobInfo implements Parcelable { mTag = other.mTag; mCreationTime = other.mCreationTime; mCopies = other.mCopies; mStateReason = other.mStateReason; mPageRanges = other.mPageRanges; mAttributes = other.mAttributes; mDocumentInfo = other.mDocumentInfo; mProgress = other.mProgress; mStatus = other.mStatus; mCanceling = other.mCanceling; mAdvancedOptions = other.mAdvancedOptions; } Loading @@ -201,7 +210,6 @@ public final class PrintJobInfo implements Parcelable { mTag = parcel.readString(); mCreationTime = parcel.readLong(); mCopies = parcel.readInt(); mStateReason = parcel.readString(); Parcelable[] parcelables = parcel.readParcelableArray(null); if (parcelables != null) { mPageRanges = new PageRange[parcelables.length]; Loading @@ -211,6 +219,8 @@ public final class PrintJobInfo implements Parcelable { } mAttributes = (PrintAttributes) parcel.readParcelable(null); mDocumentInfo = (PrintDocumentInfo) parcel.readParcelable(null); mProgress = parcel.readFloat(); mStatus = parcel.readCharSequence(); mCanceling = (parcel.readInt() == 1); mAdvancedOptions = parcel.readBundle(); } Loading @@ -227,7 +237,7 @@ public final class PrintJobInfo implements Parcelable { /** * Sets the unique print job id. * * @param The job id. * @param id The job id. * * @hide */ Loading Loading @@ -265,7 +275,7 @@ public final class PrintJobInfo implements Parcelable { } /** * Sets the unique target pritner id. * Sets the unique target printer id. * * @param printerId The target printer id. * Loading Loading @@ -325,6 +335,30 @@ public final class PrintJobInfo implements Parcelable { mState = state; } /** * Sets the progress of the print job. * * @param progress the progress of the job * * @hide */ public void setProgress(@FloatRange(from=0.0, to=1.0) float progress) { Preconditions.checkArgumentInRange(progress, 0, 1, "progress"); mProgress = progress; } /** * Sets the status of the print job. * * @param status the status of the job, can be null * * @hide */ public void setStatus(@Nullable CharSequence status) { mStatus = status; } /** * Sets the owning application id. * Loading Loading @@ -415,30 +449,6 @@ public final class PrintJobInfo implements Parcelable { mCopies = copyCount; } /** * Gets the reason for the print job being in the current state. * * @return The reason, or null if there is no reason or the * reason is unknown. * * @hide */ public String getStateReason() { return mStateReason; } /** * Sets the reason for the print job being in the current state. * * @param stateReason The reason, or null if there is no reason * or the reason is unknown. * * @hide */ public void setStateReason(String stateReason) { mStateReason = stateReason; } /** * Gets the included pages. * Loading Loading @@ -604,10 +614,11 @@ public final class PrintJobInfo implements Parcelable { parcel.writeString(mTag); parcel.writeLong(mCreationTime); parcel.writeInt(mCopies); parcel.writeString(mStateReason); parcel.writeParcelableArray(mPageRanges, flags); parcel.writeParcelable(mAttributes, flags); parcel.writeParcelable(mDocumentInfo, 0); parcel.writeFloat(mProgress); parcel.writeCharSequence(mStatus); parcel.writeInt(mCanceling ? 1 : 0); parcel.writeBundle(mAdvancedOptions); } Loading @@ -631,6 +642,9 @@ public final class PrintJobInfo implements Parcelable { builder.append(", pages: " + (mPageRanges != null ? Arrays.toString(mPageRanges) : null)); builder.append(", hasAdvancedOptions: " + (mAdvancedOptions != null)); builder.append(", progress: " + mProgress); builder.append(", status: " + (mStatus != null ? mStatus.toString() : null)); builder.append("}"); return builder.toString(); } Loading Loading @@ -665,6 +679,28 @@ public final class PrintJobInfo implements Parcelable { } } /** * Get the progress that has been made printing this job. * * @return the print progress or -1 if not set * @hide */ @TestApi public float getProgress() { return mProgress; } /** * Get the status of this job. * * @return the status of this job or null if not set * @hide */ @TestApi public @Nullable CharSequence getStatus() { return mStatus; } /** * Builder for creating a {@link PrintJobInfo}. */ Loading Loading @@ -710,6 +746,28 @@ public final class PrintJobInfo implements Parcelable { mPrototype.mPageRanges = pages; } /** * Sets the progress of the print job. * * @param progress the progress of the job * @hide */ public void setProgress(@FloatRange(from=0.0, to=1.0) float progress) { Preconditions.checkArgumentInRange(progress, 0, 1, "progress"); mPrototype.mProgress = progress; } /** * Sets the status of the print job. * * @param status the status of the job, can be null * @hide */ public void setStatus(@Nullable CharSequence status) { mPrototype.mStatus = status; } /** * Puts an advanced (printer specific) option. * Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -28864,6 +28864,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); }
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -30847,6 +30847,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); }
api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -28745,7 +28745,9 @@ package android.print { method public java.lang.String getLabel(); method public android.print.PageRange[] getPages(); method public android.print.PrinterId getPrinterId(); method public float getProgress(); method public int getState(); method public java.lang.CharSequence getStatus(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.print.PrintJobInfo> CREATOR; field public static final int STATE_BLOCKED = 4; // 0x4 Loading Loading @@ -28864,6 +28866,8 @@ package android.printservice { method public boolean isFailed(); method public boolean isQueued(); method public boolean isStarted(); method public void setProgress(float); method public void setStatus(java.lang.CharSequence); method public boolean setTag(java.lang.String); method public boolean start(); }
core/java/android/print/IPrintSpooler.aidl +17 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,23 @@ oneway interface IPrintSpooler { void createPrintJob(in PrintJobInfo printJob); void setPrintJobState(in PrintJobId printJobId, int status, String stateReason, IPrintSpoolerCallbacks callback, int sequence); /** * Set the progress of this print job * * @param printJobId The print job to update * @param progress The new progress */ void setProgress(in PrintJobId printJobId, in float progress); /** * Set the status of this print job * * @param printJobId The print job to update * @param status The new status, can be null */ void setStatus(in PrintJobId printJobId, in CharSequence status); void setPrintJobTag(in PrintJobId printJobId, String tag, IPrintSpoolerCallbacks callback, int sequence); void writePrintJobData(in ParcelFileDescriptor fd, in PrintJobId printJobId); Loading
core/java/android/print/PrintJobInfo.java +91 −33 Original line number Diff line number Diff line Loading @@ -16,10 +16,15 @@ package android.print; import android.annotation.FloatRange; import android.annotation.Nullable; import android.annotation.TestApi; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.Preconditions; import java.util.Arrays; /** Loading Loading @@ -149,9 +154,6 @@ public final class PrintJobInfo implements Parcelable { /** How many copies to print. */ private int mCopies; /** Reason for the print job being in its current state. */ private String mStateReason; /** The pages to print */ private PageRange[] mPageRanges; Loading @@ -161,6 +163,12 @@ public final class PrintJobInfo implements Parcelable { /** Information about the printed document. */ private PrintDocumentInfo mDocumentInfo; /** The progress made on printing this job or -1 if not set. */ private float mProgress; /** A short string describing the status of this job. */ private CharSequence mStatus; /** Advanced printer specific options. */ private Bundle mAdvancedOptions; Loading @@ -169,7 +177,7 @@ public final class PrintJobInfo implements Parcelable { /** @hide*/ public PrintJobInfo() { /* do nothing */ mProgress = -1; } /** @hide */ Loading @@ -183,10 +191,11 @@ public final class PrintJobInfo implements Parcelable { mTag = other.mTag; mCreationTime = other.mCreationTime; mCopies = other.mCopies; mStateReason = other.mStateReason; mPageRanges = other.mPageRanges; mAttributes = other.mAttributes; mDocumentInfo = other.mDocumentInfo; mProgress = other.mProgress; mStatus = other.mStatus; mCanceling = other.mCanceling; mAdvancedOptions = other.mAdvancedOptions; } Loading @@ -201,7 +210,6 @@ public final class PrintJobInfo implements Parcelable { mTag = parcel.readString(); mCreationTime = parcel.readLong(); mCopies = parcel.readInt(); mStateReason = parcel.readString(); Parcelable[] parcelables = parcel.readParcelableArray(null); if (parcelables != null) { mPageRanges = new PageRange[parcelables.length]; Loading @@ -211,6 +219,8 @@ public final class PrintJobInfo implements Parcelable { } mAttributes = (PrintAttributes) parcel.readParcelable(null); mDocumentInfo = (PrintDocumentInfo) parcel.readParcelable(null); mProgress = parcel.readFloat(); mStatus = parcel.readCharSequence(); mCanceling = (parcel.readInt() == 1); mAdvancedOptions = parcel.readBundle(); } Loading @@ -227,7 +237,7 @@ public final class PrintJobInfo implements Parcelable { /** * Sets the unique print job id. * * @param The job id. * @param id The job id. * * @hide */ Loading Loading @@ -265,7 +275,7 @@ public final class PrintJobInfo implements Parcelable { } /** * Sets the unique target pritner id. * Sets the unique target printer id. * * @param printerId The target printer id. * Loading Loading @@ -325,6 +335,30 @@ public final class PrintJobInfo implements Parcelable { mState = state; } /** * Sets the progress of the print job. * * @param progress the progress of the job * * @hide */ public void setProgress(@FloatRange(from=0.0, to=1.0) float progress) { Preconditions.checkArgumentInRange(progress, 0, 1, "progress"); mProgress = progress; } /** * Sets the status of the print job. * * @param status the status of the job, can be null * * @hide */ public void setStatus(@Nullable CharSequence status) { mStatus = status; } /** * Sets the owning application id. * Loading Loading @@ -415,30 +449,6 @@ public final class PrintJobInfo implements Parcelable { mCopies = copyCount; } /** * Gets the reason for the print job being in the current state. * * @return The reason, or null if there is no reason or the * reason is unknown. * * @hide */ public String getStateReason() { return mStateReason; } /** * Sets the reason for the print job being in the current state. * * @param stateReason The reason, or null if there is no reason * or the reason is unknown. * * @hide */ public void setStateReason(String stateReason) { mStateReason = stateReason; } /** * Gets the included pages. * Loading Loading @@ -604,10 +614,11 @@ public final class PrintJobInfo implements Parcelable { parcel.writeString(mTag); parcel.writeLong(mCreationTime); parcel.writeInt(mCopies); parcel.writeString(mStateReason); parcel.writeParcelableArray(mPageRanges, flags); parcel.writeParcelable(mAttributes, flags); parcel.writeParcelable(mDocumentInfo, 0); parcel.writeFloat(mProgress); parcel.writeCharSequence(mStatus); parcel.writeInt(mCanceling ? 1 : 0); parcel.writeBundle(mAdvancedOptions); } Loading @@ -631,6 +642,9 @@ public final class PrintJobInfo implements Parcelable { builder.append(", pages: " + (mPageRanges != null ? Arrays.toString(mPageRanges) : null)); builder.append(", hasAdvancedOptions: " + (mAdvancedOptions != null)); builder.append(", progress: " + mProgress); builder.append(", status: " + (mStatus != null ? mStatus.toString() : null)); builder.append("}"); return builder.toString(); } Loading Loading @@ -665,6 +679,28 @@ public final class PrintJobInfo implements Parcelable { } } /** * Get the progress that has been made printing this job. * * @return the print progress or -1 if not set * @hide */ @TestApi public float getProgress() { return mProgress; } /** * Get the status of this job. * * @return the status of this job or null if not set * @hide */ @TestApi public @Nullable CharSequence getStatus() { return mStatus; } /** * Builder for creating a {@link PrintJobInfo}. */ Loading Loading @@ -710,6 +746,28 @@ public final class PrintJobInfo implements Parcelable { mPrototype.mPageRanges = pages; } /** * Sets the progress of the print job. * * @param progress the progress of the job * @hide */ public void setProgress(@FloatRange(from=0.0, to=1.0) float progress) { Preconditions.checkArgumentInRange(progress, 0, 1, "progress"); mPrototype.mProgress = progress; } /** * Sets the status of the print job. * * @param status the status of the job, can be null * @hide */ public void setStatus(@Nullable CharSequence status) { mPrototype.mStatus = status; } /** * Puts an advanced (printer specific) option. * Loading