summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ahaan Ugale <augale@google.com> 2022-01-30 22:21:50 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-01-30 22:21:50 +0000
commit5f73621d01fac6c6482afe216dcda30f31c21afe (patch)
tree688ced907d6142abc514bd7d7b70170650ffb0bf
parentf320469366cadd4629000215ee325d3edd98e679 (diff)
parent97757ea0c4878fd576e0f2520f8b8f3675b04cf4 (diff)
Merge "Fix Activity leak from ContentCapture Context-Updated event."
-rw-r--r--core/java/android/view/contentcapture/ContentCaptureSession.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/view/contentcapture/ContentCaptureSession.java b/core/java/android/view/contentcapture/ContentCaptureSession.java
index 955269160e49..2134d819943e 100644
--- a/core/java/android/view/contentcapture/ContentCaptureSession.java
+++ b/core/java/android/view/contentcapture/ContentCaptureSession.java
@@ -291,6 +291,8 @@ public abstract class ContentCaptureSession implements AutoCloseable {
* <p>Typically used to change the context associated with the default session from an activity.
*/
public final void setContentCaptureContext(@Nullable ContentCaptureContext context) {
+ if (!isContentCaptureEnabled()) return;
+
mClientContext = context;
updateContentCaptureContext(context);
}