diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-09-14 00:59:03 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2013-09-14 01:00:55 -0700 |
commit | 860f8a6b663ca96d30d17da09eca8caf065aae62 (patch) | |
tree | 380a1f552c7584ac4a7c7bc0713c07473b696dfb /core/java/android/print | |
parent | c8db445e42f1b60b9af036cb0d793ee11ae4c9c6 (diff) | |
download | frameworks_base-860f8a6b663ca96d30d17da09eca8caf065aae62.zip frameworks_base-860f8a6b663ca96d30d17da09eca8caf065aae62.tar.gz frameworks_base-860f8a6b663ca96d30d17da09eca8caf065aae62.tar.bz2 |
Spooler should not crash if print service config activities are not exported.
1. If a print service does not export its activities for settings and
adding printers the print spooler ignores them instead of crashing.
Also if the service is not enabled its activities are now ignored.
2. Added a dedicated permission for a print service to optionally
protect its settings and add printer activities such that only the
system can bind to them.
3. Fixed a crash in the print dialog if its content is detached
from the window and animators are running.
bug:10680224
Change-Id: I20b57d6622a15f9b2352ba78d04c44e67b316a15
Diffstat (limited to 'core/java/android/print')
-rw-r--r-- | core/java/android/print/IPrintManager.aidl | 3 | ||||
-rw-r--r-- | core/java/android/print/PrintManager.java | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/print/IPrintManager.aidl b/core/java/android/print/IPrintManager.aidl index fb6bb2e..d2ae5e6 100644 --- a/core/java/android/print/IPrintManager.aidl +++ b/core/java/android/print/IPrintManager.aidl @@ -22,6 +22,7 @@ import android.print.IPrintClient; import android.print.PrinterId; import android.print.PrintJobInfo; import android.print.PrintAttributes; +import android.printservice.PrintServiceInfo; /** * Interface for communication with the core print manager service. @@ -37,6 +38,8 @@ interface IPrintManager { void cancelPrintJob(int printJobId, int appId, int userId); void restartPrintJob(int printJobId, int appId, int userId); + List<PrintServiceInfo> getEnabledPrintServices(int userId); + void createPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, int userId); void startPrinterDiscovery(in IPrinterDiscoveryObserver observer, in List<PrinterId> priorityList, int userId); diff --git a/core/java/android/print/PrintManager.java b/core/java/android/print/PrintManager.java index 6e32c05..10cc771 100644 --- a/core/java/android/print/PrintManager.java +++ b/core/java/android/print/PrintManager.java @@ -28,6 +28,7 @@ import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.print.PrintDocumentAdapter.LayoutResultCallback; import android.print.PrintDocumentAdapter.WriteResultCallback; +import android.printservice.PrintServiceInfo; import android.text.TextUtils; import android.util.Log; @@ -204,6 +205,25 @@ public final class PrintManager { } /** + * Gets the list of enabled print services. + * + * @return The enabled service list or an empty list. + * + * @hide + */ + public List<PrintServiceInfo> getEnabledPrintServices() { + try { + List<PrintServiceInfo> enabledServices = mService.getEnabledPrintServices(mUserId); + if (enabledServices != null) { + return enabledServices; + } + } catch (RemoteException re) { + Log.e(LOG_TAG, "Error getting the enalbed print services", re); + } + return Collections.emptyList(); + } + + /** * @hide */ public PrinterDiscoverySession createPrinterDiscoverySession() { |