1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-07 14:11:36 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Davis Mosenkovs
7a79a1d0f5 Add wake lock and wakeup for time sync
Wake lock with around 10 second timeout is a quick and dirty solution,
however as the time sync should happen once per several days the 10
second wake time should not be an issue.
2024-02-18 19:12:30 +00:00
Davis Mosenkovs
cc5078332b TimeChangeReceiver: Ensure the alarm is set
Ensure TimeChangeReceiver alarm is scheduled when enabling
datetime_synconconnect and registering TimeChangeReceiver broadcast
receiver.

It is important to re-schedule the alarm after registering broadcast
receiver, because:
1. if broadcast receiver was unregistered while previous alarm arrived,
there is no alarm scheduled;
2. re-scheduling the alarm resets the periodic time sync timer when
first device is connected (which is desired).

It is important to re-schedule the alarm when datetime_synconconnect
gets enabled, because there might be no alarm scheduled.

Call onSetTime() when enabling datetime_synconconnect.
2024-02-18 19:12:30 +00:00
Davis Mosenkovs
31fc266f94 Periodically sync time on all connected devices
Sync time every 43 hours, 53 minutes and 23 seconds.
Interval is a bit smaller than 2 days.
Interval is a prime (in seconds) so time of sync will slide over time.

If next DST change is less than 48 hours in future, wait for it.
2024-02-18 19:12:30 +00:00
FYG_license_bot_ignore_me
4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
José Rebelo
50c474e9ef Fix crash when timezone has no next DST transition 2023-09-04 14:12:59 +01:00
José Rebelo
4c7cb1cadc Fix ACTION_DST_CHANGED action 2023-09-02 11:08:19 +01:00
José Rebelo
a4c79a9395 Attempt to fix DST changes 2023-09-02 10:13:14 +01:00
License Bot
d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
cpfeiffer
e35ce978bd Remove now unused imports + fix one more SharedPreferences usage 2016-04-25 23:43:19 +02:00
cpfeiffer
0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
cpfeiffer
69b64ed4b6 More logging for time/timezone changes
(trying to find an explanation for #91)
2015-09-05 00:14:09 +02:00
cpfeiffer
a1cb246e27 Add and use a "client interface" for the actions of the service
Previously, the DeviceCommunicationService was invoked directly,
via
Intent intent = new Intent(foo, bar);
intent.setExtra(EXTRA_BAZ, baz);
startService(...);

and this was scattered throughout GadgetBridge.
Now there is a "frontend" available, so that you can call
the service more easily, like
GBApplication.deviceService().connect();

For a start, this client interface (DeviceService) actually
implements the same interface (EventHandler) as the receiving side
(DeviceSupport). This may change in the future.

This will also make testing much easier, because we can use
this client interface to invoke the test service as well.
2015-08-21 01:03:57 +02:00
cpfeiffer
c407ed1a76 Last refactoring for now: BluetoothCommunicationService
- rename to DeviceCommunicationService
- move all bluetooth related bits into separate DeviceSupportFactory
  class
2015-08-04 01:01:14 +02:00
cpfeiffer
7c597b325a Big refactoring: move classes and packages around to get a better structure
- model package contains mostly shared interfaces (UI+service), not named GB*
- impl package contains implementations of those interfaces, named GB*
  the impl classes should not be used by the service (not completely done)
- the service classes should mostly use classes inside the service and deviceevents
  packages (tbd)

Every device now has two packages:
- devices/[device name] for UI related functionality
- service[device name] for lowlevel communication
2015-08-03 23:09:49 +02:00
cpfeiffer
9a26769c3e Search & replace: use slf4j for logging instead of Logcat directly
For a start, use android-logger as backend. Needs a better configuration
but no time right now.

For file-logging we will use logback as slf4j-implementation.
2015-05-12 06:33:37 +02:00
Andreas Shimokawa
e78c912be3 Only sync time on time/timezone changes if appropriate option is set. 2015-05-10 11:21:16 +02:00
Andreas Shimokawa
157deff237 Send current time to device if time/timezone changes. Closes #51. 2015-05-07 23:46:18 +02:00