Merge "Fix onConnet() is called twice for AugmentedAutofillService."

This commit is contained in:
Joanne Chung
2020-01-03 02:14:22 +00:00
committed by Android (Google) Code Review

View File

@@ -288,7 +288,14 @@ public final class AutofillManagerService
boolean isTemporary) {
mAugmentedAutofillState.setServiceInfo(userId, serviceName, isTemporary);
synchronized (mLock) {
getServiceForUserLocked(userId).updateRemoteAugmentedAutofillService();
final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId);
if (service == null) {
// If we cannot get the service from the services cache, it will call
// updateRemoteAugmentedAutofillService() finally. Skip call this update again.
getServiceForUserLocked(userId);
} else {
service.updateRemoteAugmentedAutofillService();
}
}
}