Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3218ac88 authored by Artem Radchenko's avatar Artem Radchenko
Browse files

Fix NPE in AutofillManager when feature autofill is disabled



When feature_autofill is not present on device IAutoFillManager service could be null.
It is proposed to check service for null before trying to add client to prevent NPE.

Bug: 174444980
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases \
    -t android.widget.cts.DatePickerTest#testPartsVisibilityInSpinnerMode
Signed-off-by: default avatarArtem Radchenko <artem.radchenko@globallogic.com>
Change-Id: Id6bad7e652452343ed674e4a7452a1b8231f72c5
Merged-In: I10ce988603f47117d0efddcc014ec51b72d3b3b4
parent b333f43d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1911,7 +1911,10 @@ public final class AutofillManager {
        if (client == null) {
            return;
        }

        if (mService == null) {
            Log.w(TAG, "Autofill service is null!");
            return;
        }
        if (mServiceClient == null) {
            mServiceClient = new AutofillManagerClient(this);
            try {