OpenTails / CRUMPET-Android

The Brains For Your Tail Company Gear!
GNU General Public License v3.0
31 stars 7 forks source link

fix permanent notification + make it useful #145

Open ToeiRei opened 7 months ago

ToeiRei commented 7 months ago

Currently the permanent notification is broken. Looks like the permissions are missing.

As we have a permanent notification up there already, it would make sense to add moves to that aka pin moves/positions to the notification to trigger without actually opening the app.

leinir commented 7 months ago

The first part is kind of a non-problem, it turns out - after looking into it, since the notification is there at the moment to allow us to have a foreground service, the documentation tells us that while we still do have to post the notification, we don't actually have to ask for the permission to do so (it will instead simply not show up if that permission is missing).

However, the "make it useful" part does in fact make it important that we ask for that permission. So if we use this issue to come up with a few ideas for what sort of actions we might want there, then we can make that choice and get it implemented. i'll start ;)

Perhaps in addition to being able to pick a few direct actions (a couple of slots (3?) seems reasonable, to avoid just turning it into the entire app), we might also add in a toggle for Casual Mode up there (or we have one user-selectable toggle that's shown there - default to casual, but allow people to also pick tilt, listen, walking, and so as we add more).

We might also add in a list of the connected gear and their battery levels (though that could be a little bit heavy)

The notification/wakelock code, incidentally, is all java code, if anybody feels like doing something with that :) i can provide some hooks with data and such from the service, but implementing the skeleton of the logic is all "normal" android java code.

ToeiRei commented 7 months ago

I tend to be out a lot with my ears and I often have kids watching me closely and I find their smile on when my ears move pretty priceless. But timing is one of those things. Kid looks at you.

You...

  1. take out your phone
  2. unlock your phone
  3. open the crumpet app (which takes a bit to load)
  4. navigate to positions or moves
  5. press the button
  6. lock the phone again
  7. stash the phone

and the kid is already looking away as you took too long. In case of a more steamlined process with a permanent notification like a spotify thingy where you can shorten it and just skip steps (2?), 3, 4 makes a lot of those magic moments happen.