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

Commit 44720af5 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Print UI bug fixing and printer discovery refactoring.

1. Added support for selecting a printer from the all printers activity
   that is not in the initial printer selection drop down. The user
   initially sees a sub set of the printers in the drop down and the
   last option is to see all printers in a separate activity. Some
   of the printers in the all printers activity are not shown in the
   initial drop down.

2. Refactored printer discovery by adding (private for now) printer
   discovery app facing APIs. These APIs are needed to support multiple
   printer selection activities (print dialog and all printers activities)
   and also the settings for showing all printers for a service.

   Now multiple apps can request observing for printers and there is
   a centralized mediator that ensures the same printer discovery
   session is used. The mediator dispatches printer discovery specific
   requests to print services. It also aggregates discovered printers
   and delivers them to the interested apps. The mediator minimizes
   printer discovery session creation and starting and stopping discovery
   by sharing the same discovery session and discovery window with
   multiple apps. Lastly, the mediator takes care of print services
   enabled during discovery by bringing them up to the current
   discovery state (create discovery session and start discovery if
   needed). The mediator also reports disappearing of the printers
   of a service removed during discovery and notifies a newly
   registered observers for the currnet printers if the observers are
   added during an active printer discovery session.

3. Fixed bugs in the print UI and implemented some UX tweaks.

Change-Id: I4d0b0c5a6c6f1809b2ba5dbc8e9d63ab3d48f1ef
parent 4359d564
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ LOCAL_SRC_FILES += \
	core/java/android/os/IVibratorService.aidl \
	core/java/android/service/notification/INotificationListener.aidl \
	core/java/android/print/ILayoutResultCallback.aidl \
	core/java/android/print/IPrinterDiscoveryObserver.aidl \
	core/java/android/print/IPrintDocumentAdapter.aidl \
	core/java/android/print/IPrintClient.aidl \
	core/java/android/print/IPrintManager.aidl \
+0 −2
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package android.os;

import android.util.ArrayMap;

import java.util.HashMap;

/**
 * Takes care of the grunt work of maintaining a list of remote interfaces,
 * typically for the use of performing callbacks from a
+10 −0
Original line number Diff line number Diff line
@@ -16,8 +16,10 @@

package android.print;

import android.print.IPrinterDiscoveryObserver;
import android.print.IPrintDocumentAdapter;
import android.print.IPrintClient;
import android.print.PrinterId;
import android.print.PrintJobInfo;
import android.print.PrintAttributes;

@@ -34,4 +36,12 @@ interface IPrintManager {
            int appId, int userId);
    void cancelPrintJob(int printJobId, int appId, int userId);
    void restartPrintJob(int printJobId, int appId, int userId);

    void createPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, int userId);
    void startPrinterDiscovery(in IPrinterDiscoveryObserver observer,
            in List<PrinterId> priorityList, int userId);
    void stopPrinterDiscovery(in IPrinterDiscoveryObserver observer, int userId);
    void requestPrinterUpdate(in PrinterId printerId, int userId);
    void destroyPrinterDiscoverySession(in IPrinterDiscoveryObserver observer,
            int userId);
}
+0 −6
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package android.print;

import android.content.ComponentName;
import android.os.ParcelFileDescriptor;
import android.print.PrinterId;
import android.print.IPrintDocumentAdapter;
import android.print.IPrintClient;
import android.print.IPrintSpoolerClient;
@@ -47,9 +46,4 @@ oneway interface IPrintSpooler {
            int sequence);
    void writePrintJobData(in ParcelFileDescriptor fd, int printJobId);
    void setClient(IPrintSpoolerClient client);

    // Printer discovery APIs
    void onPrintersAdded(in List<PrinterInfo> printers);
    void onPrintersRemoved(in List<PrinterId> printerIds);
    void onPrintersUpdated(in List<PrinterInfo> printerIds);
}
+0 −8
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.print;

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


@@ -30,11 +29,4 @@ oneway interface IPrintSpoolerClient {
    void onPrintJobQueued(in PrintJobInfo printJob);
    void onAllPrintJobsForServiceHandled(in ComponentName printService);
    void onAllPrintJobsHandled();

    // Printer discovery APIs
    void createPrinterDiscoverySession();
    void startPrinterDiscovery(in List<PrinterId> priorityList);
    void stopPrinterDiscovery();
    void requestPrinterUpdate(in PrinterId printerId);
    void destroyPrinterDiscoverySession();
}
Loading