From 99d1a6d043e10abf8f845df667c8f6cf5e508782 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 1 Feb 2018 16:12:30 -0500 Subject: [PATCH] read RootInActiveWindow after launcher checks --- src/Android/AutofillService.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Android/AutofillService.cs b/src/Android/AutofillService.cs index bf19006c3..60e29ece7 100644 --- a/src/Android/AutofillService.cs +++ b/src/Android/AutofillService.cs @@ -94,16 +94,19 @@ namespace Bit.Android try { - var root = RootInActiveWindow; - - /* - if(e == null || root == null || string.IsNullOrWhiteSpace(e.PackageName) || - e.PackageName == SystemUiPackage || e.PackageName.Contains("launcher") || - root.PackageName != e.PackageName) + if(string.IsNullOrWhiteSpace(e?.PackageName) || e.PackageName == SystemUiPackage || + e.PackageName.Contains("launcher")) { return; } + var root = RootInActiveWindow; + if(root == null || root.PackageName != e.PackageName) + { + return; + } + + /* //var testNodes = GetWindowNodes(root, e, n => n.ViewIdResourceName != null && n.Text != null, false); //var testNodesData = testNodes.Select(n => new { id = n.ViewIdResourceName, text = n.Text }); //testNodes.Dispose();