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

Commit cdbd09bb authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Prevent crash when AutofillManager.isEnabled() is called" into rvc-dev

parents 3ef98ae1 ee55616a
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -1894,7 +1894,13 @@ public final class AutofillManager {
                final SyncResultReceiver receiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS);
                final SyncResultReceiver receiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS);
                mService.addClient(mServiceClient, client.autofillClientGetComponentName(),
                mService.addClient(mServiceClient, client.autofillClientGetComponentName(),
                        userId, receiver);
                        userId, receiver);
                final int flags = receiver.getIntResult();
                int flags = 0;
                try {
                    flags = receiver.getIntResult();
                } catch (SyncResultReceiver.TimeoutException e) {
                    Log.w(TAG, "Failed to initialize autofill: " + e);
                    return;
                }
                mEnabled = (flags & FLAG_ADD_CLIENT_ENABLED) != 0;
                mEnabled = (flags & FLAG_ADD_CLIENT_ENABLED) != 0;
                sDebug = (flags & FLAG_ADD_CLIENT_DEBUG) != 0;
                sDebug = (flags & FLAG_ADD_CLIENT_DEBUG) != 0;
                sVerbose = (flags & FLAG_ADD_CLIENT_VERBOSE) != 0;
                sVerbose = (flags & FLAG_ADD_CLIENT_VERBOSE) != 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -260,7 +260,7 @@ final class AutofillManagerServiceImpl
        if (isEnabledLocked()) return FLAG_ADD_CLIENT_ENABLED;
        if (isEnabledLocked()) return FLAG_ADD_CLIENT_ENABLED;


        // Check if it's enabled for augmented autofill
        // Check if it's enabled for augmented autofill
        if (isAugmentedAutofillServiceAvailableLocked()
        if (componentName != null && isAugmentedAutofillServiceAvailableLocked()
                && isWhitelistedForAugmentedAutofillLocked(componentName)) {
                && isWhitelistedForAugmentedAutofillLocked(componentName)) {
            return FLAG_ADD_CLIENT_ENABLED_FOR_AUGMENTED_AUTOFILL_ONLY;
            return FLAG_ADD_CLIENT_ENABLED_FOR_AUGMENTED_AUTOFILL_ONLY;
        }
        }