Call back with null AssistContent if request fails
Ensures that the onAssistContent method is always called (with null if
necessary).
Bug: 341017571
Fix: 341017571
Test: manual via checking that the callback in the
ScreenshotActionsProvider is called
Flag: com.android.systemui.screenshot_shelf_ui2
Change-Id: I762e6fe96c24f4b60fcb15285c38873faf166d91
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/AssistContentRequester.java b/packages/SystemUI/src/com/android/systemui/screenshot/AssistContentRequester.java
index 12bff49..6ff1535 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/AssistContentRequester.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/AssistContentRequester.java
@@ -89,9 +89,12 @@
// ActivityTaskManager interaction here is synchronous, so call off the main thread.
mSystemInteractionExecutor.execute(() -> {
try {
- mActivityTaskManager.requestAssistDataForTask(
+ boolean success = mActivityTaskManager.requestAssistDataForTask(
new AssistDataReceiver(callback, this), taskId, mPackageName,
mAttributionTag);
+ if (!success) {
+ callback.onAssistContentAvailable(null);
+ }
} catch (RemoteException e) {
Log.e(TAG, "Requesting assist content failed for task: " + taskId, e);
}