BimmerGestalt / AAIdrive

Implementations of some Android Auto features as unofficial IDrive apps
MIT License
540 stars 90 forks source link

Notifications show only once per app per session #626

Open TheRealMrSteel opened 1 year ago

TheRealMrSteel commented 1 year ago

Important things first: Hufman, thanks for your amazing work 🙏. Been using this app for around a year now and the added functionality is superb. I really enjoy the Spotify and Notifications integration and I can no longer live without it! In August, I bought a new phone and immediately installed AAIdrive again. In the past months I noticed some different behavior compared to my previous phone. Hopefully I'm able to provide some more info below.

Subject of the issue

The main thing that is working differently after I switched to my new phone, is that the notifications are only shown once per app on my iDrive screen, if I dismiss (or mark as read) the notification and a new (second) notifications comes in, the notification is not shown on the iDrive screen anymore.

My devices

Car

Old phone (working)

New phone (Not fully working)

Expected behaviour

With my OnePlus 6, I got a notification for every message (notification) which came in via Whatsapp. Also notifications for Flitsmeister (a popular traffic and speedcam app) were shown for every new alert. (Which reminds me of #216, any updates on this 😄)

Actual behaviour

With my Phone (1), I only receive 1 notification the first time it triggers, and all the next incoming notifications no longer pop-up. So the first Whatsapp notifications shows, all new notifications after this dont. Same goes for Flitsmeister.

Is there anything I can still try to get this fixed, or try to debug? If the above is still not fully clear, please let me know and I will try to provide more information. Thanks!

hufman commented 1 year ago

Thank you for the very clear information! I haven't heard of this problem before, thank you for reporting it! If you are able to compile AAIdrive for yourself, please compile and run a version where LOG_NOTIFICATIONS=true and look in the adb logcat to see if there's any helpful information.

Does the phone show the notification that you previously wiped away? Do second notifications still show up if you swipe away the first notification instead of dismissing with the car interface? When you say the second notification isn't displayed, do you mean it doesn't show up on the list, or it doesn't trigger a popup?

TheRealMrSteel commented 1 year ago

Never have I ever compiled an apk via Android Studio. I took a quick look at the Developer's Guide you provided, but it looks like it will require some time to get all the preparations running for the first time.

TheRealMrSteel commented 1 year ago

I still haven't been able to find a solution for my problem. In the mean time I received an update to Android 13 which I'm running now for a week. I was hoping that would already fix the issue, but still the same. When 1.4.1 released yesterday, I decided to start fresh and completely remove AAIdrive. Installed 1.4.1 and noticed I had to take some additional steps in order to get all the right permissions Android 13 introduced (remove the restricted settings), otherwise it couldn't access the notifications:

Google is introducing a change with Android 13 that will prevent sideloaded apps from abusing the Accessibility APIs.

So lets find out if this changed something when I drive back this afternoon. If not, I will probably close this issue because I can't find a solution for it.

hufman commented 1 year ago

AAIdrive doesn't use Accessbility APIs, what do you mean? The only new permission I know about is the Bluetooth permission to start when the car connects.

TheRealMrSteel commented 1 year ago

Sorry, in that case I made a wrong assumption. If it helps I can redo all the steps I need to take after a fresh install of 1.4.1 and record my screen? Unfortunately, still the same happens regarding the notifications. The first time the notification shows as a popup in iDrive, the second time, there is no popup. Tested this with the Test Notification button, as well as Whatsapp.

hufman commented 1 year ago

I'd be curious to see a video of it, yes :) That's very curious, I'll try to think of what could be causing it!

TheRealMrSteel commented 1 year ago

https://user-images.githubusercontent.com/44800079/214696715-98ecbc91-6713-4cf6-82ef-a3ea90acdc53.mp4

This should give you some more insights hopefully.

I know earlier you mentioned that AAIdrive doesn't use accessibility services, but could it be that it is related to this quote:

In addition, the ACCESS_RESTRICTED_SETTINGS permission only gates access to accessibility services, but it’s plausible that it could be used in the future to gate access to other sensitive APIs like the notification listener.

Explained on this page ?

hufman commented 1 year ago

Ah, that is annoying :( I don't know how to handle that more smoothly :(