Merge "Fixed autofill compat mode so it works on secondary user." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0b20fa45b8
@@ -588,7 +588,7 @@ public final class AutofillManagerService extends SystemService {
|
||||
|
||||
private void addCompatibilityModeRequestsLocked(@NonNull AutofillManagerServiceImpl service
|
||||
, int userId) {
|
||||
mAutofillCompatState.reset();
|
||||
mAutofillCompatState.reset(userId);
|
||||
final ArrayMap<String, Long> compatPackages =
|
||||
service.getCompatibilityPackagesLocked();
|
||||
if (compatPackages == null || compatPackages.isEmpty()) {
|
||||
@@ -721,6 +721,9 @@ public final class AutofillManagerService extends SystemService {
|
||||
static final class AutofillCompatState {
|
||||
private final Object mLock = new Object();
|
||||
|
||||
/**
|
||||
* Map of app->compat_state per user.
|
||||
*/
|
||||
@GuardedBy("mLock")
|
||||
private SparseArray<ArrayMap<String, PackageCompatState>> mUserSpecs;
|
||||
|
||||
@@ -787,11 +790,17 @@ public final class AutofillManagerService extends SystemService {
|
||||
}
|
||||
}
|
||||
|
||||
void reset() {
|
||||
void reset(int userId) {
|
||||
synchronized (mLock) {
|
||||
if (mUserSpecs != null) {
|
||||
mUserSpecs.clear();
|
||||
mUserSpecs = null;
|
||||
mUserSpecs.delete(userId);
|
||||
final int newSize = mUserSpecs.size();
|
||||
if (newSize == 0) {
|
||||
if (sVerbose) Slog.v(TAG, "reseting mUserSpecs");
|
||||
mUserSpecs = null;
|
||||
} else {
|
||||
if (sVerbose) Slog.v(TAG, "mUserSpecs down to " + newSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -806,7 +815,7 @@ public final class AutofillManagerService extends SystemService {
|
||||
for (int i = 0; i < mUserSpecs.size(); i++) {
|
||||
final int user = mUserSpecs.keyAt(i);
|
||||
pw.print(prefix); pw.print("User: "); pw.println(user);
|
||||
final ArrayMap<String,PackageCompatState> perUser = mUserSpecs.get(i);
|
||||
final ArrayMap<String, PackageCompatState> perUser = mUserSpecs.valueAt(i);
|
||||
for (int j = 0; j < perUser.size(); j++) {
|
||||
final String packageName = perUser.keyAt(j);
|
||||
final PackageCompatState state = perUser.valueAt(j);
|
||||
|
||||
Reference in New Issue
Block a user