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

settings: Add setting for auto-opening apps #2004

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vkareh
Copy link
Contributor

@vkareh vkareh commented Feb 6, 2024

MusicService: Autostart music app on music start
When starting music on a paired device, the music service will automatically trigger the music app to open.
edit: Repurposed this PR to a more general feature for auto-opening apps.

Certain apps can be configured to auto-open based on component events:

  • battery: when charging the watch
  • music: when playing music from the paired device
  • navigation: when opening a maps app on the paired device

InfiniSim_2024-02-09_142706

Fixes #1619

Copy link

github-actions bot commented Feb 6, 2024

Build size and comparison to main:

Section Size Difference
text 375652B 1124B
data 948B 0B
bss 63504B 16B

@mark9064
Copy link
Contributor

mark9064 commented Feb 7, 2024

I like the sound of this feature, but I think it should be optional. I have my phone and computers all connected with KDE connect, so any audio I play on any device syncs to my phone which sends it to InifiniTime. This is great, but making it switch to the music app every time any audio/media is played anywhere would drive me insane as it'd be switching all the time

@FintasticMan
Copy link
Member

I personally don't think that this would be a very nice user experience. As Mark says, I play media on my phone quite a lot, which will have it start and stop quite frequently. If that causes it to switch to the music app each time, it would get quite annoying. I think that this would be better implemented as a quick-switch action, where you can configure an app to get to quickly.

@vkareh
Copy link
Contributor Author

vkareh commented Feb 9, 2024

I've added the ability to configure which apps auto-open based on certain events:

  • battery: when charging the phone (code directly from Open battery app when charging #1876)
  • music: when playing music on paired device (tested with Gadgetbridge / Spotify Lite)
  • navigation: when starting map navigation on paired device (tested with Gadgetbridge / OsmAnd~)

InfiniSim_2024-02-09_142706

@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from aef969d to da53d2d Compare February 9, 2024 19:32
@vkareh vkareh changed the title MusicService: Autostart music app on music start settings: Add setting for auto-opening apps Feb 9, 2024
@mark9064
Copy link
Contributor

I like this generic solution a lot, my preferred watch face has battery percentage on it so being able to turn off auto battery show would be nice

Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

src/components/ble/NavigationService.h Outdated Show resolved Hide resolved
@JF002
Copy link
Collaborator

JF002 commented Feb 11, 2024

I understand that such a feature might be useful in some cases but... I would like to challenge it for the following reasons:

  • UX : when enabled, the Navigation/Music/Battery app would be automatically loaded when a event (new direction, new music data, new charging state) is received. It means that the state of the application that is currently running would be erased. Let's say I'm playing a game, changing some settings or using the chrono -> I lost everything I was doing before the event. That would be kind of infuriating to me.

  • Code : I don't think this implementation is compatible with the new compile time configuration of applications and watch faces : what happens in the Navigation or Music app are not built into the firmware?

  • InfiniTime Vision : In my opinion, this feature is not consistent with a few core principles of the InfiniTime project. For example, we avoid adding new settings whenever possible and we favor implementing a single solid default behavior instead.

As I said, I understand why some users request this kind of feature, but I'm not sure this is the best way to implement it. Feel free to share your opinions :)

@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from a319aec to d5d6c62 Compare February 12, 2024 15:19
@MoonlightWave-12
Copy link

Some of my thoughts about this feature:

It should only automatically open apps while the smartwatch is not used for something else; so, basically only while it is on the watch-face.

Considering that most of this feature depends on interacting with a companion-app, i think that it may be better to have a way for a companion-app to request opening any app on the smartwatch and keep the settings for wether or not to do it in that companion-app. It would also be good if the companion-app can check for the availability of a smartwatch-app, so it can decide wether or not to offer such a setting, or tell the user how to make it available.

Automatically opening an app can make the usage-flow much easier.
For example: just start navigation in a smartphone-app, and one is ready to go; instead of having to change things on 2 devices, going through several screens on each device.
I also consider it to be an accessibility-feature; it basically makes such functionality usable/discoverable to begin with, for various people who do not have toying-with-tech as a hobby.

@vkareh
Copy link
Contributor Author

vkareh commented Feb 12, 2024

@JF002

UX : [...] It means that the state of the application that is currently running would be erased [...]

I updated the patchset to only load the app if there's no app loaded currently.

Code : I don't think this implementation is compatible with the new compile time configuration of applications and watch faces : what happens in the Navigation or Music app are not built into the firmware?

Great question. Testing this now to see what happens.

[...] we avoid adding new settings whenever possible and we favor implementing a single solid default behavior instead.

Fair point. I think this concern is the only one we cannot address in code and would require a decision from the InfiniTime core team (InfiniTeam? 😛 )

@vkareh
Copy link
Contributor Author

vkareh commented Feb 12, 2024

@JF002

  • Code : I don't think this implementation is compatible with the new compile time configuration of applications and watch faces : what happens in the Navigation or Music app are not built into the firmware?

I've accounted for this now. The DisplayApp verifies if the app is available before attempting to perform the action.

@MoonlightWave-12

It should only automatically open apps while the smartwatch is not used for something else; so, basically only while it is on the watch-face.

This is now fixed.

[...] have a way for a companion-app to request opening any app on the smartwatch [...]

This could be interesting... Gadgetbridge has device-specific settings. InfiniTime could implement a service that allows it to interact with apps.

[...] or tell the user how to make it available [...]

General users won't be able to decide which app gets installed on their watch.

Automatically opening an app can make the usage-flow much easier.

I agree. This feature's goal is to increase usability. When I play music/podcasts, I expect my watch to know so that I can see/interact. Same with navigation. My companion app (Gadgetbridge) is smart enough that it doesn't just randomly sends any sound/notification as though it were media, and limits it only to actual media playing on my phone (Spotify Lite / AntennaPod). Things like movies from streaming services do not get sent to the watch (which is what I expect anyway), so the behaviour here is really what I would expect of a connected device.

@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from fce9fc4 to 1d4ebb3 Compare August 19, 2024 17:07
@tituscmd
Copy link
Contributor

tituscmd commented Sep 3, 2024

I was just thinking... what if the app doesn't open right up, but gets placed to the right of the watchface?

KaffeinatedKat and others added 5 commits October 28, 2024 10:46
When starting music on a paired device, the music service will
automatically trigger the music app to open if there is no app already
loaded.
When a paired device sends a navigation message, the navigation service
will automatically trigger the navigation app to open if there is no app
already loaded.
Certain apps can be configured to auto-open based on component events:
- battery: when charging the watch
- music: when playing music from the paired device
- navigation: when opening a maps app on the paired device
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

Successfully merging this pull request may close these issues.

7 participants