Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55b409a9 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Iteration of the print sub-system.

1. Added APIs for adding partially initialized PrintInfo objects
   enabling light-weight lookps for print serivces that want to
   populate the list of available printers without querying each
   of them for its capabilities. This includes APIs for the system
   to request from a print service to update certain printers.

2. Fixed a bug in PrinterId#equals().

3. Added equals and hasCode implementaion to PrinterInfo. Also
   the defaul in PrinterInfo are now an array instead of a
   SparseArray - cheaper.

4. Now PrintJobConfigActivity works with partially specified
   printers. Specifically, if such a printer is selected the
   activity is requesting from the print service to update
   the printer. We are currently not handling the timeout case.
   It also handles udpated pritners.

Change-Id: I5e83e924ef597c9e22cbd06a971d4f4d3bd3a9c1
parent 85b1f883
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -18661,6 +18661,7 @@ package android.print {
    method public java.util.List<android.print.PrintAttributes.Tray> getOutputTrays();
    method public java.util.List<android.print.PrintAttributes.Resolution> getResolutions();
    method public int getStatus();
    method public boolean hasAllRequiredAttributes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
    field public static final int STATUS_READY = 1; // 0x1
@@ -18746,9 +18747,11 @@ package android.printservice {
    method protected void onDisconnected();
    method protected abstract void onPrintJobQueued(android.printservice.PrintJob);
    method protected void onRequestCancelPrintJob(android.printservice.PrintJob);
    method protected void onRequestUpdatePrinters(java.util.List<android.print.PrinterId>);
    method protected abstract void onStartPrinterDiscovery();
    method protected abstract void onStopPrinterDiscovery();
    method public final void removeDiscoveredPrinters(java.util.List<android.print.PrinterId>);
    method public final void updateDiscoveredPrinters(java.util.List<android.print.PrinterInfo>);
    field public static final java.lang.String SERVICE_INTERFACE = "android.printservice.PrintService";
    field public static final java.lang.String SERVICE_META_DATA = "android.printservice";
  }
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.print;

import android.content.ComponentName;
import android.print.IPrinterDiscoveryObserver;
import android.print.PrinterId;
import android.print.PrintJobInfo;


@@ -30,6 +31,7 @@ oneway interface IPrintSpoolerClient {
    void onPrintJobQueued(in PrintJobInfo printJob);
    void onStartPrinterDiscovery(IPrinterDiscoveryObserver observer);
    void onStopPrinterDiscovery();
    void onRequestUpdatePrinters(in List<PrinterId> printerIds);
    void onAllPrintJobsForServiceHandled(in ComponentName printService);
    void onAllPrintJobsHandled();
}
+3 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.print.PrinterInfo;
 * @hide
 */
oneway interface IPrinterDiscoveryObserver {
    void addDiscoveredPrinters(in List<PrinterInfo> printers);
    void removeDiscoveredPrinters(in List<PrinterId> printers);
    void onPrintersAdded(in List<PrinterInfo> printers);
    void onPrintersRemoved(in List<PrinterId> printers);
    void onPrintersUpdated(in List<PrinterInfo> printers);
}
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.print;
import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

/**
 * This class represents the unique id of a printer.
@@ -98,7 +99,7 @@ public final class PrinterId implements Parcelable {
        } else if (!mServiceComponentName.equals(other.mServiceComponentName)) {
            return false;
        }
        if (mLocalId != other.mLocalId) {
        if (!TextUtils.equals(mLocalId, other.mLocalId)) {
            return false;
        }
        return true;
+242 −94

File changed.

Preview size limit exceeded, changes collapsed.

Loading