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 375748B 1140B
data 948B 0B
bss 63520B 16B

@vkareh vkareh force-pushed the music-app-autostart branch from 6d8e732 to e9df27a Compare February 7, 2024 14:14
@mark9064
Copy link
Member

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 vkareh force-pushed the music-app-autostart branch from e9df27a to dfb4e34 Compare February 9, 2024 19:26
@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
Member

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
@vkareh vkareh force-pushed the music-app-autostart branch from da53d2d to d77f02c Compare February 10, 2024 15:35
@vkareh vkareh requested a review from FintasticMan February 10, 2024 15:36
@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 vkareh force-pushed the music-app-autostart branch from d5d6c62 to 1da02a1 Compare February 12, 2024 15:50
@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 vkareh force-pushed the music-app-autostart branch from 1da02a1 to 9c8432f Compare February 12, 2024 19:10
@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 79ea5ec to f9c2dce Compare February 19, 2024 01:10
@vkareh vkareh force-pushed the music-app-autostart branch from f9c2dce to 87c6973 Compare March 18, 2024 12:51
@vkareh vkareh force-pushed the music-app-autostart branch from 87c6973 to 6987f23 Compare March 26, 2024 12:15
@vkareh vkareh force-pushed the music-app-autostart branch from 6987f23 to 9d34d25 Compare April 12, 2024 13:00
@vkareh vkareh force-pushed the music-app-autostart branch from 9d34d25 to 25d2f45 Compare May 13, 2024 14:55
@vkareh vkareh force-pushed the music-app-autostart branch from 25d2f45 to efe295e Compare June 10, 2024 14:34
@vkareh vkareh force-pushed the music-app-autostart branch from efe295e to 777badf Compare June 19, 2024 15:30
@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from fce9fc4 to 1d4ebb3 Compare August 19, 2024 17:07
@vkareh vkareh force-pushed the music-app-autostart branch from 1d4ebb3 to d360f4e Compare August 22, 2024 15:53
@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?

@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from 9da21a2 to c73f8a9 Compare September 23, 2024 13:06
@vkareh vkareh force-pushed the music-app-autostart branch from c73f8a9 to d7f2e15 Compare October 3, 2024 12:35
@vkareh vkareh force-pushed the music-app-autostart branch 2 times, most recently from 5ee8054 to 1c569fd Compare October 28, 2024 14:46
@mark9064 mark9064 added the new feature This thread is about a new feature label Nov 18, 2024
@vkareh vkareh force-pushed the music-app-autostart branch from 1c569fd to 28bed03 Compare November 20, 2024 14:18
KaffeinatedKat and others added 5 commits December 4, 2024 13:18
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
@vkareh vkareh force-pushed the music-app-autostart branch from 28bed03 to c225068 Compare December 4, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This thread is about a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants