diff options
| author | 2018-02-17 03:21:04 +0000 | |
|---|---|---|
| committer | 2018-02-17 03:21:04 +0000 | |
| commit | 58f166826f5c452cbe36d4d014e099a9c7c4954f (patch) | |
| tree | b745af2f9f1c7d268f4a6f095e6b9968d356add3 | |
| parent | 8b0012bc2c7eefff6d9ee73791a6c83d22130e5a (diff) | |
| parent | 1e132a4c1d733b5149257821ad0cf08b41ac1f5e (diff) | |
Merge "Address comments for ag/3587350"
| -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; } |