summaryrefslogtreecommitdiff
path: root/services/contentcapture/java
diff options
context:
space:
mode:
author kholoud mohamed <kholoudm@google.com> 2021-02-23 11:09:46 +0000
committer Kholoud Mohamed <kholoudm@google.com> 2021-03-01 15:43:20 +0000
commit28913aa2f960bbb07c3c06e95bd5b18be5439382 (patch)
tree0108441b7c16381cb5318412e56086d4ab36563f /services/contentcapture/java
parent6cdb4f4ff574ecee9497ef6fbcb2f6d35c07da72 (diff)
Add testAPIs in ContentCaptureManager
Added the following static testAPIs to replace the usage of adb commands in cts/gts tests: * resetTemporaryService * setTemporaryService * setDefaultServiceEnabled These APIs are static because by default ContentCaptureManager isn't available until it's enabled using these APIs. Test: Confirmed that the APIs are accessible in CTS tests. Bug: 180328483 Change-Id: I0a94d90b509e1d2f695556955d85d27acab19ae9
Diffstat (limited to 'services/contentcapture/java')
-rw-r--r--services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
index 0be485b747e5..220f87db8bd4 100644
--- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
+++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
@@ -795,6 +795,23 @@ public final class ContentCaptureManagerService extends
new ContentCaptureManagerServiceShellCommand(ContentCaptureManagerService.this).exec(
this, in, out, err, args, callback, resultReceiver);
}
+
+ @Override
+ public void resetTemporaryService(@UserIdInt int userId) {
+ ContentCaptureManagerService.this.resetTemporaryService(userId);
+ }
+
+ @Override
+ public void setTemporaryService(
+ @UserIdInt int userId, @NonNull String serviceName, int duration) {
+ ContentCaptureManagerService.this.setTemporaryService(
+ userId, serviceName, duration);
+ }
+
+ @Override
+ public void setDefaultServiceEnabled(@UserIdInt int userId, boolean enabled) {
+ ContentCaptureManagerService.this.setDefaultServiceEnabled(userId, enabled);
+ }
}
private final class LocalService extends ContentCaptureManagerInternal {