diff options
author | Lyn <lynhan@google.com> | 2023-08-01 17:59:02 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-07 07:29:16 +0000 |
commit | ca5ba94a49f1e0f8abba82a264925483cb521c59 (patch) | |
tree | 36d9ce1ffc239ce9531d3fa007e87954bc5c7df6 | |
parent | eeab6b66e4f0fa2e22d256a29b9c3806f5960298 (diff) | |
download | base-ca5ba94a49f1e0f8abba82a264925483cb521c59.tar.gz |
Allow remote input to send intent from background
Fixes: 283073563
Test: inline reply => message sent
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3738fda1a1afa7a6e91d5830a1fbf92566e794d5)
Merged-In: I230ba6f6064b865925ec7c13221cefd7340f52ca
Change-Id: I230ba6f6064b865925ec7c13221cefd7340f52ca
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt index 22b4c9d81d25..736b14574da0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.policy +import android.app.ActivityOptions import android.app.Notification import android.app.PendingIntent import android.app.RemoteInput @@ -275,7 +276,10 @@ class RemoteInputViewControllerImpl @Inject constructor( entry.sbn.instanceId) try { - pendingIntent.send(view.context, 0, intent) + val options = ActivityOptions.makeBasic() + options.setPendingIntentBackgroundActivityStartMode( + ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED) + pendingIntent.send(view.context, 0, intent, null, null, null, options.toBundle()) } catch (e: PendingIntent.CanceledException) { Log.i(TAG, "Unable to send remote input result", e) uiEventLogger.logWithInstanceId( |