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

Commit 7266dbf7 authored by Felipe Leme's avatar Felipe Leme
Browse files

Use Slog.w() instead of wtf() when the Augmented Autofill Service times out.

Also increased timeout from 2s to 5s.

Test: forced a sample service to time out and looked at logs
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest

Fixes: 124313461

Change-Id: I61713bd38b512272bfb697986831676c90547eb3
parent b581ab29
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ final class RemoteAugmentedAutofillService

    private static final String TAG = RemoteAugmentedAutofillService.class.getSimpleName();

    private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 2 * DateUtils.SECOND_IN_MILLIS;
    private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 5 * DateUtils.SECOND_IN_MILLIS;

    RemoteAugmentedAutofillService(Context context, ComponentName serviceName,
            int userId, RemoteAugmentedAutofillServiceCallbacks callbacks,
@@ -106,6 +106,12 @@ final class RemoteAugmentedAutofillService
                activityComponent, focusedId, focusedValue));
    }

    @Override
    public String toString() {
        return "RemoteAugmentedAutofillService["
                + ComponentName.flattenToShortString(getComponentName()) + "]";
    }

    /**
     * Called by {@link Session} when it's time to destroy all augmented autofill requests.
     */
@@ -181,11 +187,13 @@ final class RemoteAugmentedAutofillService

        @Override
        protected void onTimeout(RemoteAugmentedAutofillService remoteService) {
            Slog.wtf(TAG, "timed out: " + this);
            // TODO(b/122858578): must update the logged AUTOFILL_AUGMENTED_REQUEST with the
            // timeout
            Slog.w(TAG, "PendingAutofillRequest timed out (" + TIMEOUT_REMOTE_REQUEST_MILLIS
                    + "ms) for " + remoteService);
            // NOTE: so far we don't need notify RemoteAugmentedAutofillServiceCallbacks
            finish();
        }

    }

    public interface RemoteAugmentedAutofillServiceCallbacks