From e764fa2892c1a3633ed3a20782078c1260b05c6a Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Thu, 21 Feb 2019 16:45:35 -0800 Subject: [PATCH] Added a DeviceConfig property for Content Capture idle timeout to unbind from system server. Test: manual verification Bug: 111276913 Change-Id: I3c8f0ffc5fbadfc033ef6574cab7e0ec1419b38e --- .../contentcapture/ContentCaptureManager.java | 8 +++++++ .../internal/infra/AbstractRemoteService.java | 2 +- .../ContentCaptureManagerService.java | 21 +++++++++++++------ .../ContentCapturePerUserService.java | 2 +- .../RemoteContentCaptureService.java | 7 ++++--- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/core/java/android/view/contentcapture/ContentCaptureManager.java b/core/java/android/view/contentcapture/ContentCaptureManager.java index 336d9979a781d..cdd4f35f538b0 100644 --- a/core/java/android/view/contentcapture/ContentCaptureManager.java +++ b/core/java/android/view/contentcapture/ContentCaptureManager.java @@ -129,6 +129,14 @@ public final class ContentCaptureManager { @TestApi public static final String DEVICE_CONFIG_PROPERTY_LOGGING_LEVEL = "logging_level"; + /** + * Sets how long (in ms) the service is bound while idle. + * + *

Use {@code 0} to keep it permanently bound. + * + * @hide + */ + public static final String DEVICE_CONFIG_PROPERTY_IDLE_UNBIND_TIMEOUT = "idle_unbind_timeout"; /** @hide */ @TestApi diff --git a/core/java/com/android/internal/infra/AbstractRemoteService.java b/core/java/com/android/internal/infra/AbstractRemoteService.java index a937aa7cc32e3..54457a8f8a60c 100644 --- a/core/java/com/android/internal/infra/AbstractRemoteService.java +++ b/core/java/com/android/internal/infra/AbstractRemoteService.java @@ -67,7 +67,7 @@ public abstract class AbstractRemoteService