summaryrefslogtreecommitdiff
path: root/core/java/android/printservice/PrintService.java
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2016-10-06 10:21:50 -0700
committerPhilip P. Moltmann <moltmann@google.com>2016-10-13 17:09:17 -0700
commitc8d6f54be3c05d13c63d2eb353eef9c24964630c (patch)
tree1a339bcaa40bb4c9690ad690b460796e0ff350cd /core/java/android/printservice/PrintService.java
parent00a981e522d073acd4e77b8150d3cf5da58c0f87 (diff)
Allow to select printer from info activity.
Test: Manual testing with modified experimental print service and new CTS test for the new API Fixes: 27746841 Change-Id: I4ef728e54679271a01397d9f04d3b8ac804ffcf3
Diffstat (limited to 'core/java/android/printservice/PrintService.java')
-rw-r--r--core/java/android/printservice/PrintService.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/printservice/PrintService.java b/core/java/android/printservice/PrintService.java
index 8f73518eba0f..ecf17707a5c8 100644
--- a/core/java/android/printservice/PrintService.java
+++ b/core/java/android/printservice/PrintService.java
@@ -18,6 +18,8 @@ package android.printservice;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.Activity;
+import android.app.PendingIntent;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
@@ -29,6 +31,7 @@ import android.os.Message;
import android.os.RemoteException;
import android.print.PrintJobInfo;
import android.print.PrinterId;
+import android.print.PrinterInfo;
import android.util.Log;
import com.android.internal.util.Preconditions;
@@ -247,6 +250,26 @@ public abstract class PrintService extends Service {
public static final String EXTRA_PRINT_DOCUMENT_INFO =
"android.printservice.extra.PRINT_DOCUMENT_INFO";
+ /**
+ * When the {@link PendingIntent} declared via
+ * {@link PrinterInfo.Builder#setInfoIntent(PendingIntent)} is called this boolean extra
+ * will be filled in if the activity can select the printer.
+ *
+ * @see #EXTRA_SELECT_PRINTER
+ */
+ public static final String EXTRA_CAN_SELECT_PRINTER =
+ "android.printservice.extra.CAN_SELECT_PRINTER";
+
+ /**
+ * If this boolean extra is set to {@code true} in the {@link Activity#setResult(int, Intent)
+ * result data} from the activity specified in
+ * {@link PrinterInfo.Builder#setInfoIntent(PendingIntent)} the printer will be selected.
+ *
+ * @see #EXTRA_CAN_SELECT_PRINTER
+ */
+ public static final String EXTRA_SELECT_PRINTER =
+ "android.printservice.extra.SELECT_PRINTER";
+
private Handler mHandler;
private IPrintServiceClient mClient;