AsteroidOS / AsteroidOSSync

Android application to synchronize a phone with a watch running asteroid-btsyncd.
GNU General Public License v3.0
101 stars 37 forks source link

[Dual SIM] No incoming call notification for secondary SIM #167

Open Megver83 opened 2 years ago

Megver83 commented 2 years ago

I installed the app from F-Droid, version 0.22, and synced with a bass watch. Till now, it works fine, but I get no incoming call notification and the app has all permissions.

Device is a Xiaomi Redmi Note 8 running LineageOS 18, Android 11. Maybe related to #114 ?

Megver83 commented 2 years ago

OK, so I think I found something interesting. This phone is dual SIM, the watch notifies my incoming calls from one SIM, but not the other other one.

MagneFire commented 2 years ago

Thanks for reporting the issue! Great observation too!

This is an issue with the way we use PhoneStateListener where it picks the first SIM by default (https://github.com/AsteroidOS/AsteroidOSSync/blob/afb09f90f4b378bccbb07626f4776a5382432db5/app/src/main/java/org/asteroidos/sync/services/PhoneStateReceiver.java).

https://stackoverflow.com/questions/25009926/phonestatelistener-is-not-called-for-sim-slot-2 describes the same issue.

It seems that we need to create another instance of the listener and specifically listen for that SIM as well.

Megver83 commented 2 years ago

Oh, so you were not aware of this. Glad to know there's a solution. Do you publish nightly builds or something? So I can test the app before there's a release, in case you wish so

MagneFire commented 2 years ago

Indeed we were not aware of this issue.

We do not publish nightly builds, but we might be able to distribute self-signed apks when we get around to testing a solution. Unless @jrtberlin knows a better method that could use the F-Droid infrastructure so that we don't get a signature mismatch.

jrtberlin commented 2 years ago

I want to release a build on F-Droid anyway to get the recent changes published

Megver83 commented 2 years ago

I thought this was going to be fixed in 0.23. Or is it going to be in the next release?