diff options
| author | 2018-02-16 09:34:22 -0800 | |
|---|---|---|
| committer | 2018-02-16 09:34:25 -0800 | |
| commit | 1e132a4c1d733b5149257821ad0cf08b41ac1f5e (patch) | |
| tree | 625637788390974b81f5d291667bef68e2293d26 | |
| parent | 020731e9a28ada751209adf2538c9be08c0c6ad6 (diff) | |
Address comments for ag/3587350
Test: cts-tradefed run cts -m CtsAutoFillServiceTestCases
Change-Id: I2d46e1234b8455e3f925bc1be29e6c2fbe19c252
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/AutofillManagerService.java | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java index 3689536b6ed8..1ae61af59d84 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java @@ -327,11 +327,7 @@ public final class AutofillManagerService extends SystemService { mUiLatencyHistory, mWtfHistory, resolvedUserId, mUi, mDisabledUsers.get(resolvedUserId)); mServicesCache.put(userId, service); - final ArrayMap<String, Pair<Long, String>> compatPackages = - service.getCompatibilityPackagesLocked(); - if (compatPackages != null) { - addCompatibilityModeRequests(compatPackages, userId); - } + addCompatibilityModeRequestsLocked(service, userId); } return service; } @@ -521,24 +517,23 @@ public final class AutofillManagerService extends SystemService { if (!service.isEnabledLocked()) { removeCachedServiceLocked(userId); } else { - final ArrayMap<String, Pair<Long, String>> compatPackages = - service.getCompatibilityPackagesLocked(); - if (compatPackages != null) { - addCompatibilityModeRequests(compatPackages, userId); - } + addCompatibilityModeRequestsLocked(service, userId); } } } - private void addCompatibilityModeRequests( - @NonNull ArrayMap<String, Pair<Long, String>> compatPackages, int userId) { - final Set<String> whiteListedPackages = Build.IS_ENG ? null - : getWhitelistedCompatModePackages(); + private void addCompatibilityModeRequestsLocked(@NonNull AutofillManagerServiceImpl service + , int userId) { + final ArrayMap<String, Pair<Long, String>> compatPackages = + service.getCompatibilityPackagesLocked(); + if (compatPackages == null || compatPackages.isEmpty()) { + return; + } + final Set<String> whiteListedPackages = getWhitelistedCompatModePackages(); final int compatPackageCount = compatPackages.size(); for (int i = 0; i < compatPackageCount; i++) { final String packageName = compatPackages.keyAt(i); - if (!Build.IS_ENG && (whiteListedPackages == null - || !whiteListedPackages.contains(packageName))) { + if (whiteListedPackages == null || !whiteListedPackages.contains(packageName)) { Slog.w(TAG, "Ignoring not whitelisted compat package " + packageName); continue; } |