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

185 Commits

Author SHA1 Message Date
cpfeiffer
c3c5e0415d The Real Fix #666 2017-04-27 07:57:57 +02:00
cpfeiffer
f1fbab7dd9 Revert "Revert "Adjust test case setup and fix failing tests""
This reverts commit b0384e90d5.
2017-04-27 07:57:57 +02:00
Andreas Shimokawa
b0384e90d5 Revert "Adjust test case setup and fix failing tests"
This reverts commit d9b0d639b8.
2017-04-27 07:39:36 +02:00
cpfeiffer
d9b0d639b8 Adjust test case setup and fix failing tests
- add missing call super.setUp() in LoggingTest
- make use ofGBApplication's logger and db support instead
  of adding specific test things. Avoids differences between
  the local test things and the global GBApplication instances.
2017-04-25 21:55:06 +02:00
cpfeiffer
2003d56190 Cleanup package blacklist handling
Didn't find a cause for #664, though.
2017-04-22 16:59:55 +02:00
Daniele Gobbetti
18157daf46 Ensure that the Notification listener service gets restarted if crashed.
This change adds an additional service that checks the status of the NotificationListenerService, and restarts it if it's stale/crashed.
Crashes happen mostly during development, but were reported also by users.
2017-04-19 13:23:13 +02:00
Daniele Gobbetti
2e98b1396f Do not override the android:* text colors, define our own. This fixes a crash on API 19.
Also define them in the attrs xml file and do some grouping in the colors xml.
It might be we don't need them at all, but for the time being let's keep them around.
2017-04-08 15:49:00 +02:00
Daniele Gobbetti
2c152e8447 Override textColorPrimary and not textColor as it conflicts with support libraries (e.g. snackbar text).
Further, use textColorPrimary in the graphs instead of textColor.
2017-03-11 16:48:55 +01: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
Daniele Gobbetti
c1abaaa4e0 Add support for hiding the icon in the status bar and the notification on the lockscreen.
This adds proper settings to toggle GB behavior and closes #460.
2017-01-08 15:51:56 +01:00
Andreas Shimokawa
ed38e524bf Make some static stuff non-static (potentially fixes instant run problem and leaks) 2016-12-07 23:13:51 +01:00
Andreas Shimokawa
352fc1a030 fix wrong return value 2016-11-25 14:53:12 +01:00
cpfeiffer
9bebf1d32f When memory is really low, free up some memory #436
(although we probably can't save much)
2016-11-24 21:15:27 +01:00
Daniele Gobbetti
1e6cb67edd UI refactoring of the DB management activity.
Added a method to delete the legacy DB only.
2016-08-31 17:35:28 +02:00
cpfeiffer
6340bcff15 Small cleanup 2016-08-31 00:03:20 +02:00
cpfeiffer
840a125c81 Fix compilation 2016-08-27 22:55:00 +02:00
cpfeiffer
8d6e6c8675 Upon request, delete not only the old, but also the new database 2016-08-27 22:51:00 +02:00
Andreas Shimokawa
5ab40918c0 rename database from test-db5 to Gadgetbridge 2016-08-26 23:48:54 +02:00
cpfeiffer
49b8b9ebca More robolectric stuff
- guard against multiple GBApplication.onCreate() invocations
- test DBHelper.getDevice() for a start
2016-08-25 00:00:53 +02:00
Andreas Shimokawa
4ddbbfdfb0 change db name to test-db5 2016-08-14 22:36:50 +02:00
cpfeiffer
f54163faeb centralize quit() functionality in GBApplication 2016-07-08 22:35:52 +02:00
cpfeiffer
2fa166e381 Fix potential NPE, setup environment earlier 2016-06-25 18:58:54 +02:00
cpfeiffer
0596c80381 Some migration fixes
especially: add unique index on samples using timestamp and device id
(since composite primary keys are not fully supported yet)
2016-06-19 00:40:51 +02:00
cpfeiffer
233a6155cc Add class DeviceManager that provides access to the list of managed devices
Basically moved code out of ControlCenter to a separate class. Also provides
change events when the device list has changed, or changes to the device
state have occurred.
2016-06-18 23:35:34 +02:00
cpfeiffer
61957d6cb0 WIP: more db work 2016-06-14 20:13:08 +02:00
cpfeiffer
3b87966fe9 Merge branch 'master' into db-refactoring 2016-06-06 22:16:40 +02:00
cpfeiffer
50b7a02ef2 One more attempt at fixing dynamic logging reconfiguration
- moved out of GBApplication to class Logging
- the main thing is: when start()ing the FileAppender again, it *must*
- be configured to be non-lazy, otherwise it won't open the stream ever again.
2016-05-26 23:46:21 +02:00
cpfeiffer
d5cca84780 Small fixlets 2016-05-20 22:04:30 +02:00
cpfeiffer
0267ddb356 Merge branch 'master' into db-refactoring 2016-05-20 21:49:59 +02:00
cpfeiffer
400ae2bc3b Fix lint warnings using @TargetApi 2016-05-20 21:49:25 +02:00
cpfeiffer
fa34cf9a17 Merge branch 'master' into db-refactoring 2016-05-20 21:42:30 +02:00
Normano64
31eabe9605 Fixed things based on feedback 2016-05-19 23:58:13 +02:00
Normano64
8a91628322 Detects if Do Not Disturb is in use.
Can handle sms and phone calls from priority senders when in Priority
only, but doesn't handle events and reminders.
2016-05-19 16:34:59 +02:00
cpfeiffer
75703b0dea Import and Export db are back 2016-05-17 00:51:00 +02:00
cpfeiffer
2d2df64003 Port schema migration to greendao 2016-05-16 23:54:51 +02:00
cpfeiffer
40a376bbd0 Merge branch 'master' into db-refactoring 2016-05-16 23:01:16 +02:00
cpfeiffer
3e0bc16741 More WIP, but we're getting closer
current state:
- storing samples works (tested only mi band)
- charts work
2016-05-16 23:00:04 +02:00
cpfeiffer
8ca821ab8a More WIP on db refactoring 2016-05-13 23:47:47 +02:00
cpfeiffer
1a353239c4 Fix log content 2016-05-08 21:38:55 +02:00
cpfeiffer
b363d08efb WIP: a little work towards greendao
need to think of how to integrate MiBandActivitySample and PebbleActivitySample
into the app. There's GBActivitySample, MiBandSampleProvider, PebbleSampleProvider,
etc.
2016-04-29 23:12:30 +02:00
cpfeiffer
64a6b9a936 Merge branch 'master' into db-refactoring 2016-04-29 22:28:53 +02:00
cpfeiffer
5e02724c4c Make automatic reconnect after connection loss configurable #293
Mi Band: automatically reconnect when the device is back in range

Also: #89
2016-04-28 23:17:13 +02:00
cpfeiffer
0704915a88 Move parsing of preference strings to int values to Prefs 2016-04-25 23:39:03 +02:00
cpfeiffer
0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
Andreas Shimokawa
3fefb57fdd Fix colors in alarm activity for dark theme 2016-04-23 23:24:56 +02:00
cpfeiffer
0427294227 Dynamically enable/disable logging #288 2016-04-18 00:20:40 +02:00
cpfeiffer
a45eacf9b8 WIP: schema update, ... #206 2016-04-17 19:52:51 +02:00
Andreas Shimokawa
faa6a9d906 use android:summary="%s" for ListPreferences 2016-04-14 16:44:44 +02:00
Andreas Shimokawa
f76a1ba16f allow to switch to dark theme im settings 2016-04-14 16:15:58 +02:00
Andreas Shimokawa
4bcebca744 Work towards dark theme, remove -v21 specific theme definition 2016-04-14 15:21:25 +02:00
Andreas Shimokawa
ed85fd5011 convert byte and short values related to activity tracking to int
This avoids a lot of problems because java
- does not know unsigned values
- jvm and dalvic do not internally support byte and short
- sqlite does not know them either
2016-02-29 20:54:39 +01:00
danielegobbetti
6eb35b955e Prevent race condition on android 6 (?) at the cost of losing the gender data (we cannot display a toast at this point unfortunately). 2016-02-21 16:46:48 +01:00
danielegobbetti
b858e50804 Use strings to store activity shared preferences.
System has trouble with accessing integer in the preferences, so let's not use them.
2016-02-21 13:04:32 +01:00
Daniele Gobbetti
baf5eee72f Refactored the User Activity-tracking related preferences.
Created a new device-independent class ActivityUser to hold the data
Moved the constants from the miband constant class to the ActivityUser class
Removed the miband-specific in favor of common-prefixed preferences (with upgrade support for legacy values)
Changed the way the gender is stored to an integer value
Removed the hardcoded default values for user data in favor of static fields of the ActivityUser class
2016-02-02 17:33:24 +01:00
Andreas Shimokawa
46bbab7df0 rename IDSenderLookup to LimitedQueue and store Object instead of String 2016-01-09 16:07:22 +01:00
Andreas Shimokawa
9f60bf3561 fix compilation 2015-12-23 22:15:50 +01:00
Daniele Gobbetti
3ee418a45b Implement pushing messages upon watchapp start.
This watchface is used as example: https://github.com/ygalanter/PebStyle because it doesn't initiate a connection like others do.

At the moment this is more a proof of concept^W^W^Wdirty hack then anything else.
2015-12-23 14:22:28 +01:00
Andreas Shimokawa
de5f30ae97 WIP: Work towards SMS replies / canned replies, round 3
- put random id/phone number pair into limited lookup list (last 16 sms messages) when sms arrives
- lookup the phone number when replying from the a device

THIS STILL DOES NOT DO ANYTHING USEFUL
2015-12-14 23:31:31 +01:00
cpfeiffer
e642971b4c Support for deleting/emptying the activity database 2015-12-08 23:42:58 +01:00
cpfeiffer
159c187e5e On Quit, remove all pending notifications
At least the notifications from #141 don't stay there forever, then.
2015-12-08 21:48:56 +01:00
cpfeiffer
4616dcc965 Handle case where notification.extras is not available #174 2015-11-23 22:09:47 +01:00
cpfeiffer
694b3d897f Some Javadoc 2015-10-26 23:32:03 +01:00
cpfeiffer
4533ae22ee Log otherwise uncaught exceptions (#134) 2015-10-07 23:32:58 +02:00
cpfeiffer
38c3a41279 Improve logging setup, should hopefully fix #107 2015-10-03 23:26:36 +02:00
cpfeiffer
2231dcbce3 Log GB's version 2015-10-03 22:30:11 +02:00
Andreas Shimokawa
e3533a2b18 Pebble: Allow muting (blacklisting) Apps from within generic notifications on the watch
Closes #113
2015-09-25 00:53:40 +02:00
Andreas Shimokawa
1d41f2f8e4 Refactoring
The notfification APIs now use NotificationSpec as their only parameter, which
contains all information (required and optional ones).
We no longer have separate methods and actions for SMS/EMAIL/GENERIC anymore.
The type of notification is important now, not how we received them technically.
2015-09-24 14:45:21 +02:00
cpfeiffer
77cad5c47f Initial support for testing the DeviceCommunicationService
Lots of support classes to enable local testing, without
a device or an emulator.
2015-08-22 01:09:56 +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
567f27b0f4 Some initial fixes found by static analysis #92 2015-08-16 00:17:16 +02:00
cpfeiffer
802f48011d Refactoring of database access
- the db is now exclusively locked for one thread
- the charts read from the db and analyze data in a background thread

+ some small cleanups
2015-08-03 01:21:44 +02:00
cpfeiffer
a1f60aab91 Fix logging configuration
Make sure to not invoke any logging before it is properly configured.
2015-07-25 00:09:24 +02:00
cpfeiffer
cc549a6c49 Basic database import and export (to external storage)
(In the Debug Activity)
2015-07-08 23:11:23 +02:00
cpfeiffer
f105bbbde3 Avoid crash when getExternelDir() returns null (huh!) 2015-06-21 19:44:56 +02:00
Andreas Shimokawa
d2f7169de4 Really, I see no reason to look up a string for a preference key in an xml file
If we have to use a key to lookup the string for the key, we can just use that key as the preference key.
2015-06-13 01:12:08 +02:00
Daniele Gobbetti
ac7e21be48 Remove the activity log debug file.
This partially reverts commit 8b268a676c
2015-06-12 22:30:14 +02:00
cpfeiffer
2f0d00d645 avoid WITHOUT ROWID when not running at least lollipop #62 2015-06-06 00:10:38 +02:00
cpfeiffer
c4096e6d3c Add daniele's db optimization the WITHOUT ROWID
closes #62
2015-06-05 21:46:56 +02:00
Daniele Gobbetti
8b268a676c Refactoring of the data ingestion method.
* no more ByteBuffer, but a fixed size byte array that gets flushed everytime it's needed
* log of activity data to a separate file (no DB integration yet)
* the size of the buffer must be a multiple of 3 (1 minute of data = 3 bytes) and 20 (the normal size of the chunks we get from the device)
* better logging and more comments in code
2015-06-01 22:20:22 +02:00
Andreas Shimokawa
e79f4523c3 Add SQLite database support for activity data
This is now used for morpheuz data and the SleepMonitorActivity
2015-05-30 17:28:03 +02:00
cpfeiffer
4518e8819d Make file-logging configurable 2015-05-23 00:45:12 +02:00
Andreas Shimokawa
c37cacf43d Remove id and index from GBDeviceApp in favor of UUIDs 2015-05-18 20:56:19 +02:00
cpfeiffer
d2bcccaeef Use logback-android for logging to external storage
(no WRITE_EXTERNAL_STORAGE permission necessary!)
2015-05-13 23:15:20 +02:00
cpfeiffer
3e79269d43 #46 add missing GBApplication 2015-05-01 09:36:33 +02:00