Introduce the concept of primary and secondary weathers:
* Primary weather keeps the same behavior as previously across all weather providers, so it's non-breaking. This location is not necessarily the current location, just the primary weather location set by the user.
* The GenericWeatherReceiver now has a new extra WeatherSecondaryJson, that receives a json list with secondary weather locations.
It's guaranteed that the primary weather always exists, so the list of WeatherSpecs provided to devices is never empty. Update all support classes accordingly.
This also touches parts of the app not only used for bangle.js.
E.g. pending intents gets new flags from SDK 23 inclusive.
Bluetooth permissions are updated to work on SDK 31.
Permission handling is updated to the new way for doing it with
introduction of a new function. This is called for newer sdk versions.
bump Bangle.js flavor targetSdkVersion to 31
update comments re SDK 31
set the 'exported=true' I introduced to false instead - except for three places
add uses-permission for handling bluetooth in order to work on api >30
add if-blocks adding FLAG_IMMUTABLE to PendingIntents on api >30
add link to bluetooth documentation
Add comment to banglejs manifest. Add requirement annotation to ControlCenterv
bump compileSdkVersion to 31
add "OpenAppSettings" permission popup while working out individual permission popups on android 13
if SDK < 31 do permissions one by one, else send user to app info page to switch permissions manually
working solution, but needs cleaning
do some cleaning, not done though
remove some logging
remove import Log
tweak and remove toasts in new permissions handling
Change conditions `> Build.VERSION_CODES.Q` to `>= Build.VERSION_CODES.R` matching the style used everywhere else
Revert "Change conditions `> Build.VERSION_CODES.Q` to `>= Build.VERSION_CODES.R` matching the style used everywhere else"
This reverts commit 2929629ff43fbb685eb3d15e42459f321f68fa11.
Revert "add if-blocks adding FLAG_IMMUTABLE to PendingIntents on api >30"
This reverts commit ed8e1df7bb8b71fee745fbf9d10747d47c8f6cb8.
Pending intents gets `PendingIntent.FLAG_IMMUTABLE` if `(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)`.
Bangle.js: undo `@RequiresApi` code R
... to remove error in Android Studio where declared required api was
higher then minSDK version.
Use FLAG_MUTABLE for reply to test notification
This should fix Gadgetbridge crashing when replying to the test
notification from the debug activity. As reported here:
https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2924#issuecomment-917282
Change to use FLAG_IMMUTABLE/_MUTABLE from SDK 23
... as suggested by Android Studio. This is supposed to make the app
more secure by not allowing certain changes to pending intents where
they are not expected. If I understood correctly.
Add PendingIntentUtils class to manage mutability
this PR aims to add device for multiple connected devices at once.
A lot of stuff already works, some things need to be done:
- [x] change DeviceCommunicationService to hold multiple devices and supports
- [x] implement connect / disconnect logic
- [x] widgets, not really suited for multiple devices, so far
- [x] change the notification to show multiple devices
- [ ] change GBDeviceService#onFindDevice and similar API functions to target individual devices, not all connected.
- [x] move auto-reconnect setting to device settings
- [x] fix music event crash
- [x] work out behaviour when pressing "connect" from notification
- [ ] handle service crashes
- [ ] suit coordinator methods for multiple devices of same kind
- [x] change ACL_CONNECTED receiver to connect to devices that are not currently registered in DeviceCommunicationService
- [ ] adjust after-boot auto-connection logic
- [ ] fix hanging device support. Device says disconnected, GB says connected
- [x] firmware updater doesn't work
My attempt to make onFindDevice work was to change the arguments to ```EventHandler#onFindDevice(GBDevice device, boolean start)```.
The Problem is that this forces the device-specific implementations to also accept GBDevice as an argument.
Co-authored-by: Daniel Dakhno <dakhnod@gmail.com>
Co-authored-by: Andreas Shimokawa <shimokawa@fsfe.org>
Co-authored-by: dakhnod <dakhnod@gmail.com>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2526
Co-authored-by: dakhnod <dakhnod@noreply.codeberg.org>
Co-committed-by: dakhnod <dakhnod@noreply.codeberg.org>
- rename some methods to better indicate their functions.
- make the notification filter to be allow or deny list,
solves #2256 and #336
- make app word filter to behave based on allow/deny settings.
- make Pebble notifications to honor the allow/deny settings.
- add generic "debug function" to Debug activity.
- add Message privacy mode settings, solves #2279
* Handle all notifications via GB.
* Create all notification channels in one place.
* Lazily init notification channels.
* Re-create notification channels to update their localized names.
- make layout transparent rather then red, update the preview image
- move battery to top row to reduce size, add status indicators with icons
- add preference settings, to choose for which device this widget is
- data is no longer calculated for all devices but for a selected device
- add debug items to view and erase widget settings and registrations
(debug items are intentionally not translatable yet)
Prevent duplicate notifications with a dedicated data structure (not reusing
the anti-burst one) #1062, #657
Pebble: Forward the actions attached to notifications (not only reply)
inspired by the work of dnastase #705