feat: sms otp code autofill - #85
Merged
Merged
Conversation
A first run has permission state NONE, so the retrieval comes back needing consent. Forward it to the activity as RequestSmsConsent, launch the resolution with StartIntentSenderForResult, and retry once when the user grants it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The play services retriever waits about five minutes, and the old dialog had no button, no text and no dismiss, so a user whose message never arrived was stuck for the whole window. Replace it with a real AlertDialog that explains itself and aborts the autofill on cancel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Broaden canOfferSuggestion's catch and bound its play services calls with a timeout, so a slow or unhappy play services costs at most the sms suggestion rather than the whole fill response. Guard registerReceiver and the consent resolution so a throw aborts the autofill instead of crashing the activity. Fill the focused totp field rather than the first one, and clear the pending flag on every terminal path. Adds the first tests for the status code mapping, including the USER_PERMISSION_REQUIRED branch the design inferred from the api surface. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…elled Rethrowing CancellationException propagated out of the callbackFlow block and skipped the awaitClose call that followed it, so a receiver registered before the cancellation was never unregistered. Move awaitClose into a finally so it runs however the block exits. Also suppress the unnecessary safe call warning on the consent resolution, which is deliberate: the @nonnull annotation on getResolution is not kept by its implementation, which delegates to a nullable Status.getResolution. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
OffRange
force-pushed
the
feat/sms-code-autofill
branch
from
August 27, 2026 08:53
a8025cb to
9fe3b84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addition allows users to automatically fill in codes a online service sends via sms. If a user chooses the option (suggestion just like any other autofill suggestion), KeyGo will wait for incoming codes, and automatically fill that code into the focused field for the online service.