summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Casey <mrcasey@google.com> 2020-06-09 15:43:56 -0400
committer Matt Casey <mrcasey@google.com> 2020-06-09 15:43:56 -0400
commitd56eaf68f6524a42594758feb20dc68f9920c33c (patch)
treef12b1864cd9dacba2b1faf1bc6891b282e28d96a
parent1bee00878dd36344b39a6cc3841931f2f8ab37b4 (diff)
Hide bubbles' IME after screenshot is taken.
Needed to create a separate receiver to handle this as GlobalScreenshot is in the screenshot process. Bug: 157756391 Test: Open IME in bubble test app, take screenshot, verify that IME goes away and does not interfere with screenshots UI. Change-Id: I93d050340e59c5b45250f53eb943697fa543b706
-rw-r--r--packages/SystemUI/AndroidManifest.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java19
2 files changed, 23 insertions, 0 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 985269b2bb75..ef3e799a55bf 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -406,6 +406,10 @@
<receiver android:name=".screenshot.GlobalScreenshot$SmartActionsReceiver"
android:exported="false"/>
+ <!-- Callback for performing sysui cleanup after screenshot has been taken. -->
+ <receiver android:name=".screenshot.GlobalScreenshot$ScreenshotTakenReceiver"
+ android:exported="false"/>
+
<!-- started from UsbDeviceSettingsManager -->
<activity android:name=".usb.UsbConfirmActivity"
android:exported="true"
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index a624479fa63c..3368e72e7666 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -83,6 +83,7 @@ import android.widget.Toast;
import com.android.internal.logging.UiEventLogger;
import com.android.systemui.R;
+import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.statusbar.phone.StatusBar;
@@ -472,6 +473,8 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
return;
}
+ mContext.sendBroadcast(new Intent(mContext, ScreenshotTakenReceiver.class));
+
// Optimizations
mScreenBitmap.setHasAlpha(false);
mScreenBitmap.prepareToDraw();
@@ -1077,4 +1080,20 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
context, intent.getStringExtra(EXTRA_ID), actionType, true);
}
}
+
+ /**
+ * Called when a screenshot has been taken and animation / screenshot UI is about to begin.
+ */
+ public static class ScreenshotTakenReceiver extends BroadcastReceiver {
+ private final Lazy<BubbleController> mBubbleController;
+
+ public ScreenshotTakenReceiver(Lazy<BubbleController> bubbleController) {
+ mBubbleController = bubbleController;
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ mBubbleController.get().hideImeFromExpandedBubble();
+ }
+ }
}