From 3c367bc008802c214f71435393bc8a2c0a0c1bbf Mon Sep 17 00:00:00 2001 From: Achim Thesmann Date: Sat, 29 Jul 2023 04:23:41 +0000 Subject: [PATCH] Allow BAL from SelectPrinterActivity This allows the info button on each printer to open an activity as expected. Bug: 277761614 Test: manual test, presubmit (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0633d417ebe399fae024572ae2008e1f86ee437d) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d1062180b53dbcc21a0280e72b458a4f53c23b68) Merged-In: Ibe4bd6eabdc61be3b1237aa313b575cd85a69226 Change-Id: Ibe4bd6eabdc61be3b1237aa313b575cd85a69226 --- .../android/printspooler/ui/SelectPrinterActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java index 0c4cb8e4e8f6e..74acf677918e7 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java @@ -19,6 +19,7 @@ package com.android.printspooler.ui; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Activity; +import android.app.ActivityOptions; import android.app.LoaderManager; import android.content.ComponentName; import android.content.Context; @@ -714,8 +715,13 @@ public final class SelectPrinterActivity extends Activity implements try { mPrinterForInfoIntent = printer; + Bundle options = ActivityOptions.makeBasic() + .setPendingIntentBackgroundActivityStartMode( + ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED) + .toBundle(); startIntentSenderForResult(printer.getInfoIntent().getIntentSender(), - INFO_INTENT_REQUEST_CODE, fillInIntent, 0, 0, 0); + INFO_INTENT_REQUEST_CODE, fillInIntent, 0, 0, 0, + options); } catch (SendIntentException e) { mPrinterForInfoIntent = null; Log.e(LOG_TAG, "Could not execute pending info intent: %s", e);