Let TV users send text from their phone instead of typing with the remote - #487
Open
ElCruncharino wants to merge 1 commit into
Open
Let TV users send text from their phone instead of typing with the remote#487ElCruncharino wants to merge 1 commit into
ElCruncharino wants to merge 1 commit into
Conversation
Typing tokens, links, magnets, search queries and repository URLs with an on-screen keyboard and a remote is the worst interaction in the app on Android TV. Any relevant text field can now show a small QR code icon that starts a temporary, PIN-protected local HTTP server: scanning the code (or opening the shown address) on a phone gives a small form that fills the field on the TV once submitted. LocalTokenServer is the transport: it binds to the local network interface only, requires the displayed PIN on every submission, accepts exactly one valid value, and stops itself after a short timeout or too many wrong PINs. PhoneInputController wraps it and marshals its callbacks onto the main thread. showPhoneInputDialog and TextInputLayout.enablePhoneInput wire it into a field with a single call. Once the PIN has been entered correctly, later phone inputs this app session skip it entirely, tracked as a plain in-memory flag rather than a per-device cookie, since a phone's cookie jar was not reliable across the server's changing address and whatever browser or QR scanner preview happened to open it. The login screen's QR code (to open the Real-Debrid device link on a phone) works the same way: hidden behind an icon button next to the device code instead of always shown inline.
Owner
|
I'll keep this on hold for now, while it may be useful for some tv users, adding a whole library and qr codes everywhere + a custom server with a pin is a bit too much when 99% of modern tvs support bluetooth, users can just install a bluetooth keyboard app EDIT: the qr code to log in would be nice actually |
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.
Typing tokens, links, magnets, search queries and repository URLs with an on screen keyboard and a remote is painful. Any relevant text field can now show a small QR code icon that starts a temporary, PIN protected local HTTP server. Scanning the code (or opening the shown address) on a phone gives a small form that fills the field on the TV once submitted.
The server binds to the local network interface only, requires the PIN shown on the TV for every submission, accepts exactly one value, and stops itself after a short timeout or too many wrong PINs.
Once the PIN has been entered correctly once, later phone inputs in the same app session skip it. This is tracked as a simple in memory flag rather than a cookie, since a phone's cookie jar was not reliable across the server's changing address and whatever browser or QR scanner preview happened to open it.
The login screen's QR code (to open the Real-Debrid device link on a phone) works the same way now too, hidden behind an icon button next to the device code instead of always shown.
Validated on a real Google TV Streamer. This touches quite a few screens (auth, new download, search, plugin search, remote devices, repository), so more testing and review is welcome.