The group separtors (aka thousand-separtor) as used by the system locale
are used to format the string now, and we upgraded this to use UTF16 in
order to avoid problems when they are not ascii.
After setting, check if it was approved by the user, and if not
unset the checkbox again.
Bugfix:
On some Android implementations, setting this value opens a screen
even if the value is already set, while on many others that is a no-op
as you'd expect.
So for those phones we check first before we set.
This changes the notes property to be only set by the user of the
BroadcastFeedback.qml, and not from inside anymore which could break the
property binding causing strange things to happen.
This removes the Qt middle-man for requesting the camera permissions
and we just code this in our own Java class.
This solves the issue we observed where after the approval of the
user we didn't actually manage to start the camera on some phones.
This avoids using the Qt intermediate and just directly uses
the Android side, including some extra checks like "screen off".
Rework the various methods in a class.
This makes the various android support features be less hacky and instead
are based on a single class with Qt signals and slots.
We also remove the ping feature for checking online state, since Android
seems to throw a random exception (calling virtual method on null pointer
java.lang.String.size) somewhere in the OS libs when you call it the
second time.
This also implements the AIRPLANE_MODE_CHANGED listener to instantly turn
off internet the moment the user enables flight mode.
The power management turns off the network layer 90 seconds after
the application stops being in the foreground.
At least, that is what it is programmed to do. Unfortunately the
signals we listen to are not reliable across devices and many users
are reporting that this is triggered 90 seconds after start.
For now, turn off the saving feature in order to make sure that
the app operates normally for normal people.
In some locales the group separator is a unicode character that does not
fit in an 8 byte string, causing misrenderings.
We now assume that things fit in 16 bit characters which should fit all
living languages.
The Android system is so strict in its power management that a simple
request to have Pay run in the background at night for 20 seconds it is
required to completely turn off powermanagement for the app. An overkill
solution, but that is how it works now.
A nice history:
https://medium.com/its-tinkoff/android-background-restrictions-
b63e73fe508
Side-effect is that if the user granted the turning off of power
management we now have to add code to do it inside the app.
This commit checks when the app is hidden (screen turned off, other app
became front etc) then we wait for a timeout and then terminate
ourselves in order to avoid using more CPU.
When the user has had the screen locked long enough to make the app
lock, we just close the popup.
The unlock screen actually appears under popups (that's the concept of a
popup..) so this solves a leakage of data.