Closed hichamboushaba closed 4 years ago
Thanks a lot for your help.
as quoted in the android documentation:
Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.
Moreover, setExact is available only after API 19
@Abdelwahad I really don't understand your comment, the application is targeting API 28, so what you said doesn't apply here, set
method will be non exact, you should be calling setExact.
And the app is not even compatible with devices running API 19 and earlier, so you don't have to worry about the existence of the API, as setExact
will be there always.
You are absolutely right, we will try to add this on a future version after testing
@hichamboushaba Please create a pull request, after all it's your contribution
@hichamboushaba The change you suggested was included in the version 1.1.0, thanks for your contribution
Thanks @majhamza.
Salam Alaykum, I want to thank you first for your work on the app, and hopefully it will be of help to our country.
I want to just to put a note on a possible inconsistency in the way events are scheduled in the app using
AlarmManager
, here: https://github.com/Wiqaytna-app/wiqaytna_android/blob/fecb6622e836658f96842e4b4e889a9ebd54497b/app/src/main/java/covid/trace/morocco/scheduler/Scheduler.kt#L29-L40 So before Marshmallow you use the methodset
which is inexact, but after Marshmallow you use the methodsetExactAndAllowWhileIdle
which is exact, and more it awakes device if it's in Doze mode. So either you should usesetExact
on the APIs before if you really need the exactitude, or keep using theset
method for all APIs.Another question please, did you test the app against Doze, and against the task killers that Chinese OEMs (Huawei, Xiaomi, Oppo...) use on their devices? I'm asking because from what I understand from the
BluetoothMonitoringService
's code, the app will useCommandHandler
to reschedule scanning at different period of times, but if the device is sleeping, or in Doze mode, the events won't be fired I think.