diff --git a/src/Android/AutofillService.cs b/src/Android/AutofillService.cs index 96d942792..4c3e5d4b7 100644 --- a/src/Android/AutofillService.cs +++ b/src/Android/AutofillService.cs @@ -82,6 +82,36 @@ namespace Bit.Android break; } + var uri = GetUri(root); + if(uri != null && !uri.Contains(BitwardenWebsite)) + { + var needToFill = NeedToAutofill(AutofillActivity.LastCredentials, uri); + if(needToFill) + { + var passwordNodes = GetWindowNodes(root, e, n => n.Password, false); + needToFill = passwordNodes.Any(); + if(needToFill) + { + var allEditTexts = GetWindowNodes(root, e, n => EditText(n), false); + var usernameEditText = allEditTexts.TakeWhile(n => !n.Password).LastOrDefault(); + FillCredentials(usernameEditText, passwordNodes); + + allEditTexts.Dispose(); + usernameEditText.Dispose(); + passwordNodes.Dispose(); + } + } + + if(!needToFill) + { + NotifyToAutofill(uri, notificationManager); + cancelNotification = false; + } + } + + AutofillActivity.LastCredentials = null; + + /* var passwordNodes = GetWindowNodes(root, e, n => n.Password, false); if(passwordNodes.Count > 0) { @@ -108,6 +138,8 @@ namespace Bit.Android } passwordNodes.Dispose(); + */ + if(cancelNotification) { diff --git a/src/Android/Services/GoogleAnalyticsService.cs b/src/Android/Services/GoogleAnalyticsService.cs index 06fd6bb84..da03cb5eb 100644 --- a/src/Android/Services/GoogleAnalyticsService.cs +++ b/src/Android/Services/GoogleAnalyticsService.cs @@ -12,7 +12,6 @@ namespace Bit.Android.Services private readonly GoogleAnalytics _instance; private readonly IAuthService _authService; private readonly Tracker _tracker; - private bool _setUserId = true; public GoogleAnalyticsService( Context appContext,