diff options
author | Felipe Leme <felipeal@google.com> | 2019-08-26 10:45:24 -0700 |
---|---|---|
committer | Felipe Leme <felipeal@google.com> | 2019-08-26 10:51:03 -0700 |
commit | 987655d0498078643cf8b5aec9fb4403bf71aef3 (patch) | |
tree | e308e97bd08847e77738588883b1242b3b3ae071 /services/contentcapture | |
parent | 000fab84309a641c203ddd9c5cc950eeb235b3ec (diff) |
Improved AbstractMasterSystemService to handle supported user types.
Also changed AutofillManagerService and ContentCaptureManagerService to take advantage of these methods.
Test: manual verification
Test: atest CtsAutoFillServiceTestCases CtsContentCaptureServiceTestCases # on phone and Automotive
Bug: 133242016
Change-Id: I3e7f9d65a6ef1e8e6ec886a41b35733e463a6389
Diffstat (limited to 'services/contentcapture')
-rw-r--r-- | services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java index 5c6258ffe4cb..c8dbb363bc36 100644 --- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java @@ -147,8 +147,7 @@ public final class ContentCaptureManagerService extends mRequestsHistory = null; } - final UserManager um = getContext().getSystemService(UserManager.class); - final List<UserInfo> users = um.getUsers(); + final List<UserInfo> users = getSupportedUsers(); for (int i = 0; i < users.size(); i++) { final int userId = users.get(i).id; final boolean disabled = !isEnabledBySettings(userId); @@ -174,6 +173,11 @@ public final class ContentCaptureManagerService extends } @Override // from SystemService + public boolean isSupported(UserInfo userInfo) { + return userInfo.isFull() || userInfo.isManagedProfile(); + } + + @Override // from SystemService public void onStart() { publishBinderService(CONTENT_CAPTURE_MANAGER_SERVICE, new ContentCaptureManagerServiceStub()); @@ -336,8 +340,7 @@ public final class ContentCaptureManagerService extends if (verbose) { Slog.v(mTag, "setDisabledByDeviceConfig(): explicitlyEnabled=" + explicitlyEnabled); } - final UserManager um = getContext().getSystemService(UserManager.class); - final List<UserInfo> users = um.getUsers(); + final List<UserInfo> users = getSupportedUsers(); final boolean newDisabledValue; |