1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-26 15:00:13 +02:00
Commit Graph

226 Commits

Author SHA1 Message Date
NekoBox
72e2475389 getDeviceSupport() add check for deviceSupport being null 2022-08-22 10:35:06 +02:00
Gabriele Monaco
43d637bd1f Calendar sync: added allDay field in intent
Events added through DeviceCommunicationService will have the field too
2022-08-22 10:34:22 +02:00
José Rebelo
ba565df088 Xiaomi Smart Band 7: Initial support 2022-08-19 23:13:27 +02:00
Andreas Shimokawa
0fe88274e0 Fix regression with active auto connect sice multi-device got merged
1) The AutoConnectIntervalReceiver was completely disabled when a device went into WAITING_FOR_RECONNECT state
2) The logic inside AutoConnectIntervalReceiver was broken, so that a timer never got started
2022-08-05 15:22:21 +02:00
vanous
f589487588 Adjust service for CalendarReceiver for multidevice (#2765)
Co-authored-by: vanous <vanous@noreply.codeberg.org>
Co-committed-by: vanous <vanous@noreply.codeberg.org>
2022-07-20 17:29:40 +02:00
José Rebelo
152f19575f Make calendar blacklist configurable per device 2022-07-05 19:58:21 +02:00
José Rebelo
33d433d206 Make transliteration configurable per-language 2022-06-15 18:40:28 +02:00
José Rebelo
b29900f671 Fix build after multi-device-support rebase 2022-06-14 23:33:56 +02:00
dakhnod
4a8523f790 multi-device-support (#2526)
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>
2022-06-14 18:05:41 +02:00
vanous
5e5d8d4dd9 Add missing commit from PR2695 2022-06-09 16:48:31 +02:00
José Rebelo
b07cd54468 Mi Band 5: Send GPS location to band during workout 2022-06-09 10:32:26 +02:00
mvn23
9ca3fff101 Add support for native Do Not Disturb call/SMS functionality on Fossil watches 2022-05-16 21:59:02 +02:00
José Rebelo
682b215985 Huami: Send media volume to device 2022-05-11 00:23:18 +01:00
José Rebelo
5c6edea233 Mi Band 5: Add support for World Clocks 2022-05-10 13:59:25 +02:00
José Rebelo
c4874de11a Sony WF-SP800N: Initial Support 2021-12-26 19:17:21 +01:00
José Rebelo
710b6f6699 Mi Band 3: Add support for Reminders 2021-12-11 22:39:18 +01:00
mvn23
3c4799a339 Add support for native Do Not Disturb functionality on Fossil watches 2021-11-23 17:22:27 +01:00
Dmitriy Bogdanov
e28beaae48 Refactoring: localize notification handling in GB
* 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.
2021-05-29 23:17:39 +02:00
Arjan Schrijver
31d2563a18 Fossil Hybrid HR: Show correct notification icons (#2251)
Co-Authored-By: Arjan Schrijver <arjan5@noreply.codeberg.org>
Co-Committed-By: Arjan Schrijver <arjan5@noreply.codeberg.org>
2021-04-20 09:55:27 +02:00
vanous
9fc02ff09b move transliteration to per device to DeviceCommunicationService, plus migration, fix #2237 2021-03-28 13:33:08 +02:00
License Bot
1b5402dcb4 update license headers 2021-01-10 23:38:13 +01:00
Andreas Shimokawa
0d49eaaf9e Pebble: move canned message to per-device settings (including migration)
This also cleans up some useless preferencehandlers that only change summary by
using app:useSimpleSummaryProvider="true" for EditText
2020-10-13 00:27:22 +02:00
Andreas Shimokawa
7980d928a8 Add experimental support for TinyWeatherForecastGermany 2020-07-05 21:54:10 +02:00
License Bot
d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
Andreas Shimokawa
6e4240e61c compile fix: typo 2019-12-24 00:07:31 +01:00
Andreas Shimokawa
6f91e6053e cleanup autoconnectintervalreceiver when unregistering 2019-12-22 12:47:43 +01:00
Andreas Shimokawa
09632afb78 Huami: Fix stuck in connecting for most cases
This happened when sending a notification while doing authentication.
The reason the notification came though is the "auto connect" code that is
supposed to connect when a message arrives, so that it does not get lost.

This code and DeviceSupport::useAutoConnect() is probably totally useless by now
and could be removed in favor of the "waiting for reconnect" state.

The bug could have been solved by setting the device busy during authentication
in Huami code, but I did it by...

Note to self:
"Block everything except a disconnect request in DeviceCommunicationService
if the device is not yet initialzed but connected, assuming it is somewhere in
the middle doing something important"
2019-12-20 07:58:26 +01:00
License Bot
1dc8c26e2a Update license headers 2019-12-06 22:51:43 +01:00
FYG_license_bot_ignore_me
8e5c4b4602 Update license headers 2019-11-23 21:53:22 +01:00
Andreas Shimokawa
c7053747cd Add active reconnection
Closes #1724
Closes #1632
Closes #1452
Closes #1271
Closes #564

(Probably more)
2019-11-19 14:40:20 +01:00
Andreas Shimokawa
876515f1fd Amazfit Cor: support custom emoji font
This commit refactors code and implements a custom device specific string
filter, which does nothing by default.
The implementation in HuamiSupport does the custom emoji conversion.

The setting has been moved from devicesettings_amazfitbip.xml to an extra file
As soon as there is a custom font for Mi Band 2/3/4 it is sufficient to add
"devicesettings_custom_emoji_font.xml" to the list of supported settings
in the appropriate coordinator and everything will work.
2019-09-14 00:05:39 +02:00
Nephiel
b40c3ade85 Amazfit Bip: Add emoji support when using custom font firmware 2019-08-31 22:32:18 +02:00
Andreas Shimokawa
8bed673a95 Annotate LineageOsWeatherReceiver as Android >=M, and only try to use it with Oreo or later 2019-08-22 21:31:08 +02:00
keeshii
a70aa5e749 Added LineageOs Weather receiver. 2019-08-22 21:28:13 +02:00
Andreas Böhler
dc22aabb1c Add support for muting an incoming call 2019-05-25 15:56:21 +02:00
License Bot
9aadb2f2fd Update license headers 2019-04-21 18:53:10 +02:00
cpfeiffer
c9f1c110b0 Merge remote-tracking branch 'github/pr/1292' 2019-03-04 22:10:23 +01:00
cpfeiffer
f3a7861fdb Fix some lgtm warnings 2019-02-28 21:57:45 +01:00
Sebastian Kranz
6a04c78b0e Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into zetime 2019-02-20 14:24:59 +01:00
Sebastian Kranz
a7553188f9 Reading the device preferences from the watch and set them in the ZeTime menu. 2019-02-20 14:09:21 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
Daniele Gobbetti
75d3dffb14 Migrate to androidx support libraries and bump compile SDK version
"Optimize imports" has been run on all source files, there might be
unrelated changes, but these should be harmless.
2019-01-26 16:00:56 +01:00
cpfeiffer
903b50c2c5 Improved DB-based alarms
- got rid of GBAlarm
- added migration for prefs-based alarms
- various cleanups
2019-01-07 01:15:49 +01:00
Matthieu Baerts
22904667b8 emoji: do a lazy initialisation
The goal is not to slowdown the startup but also to do this
initialisation only when it is needed.

Suggested-by: cpfeiffer
2018-12-23 23:39:09 +01:00
Matthieu Baerts
8d78c45e7d messages: convert emoji's to supported chars
Some devices don't support emoji's and display a series of `?` chars.
Instead of that, replace them by `:<emoji>:` text, e.g. `A 🐱` is
replaced by `A 🐱`.

This is done by using 'android-emojify' project and their
`EmojiUtils.shortCodify(text);` function.

For more details about this lib released under MIT license:

    https://anitrend.github.io/android-emojify/
2018-12-23 12:52:49 +01:00
Andreas Shimokawa
b020d59f54 Implement factory reset feature in debug activity
Implemented for Mi Band 1/2/3, Cor, Bip

Could be implemented for Pebble by deleting all blobdbs etc

Related to #109
2018-12-16 16:06:12 +01:00
Andreas Shimokawa
59f8e72410 Notification actions refatoring and fixes
- Fixes "Mute, Open, Dismiss" to work again on pebble
- Greatly reduces complexity in PebbleProtocol, since all logic for adding specific reply actions to notification have been moved to generic code

Fixes the rest of #1336 (the part that says "Additionally, dismissing a notification on the watch no longer dismisses it on the Android device")
2018-11-15 15:53:04 +01:00
Andreas Shimokawa
5fc2a704a3 Pebble: Always allow reply action even if untested features are turned off 2018-11-01 17:02:33 +01:00
Daniele Gobbetti
eede85a9c9 Various improvements and bugfixes to notification handling
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
2018-10-31 21:47:12 +01:00
cpfeiffer
f142003f09 Avoid boxing 2018-09-16 00:12:40 +02:00
cpfeiffer
898165ce0b Avoid lots of false static analysis warnings 2018-09-15 23:30:39 +02:00
Dikay900
64da085942 make heart rate values configurable and use singleton for heartrateutils
to listen for preference changes
2018-09-02 12:57:52 +02:00
José Rebelo
cc6c57bd4c Add support for LED Color, FM Frequency 2018-08-31 14:03:39 +01:00
License Bot
696653eabf Update contributors list and license headers. 2018-08-29 21:30:23 +02:00
Daniele Gobbetti
9517fa211e Intercept alarm actions of the google clock application
Implemented blindly based on the information provided in #1199
Fixes #1199
2018-08-10 18:36:29 +02:00
Andreas Shimokawa
da58e22afe Only start MusicPlaybackReceiver if device supports music info
Also block sending music info in HuamiSupport if device does not support it
2018-08-07 12:44:00 +02:00
dakhnod
63cb70ac9a Fix missing sourceAppID field 2018-07-23 02:50:05 +02:00
Martin
91cbdfde10 added time limited on auto-fetch, and removed the creation of multiple autoFetchReceivers 2018-07-01 22:57:48 +02:00
License Bot
225a600aed Update license headers 2018-06-25 18:35:46 +02:00
Daniele Gobbetti
6807714af3 Register autofetch receiver in DeviceCommunicationService
This allows the register to be registered only when the device is connected,
and also toggling without completely exiting the application.

The logic in the receiver itself was simplified and an explanation added
to the preference summary.
2018-06-23 11:19:09 +02:00
Daniele Gobbetti
e6748c34fc Update the notification from DeviceManager instead of DeviceCommunicationService
Since the device object (local to DCS) is set to null on disconnect, the
notification could not get updated from within the receiver. DeviceManager
does not have such issues.

The problem appeared with 3f421facab
2018-05-13 20:19:09 +02:00
Andreas Shimokawa
3f421facab Always cleanup device and receiver in service when disconnecting
Fixes #1093

I have no idea why the code was like this, so the change might have some bad consequences...
2018-05-11 20:50:29 +02:00
TaaviE
08feaf30e1 Fixed a bunch of misspells. 2018-03-31 17:31:48 +02:00
Andreas Shimokawa
29a05f1d8f refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic
This removes misuse of testNewFunctionality() and support fetching GPS data and debug logs
Fetching debug logs (Amazfit Bip/Cor) is now accessible in the debug activity
Fetching GPS data can be done by swiping in the list activity.
TODO: actually refresh list when fetching data is done :P

Also fix some android studio warnings on the go...
2018-03-31 16:21:25 +02:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
Daniele Gobbetti
888e7fa229 Add support for Omnirom Omnijaws weather service.
This uses a contentobserver and doesn't do anything if it's not available.
Should be feature equivalent to the LineageOS weather receiver.
2017-12-17 22:35:17 +01:00
Andreas Shimokawa
f0ac296492 Initial support for cyanogenmod/lineage weather provider
TODO:
- also reconstruct json for Pebble background js fake replies
- find a better location for settings
- interatively display candidates when looking up location
- grey out setting on non-cm/los devices
2017-12-11 19:09:37 +01:00
Andreas Shimokawa
879272deb7 Weather: refactoring and support forecast for more than one day 2017-11-29 23:57:36 +01:00
Andreas Shimokawa
1e324acd65 Mi Band 2/Bip/Cor: Whole day HR Measurement 2017-11-11 00:04:51 +01:00
Daniele Gobbetti
5417c5b5f6 Change notification, and fix the connection logic:
- fix bug that caused the wrong device to be connected sometimes
- add accent color
- add battery status
- remove duplicated title
- allow to connect also before first connection (the last connected device will be used)
2017-10-30 21:37:31 +01:00
Daniele Gobbetti
5262c6e3d7 Add quick actions buttons to Gadgetbridge notification #759
- Disconnect button if connected
- Fetch activity if connected and supported by device
- (re)connect the last connected device if disconnected

Known bug: In the last case, if multiple devices were connected, the wrong device gets re-connected
2017-10-20 22:49:53 +02:00
Andreas Shimokawa
6603b3fa05 Merge branch 'background-javascript' 2017-10-16 23:06:36 +02:00
License Bot
8f06e36c00 Update license headers 2017-10-16 09:38:02 +02:00
Daniele Gobbetti
af6271a428 Merge branch 'master' into background-javascript 2017-09-25 11:21:11 +02:00
Frank Slezak
6ec1555178 Add support for dynamic Pebble background colors (#819)
Pebble: Add support for dynamic Pebble background colors
- Add a couple additional icon types
  - Add Lighthouse (currently unused)
  - Add Transit (public transportation app)
- Tweak the colors on existing icon types
- Implement logic to grab primary (vibrant) color from app logo
  - The color will be used when displaying a notification for an app
    that does not have any configs bound to it.
- Alter NotificationType to support a color (named pebbleColor)
- Alter the Pebble notification poster to listen to the color from
  the notification
- Alter the DeviceCommunicationService to allow for color passthrough.
- Add logic to convert HEX or Integer representations of RGB888 colors
  to Pebble RGB222 format.
- make the package name retrieved lowercase.

Fixes: #815
2017-09-19 13:24:31 +02:00
Daniele Gobbetti
bb962001a5 Merge branch 'master' into background-javascript
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java
2017-09-03 16:49:27 +02:00
Andreas Shimokawa
eaf7b76715 Pebble: Try to support spotify
untested
 #704
2017-09-01 23:47:03 +02:00
Andreas Shimokawa
ceec76b4f6 Pebble: preparations for js appmessage ack/nack callbacks 2017-08-01 00:03:28 +02:00
Andreas Shimokawa
bbbb9dd448 Pebble: do not start calendar event listener at all when calendar access is denied
Fixes #678
2017-05-09 12:32:00 +02:00
License Bot
8af9054f2d Update license headers 2017-04-26 00:14:25 +02:00
Andreas Shimokawa
bc4503c8bf Pebble: Add option for Calender Timeline sync (default on) 2017-04-24 12:39:40 +02:00
cpfeiffer
9ed8004a69 Fix rare NPE 2017-04-22 23:56:04 +02:00
cpfeiffer
1e4351b03a Silence lint warning 2017-04-21 22:23:50 +02:00
Andreas Shimokawa
965ba190a6 Calendar Sync: Fix location not being passed to device code
Now location is displayed on the pebble ;)
2017-04-21 10:51:06 +02:00
Andreas Shimokawa
7ee20348db Only sync Calendar and Sunrise/Sunset on devices that support it 2017-04-19 21:51:23 +02:00
Andreas Shimokawa
a28d27839f Merge branch 'master' into feature-calendarsync 2017-04-19 20:19:15 +02:00
João Paulo Barraca
9f0d260e7a HPlus: Improve connection process (#651)
* Clean HPlus services and characteristics
* Improve connectivity
2017-04-18 10:47:28 +01:00
Andreas Shimokawa
35efa30c4b Calendar Sync: Only enable calendar broadcast receiver when device is initialized
This excludes it from any auto connect logic.
We are now save to sync the calendar once in contructor.
2017-04-17 21:09:29 +02:00
Daniele Gobbetti
1e231e6129 Move the Calendar receiver code in the proper place. 2017-04-17 20:33:39 +02:00
Andreas Shimokawa
9970f8017f Calendar sync: save sync status to db to avoid leakage of deleted events
We now have a per device database that tracks sync states for calendar entries
We still cannot track changed calendar entries that where changed while we were disconnected
2017-04-16 19:37:43 +02:00
Daniel Hauck
ccb58f0f3c Basic calendar sync using additional receiver (#654) 2017-04-16 12:34:37 +02:00
cpfeiffer
16af0724dd Replace method pair() with connectFirstTime()
Should help with #642 for hplus which did not implement pair()
2017-04-12 21:35:40 +02:00
cpfeiffer
202ae53d71 Ensure that a newly discovered and initialized device will be displayed
Fixed a race condition between ACTION_DEVICE_CHANGED event handlers:
- DeviceCommunicationService added the device to the database
- DeviceManager notified the views to be refreshed

When the latter happened before the former, thew new device would not
be displayed.

=> Let DeviceManager do both.
2017-04-07 21:17:37 +02:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
Andreas Shimokawa
08080b02bb Drop support for legacy (pre 0.12.0) database 2017-02-23 22:44:44 +01:00
Avamander
23f2dd35d4 Extract music shuffle and repeat states and set the song progress to auto-update. (#554) 2017-02-17 09:01:37 +01:00
Avamander
fea31924ba Music data handling improvements (#550)
* Fixed extracting the track length.

* Added current track and total track count.

* Few small changes to make sure everything gets updated properly.

* Remove unnecessary includes.
2017-02-11 09:49:01 +01:00
Andreas Shimokawa
f35e3e460d remove K9 receiver as is works better with generic notifications 2017-02-09 17:35:46 +01:00
cpfeiffer
4f0674d038 Support for alarm clock notifications for Mi1 + Mi2 #538
No support for Pebble and HPlus for now.

Atm relies on the CM deskclock alarm, which nicely broadcasts
events about the current alarm. See
https://github.com/CyanogenMod/android_packages_apps_DeskClock.git
2017-02-07 23:49:10 +01:00
Daniele Gobbetti
e08a900978 Refactor the MusicPlaybackReceiver and related files
Add actions to the filter (this should help with #536)
Add "copy" constructors to MusicSpec and MusicStateSpec, and use those when receiving an updated intent, this way partial updates do not disrupt the local information.
Iterate over incoming extra keys, explicitly check the incoming type and use only known type. This could help with #533

Possible problem: this code iterates over every key of the incoming bundle.
2017-02-01 22:55:40 +01:00