Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard automatically toggles with every keypress after nearby devices permission has been rejected on Android when using the Ollama backend #590

Closed
FlippingBinary opened this issue Jul 13, 2024 · 3 comments

Comments

@FlippingBinary
Copy link

I installed the app from the Google Play store today, but the about screen doesn't indicate a version so it's whichever version is available from the Google Play store today. I'm using a Samsung Galaxy S21 running Android 14.

When I switched to the Ollama backend, the nearby devices permission was requested persistently with no further explanation. Android starts blocking those requests automatically after they've been rejected by the user a few times, which is what I do when I'm first exploring an app. After that, the keyboard started automatically dismissing itself after every keypress. I had to tap the input field after every keypress to get the keyboard back. Oddly enough, the keyboard would automatically appear and disappear after every keypress even when using my Bluetooth keyboard. If I typed too fast, some keys would be missed. After enabling the permission, the odd keyboard behavior stopped. My assumption is that the app is requesting nearby devices permission each time, which affects the display of the keyboard.

But is that permission even necessary? Before I enabled it, the list of models was populated with the list from my Ollama server (after great difficulty while entering the URL), so it was clearly able to connect to the local server. I mostly just enabled the permission to see if that would fix the annoying keyboard issue. Perhaps the app could keep track of the fact that the permission was rejected so it can avoid requesting permission until the user explicitly taps a button to enable whatever feature requires it?

Thanks for the app, btw. It's looking good.

@danemadsen
Copy link
Member

danemadsen commented Jul 15, 2024

Nearby devices is used by ollama to search your network for a Ollama server. Ill look into ways to handle cases where that perm is denied though

@danemadsen
Copy link
Member

Ok i fixed it by making it not re-request perms unless relaunched

@FlippingBinary
Copy link
Author

Thank you! That commit looks like it will prevent the repeated permissions request, but maybe _nearbyDevicesPermissionDenied could be made as a global flag that is saved in preferences. Then the action associated with the refresh button next to the URL in the model settings screen could reset the flag before attempting to reset the URL. Alternatively, it could prompt the user with a message that nearby device permissions are required to scan the local network for Ollama services. The user could tap "Okay" to reset the flag and trigger the resetUri function, or they could tap "Cancel" to avoid the permissions prompt. Then the user would know why the button didn't change the URL. I could try to work up a PR if that sounds good to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants