diff options
| author | Felipe Leme <felipeal@google.com> | 2019-02-19 09:42:24 -0800 |
|---|---|---|
| committer | Felipe Leme <felipeal@google.com> | 2019-02-20 18:44:05 -0800 |
| commit | 326f15a392e167b67f9dfaf130ee249b2ff733f8 (patch) | |
| tree | 4493229903accf06354c2562c29d399415cc6ef8 /core/java/android/app/ContextImpl.java | |
| parent | 98ab00f921250aa18521076d93b41b1136b97bf5 (diff) | |
Optimized Content Capture workflow by caching some state at the application level.
Content Capture for an activity and/or package is only available when the Content Capture service
explicitly whitelists it. As the whitelist is kept at system-server level, it's better to fetch that
info when the application is started and cache it locally, so we can optimize the
ContentCaptureManager APIs to return quickly when it's disabled.
This CL also caches other values such as the buffer parameters.
Test: atest CtsContentCaptureServiceTestCases
Bug: 120494182
Bug: 121202151
Change-Id: I9d5211bca496ffa85ba9efc2a7bb32411834b787
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 6908ca27480c..3a1e80dc1c3f 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -23,6 +23,7 @@ import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; import android.content.BroadcastReceiver; import android.content.ComponentName; +import android.content.ContentCaptureOptions; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.Context; @@ -217,7 +218,7 @@ class ContextImpl extends Context { private AutofillClient mAutofillClient = null; private boolean mIsAutofillCompatEnabled; - private boolean mIsContentCaptureSupported = false; + private ContentCaptureOptions mContentCaptureOptions = null; private final Object mSync = new Object(); @@ -2388,14 +2389,14 @@ class ContextImpl extends Context { /** @hide */ @Override - public boolean isContentCaptureSupported() { - return mIsContentCaptureSupported; + public ContentCaptureOptions getContentCaptureOptions() { + return mContentCaptureOptions; } /** @hide */ @Override - public void setContentCaptureSupported(boolean supported) { - mIsContentCaptureSupported = supported; + public void setContentCaptureOptions(ContentCaptureOptions options) { + mContentCaptureOptions = options; } @UnsupportedAppUsage |
