Feature/termux controls provider#55
Conversation
* Add reactivex/reactivestreams dependencies (required)
* Add TermuxWidgetControlsProviderService
* Add error handling for missing shortcut files
* Route intent through TermuxWidgetControlExecutorReceiver instead
agnostic-apollo
left a comment
There was a problem hiding this comment.
private Intent addShortcutFileExtrasToIntent(File file, Intent intent)
Its returning an Intent but its never used. You are passing the intent as parameter which will automatically get updated, so no need to return.
private void addShortcutFile(File dir, List<File> shortcutFiles, int depth)
Why are you not using dir.listFiles(TermuxWidgetService.SHORTCUT_FILES_FILTER)? Wouldn't shortcut icons and hidden files be included currently?
Apart from that, good coding! I don't see any other issues related to new changes. I can't test this cause my Android 11 avd is not showing the 3 dots for me to add the device control in power menu, it seems android revision is old, probably that's the reason.
Also note that in Android 12 device controls have been removed from power menu. Check https://www.reddit.com/r/Android/comments/nx9pd1/android_12_device_controls_removed_from_the_power. No response from google in https://issuetracker.google.com/issues/190662102.
Updated!
Fixed.. Somehow I didn't see that was there :)
This would be a very niche feature then. Hopefully at the very least, Google will allow an option to re-enable it. 🤞 |
agnostic-apollo
left a comment
There was a problem hiding this comment.
Thanks for fixing, will merge.
Implements #54 Device Control Widgets
(This is only for Android 11+)
I have only tested on Google Pixel 5
Execution will exhibit same behavior as current home screen widgets. (i.e. any file placed in
.shortcuts/taskswill run in background, all others in foreground.termux-dialog,termux-toast) it will not be visible until user exits the Device Control view.Error handling if script was removed / changed:
and tapping "Open App" will display error in Termux window: