Skip to content
Commit e763059a authored by Ahaan Ugale's avatar Ahaan Ugale
Browse files

Autofill: Fix unsafe usages of mCurrentViewId related to Inline UI.

With this change, the value is captured locally before being used in any
lambdas related to inline suggestions. Otherwise, the lambda can be
executed for a different view than intended, which can also cause an NPE
if a VIEW_EXITED event occurs (see linked bug).

This change also includes a null-check in
requestShowInlineSuggestionsLocked. It's unclear if it's possible for
the value to be null there, but the check is added to be safe.

There are other usages of mCurrentViewId that should ideally be guarded
by null-checks, but those shall be fixed separately (or refactored
later).

Test: manual - (1) add a Thread.sleep at line 3146, (2) tap on url bar to trigger Augmented request, (3) close keyboard to trigger the NPE.
Test: atest InlineLoginActivityTest InlineAugmentedLoginActivityTest
Fix: 153877905
Change-Id: Ibcf8f17417ec7a3fa854816783b63879c4d18669
parent 5c942966
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment