Commit Graph

1794 Commits

Author SHA1 Message Date
Andreas Shimokawa ed38e524bf Make some static stuff non-static (potentially fixes instant run problem and leaks) 2016-12-07 23:13:51 +01:00
Daniele Gobbetti 6a09023c24 Liveview: add some sanity checks to the incoming data lenghts 2016-12-07 13:09:15 +01:00
Daniele Gobbetti 4eb56eb9ca Liveview: refactor the BT stream reading functionality
Read the expected number of bytes at each step instead of a single byte.
2016-12-05 17:45:03 +01:00
Daniele Gobbetti e53b8b6b32 Liveview: ignore the SocketTimeoutException, disconnect in any other case 2016-12-04 21:04:30 +01:00
Daniele Gobbetti 219cc7bff1 Merge branch 'master' into liveview 2016-12-04 20:42:29 +01:00
cpfeiffer 928bdd5d36 Adjust comments to current values
They look plausible compared to 1S activity
2016-12-04 20:25:20 +01:00
Daniele Gobbetti 8c01123a48 Liveview: addressed the first feedback.
- centralized string encoding and byte order
- replaced printStrackTrace with LOG.error
2016-12-04 19:10:58 +01:00
Andreas Shimokawa 013029443b Pebble: Minor cleanups 2016-12-04 17:21:29 +01:00
Andreas Shimokawa a691cd0ff7 Pebble: add option to enable applogs (debug messags from pebble apps) 2016-12-04 16:55:27 +01:00
Daniele Gobbetti e0a844b60a Liveview: Initial support for Liveview devices
Working so far: stable connection, setting time and sending notifications.
2016-12-03 16:20:02 +01:00
Andreas Shimokawa 3db009e77d Pebble: do not dump all LE traffic, minor code cleanups 2016-12-02 23:38:54 +01:00
Andreas Shimokawa ae2c107ed1 Pebble 2/LE: only notify once when first PP packets are incoming 2016-12-02 08:50:02 +01:00
Andreas Shimokawa bc9041a4c9 Pebble 2/LE: on connect wait 30s max and stop waiting immediately if a real PP connection got establish (ie write request on the gatt server) 2016-12-02 08:07:44 +01:00
Andreas Shimokawa 3eda2d4b81 Pebble 2/LE: honor reconnect tries 2016-12-02 00:38:53 +01:00
cpfeiffer 44f74270df Mi2: Experimental support for activity recognition 2016-12-02 00:22:06 +01:00
cpfeiffer da297ecd8b Fix + cleanup time setting and calendar sending #441 2016-12-01 22:51:08 +01:00
Uwe Hermann 0746aaa579 app: Random typo and consistency fixes. 2016-12-01 20:22:12 +01:00
Uwe Hermann 6dd74d04ac code/docs: Consistently use the "Gadgetbridge" spelling.
"Gadgetbridge" appears to be the common spelling as per most docs,
code comments, wiki, and so on. Thus avoid using "GadgetBridge".
2016-12-01 17:28:51 +01:00
Andreas Shimokawa f0789cc147 Pebble 2/LE: fix another bug when reconnecting 2016-12-01 00:28:23 +01:00
Andreas Shimokawa 2993bb6b5c Pebble 2/LE: fix potential NPE 2016-12-01 00:20:21 +01:00
Andreas Shimokawa 74c20f3a82 Pebble 2/LE: More fun with reconnect 2016-11-30 23:56:58 +01:00
Andreas Shimokawa b878fa5eda Pebble LE/Pebble 2: Fix reconnect not working when first attempt fails 2016-11-30 22:28:34 +01:00
Andreas Shimokawa 95ec1fb44c Pebble LE/Pebble 2: Improve reconnect 2016-11-30 19:54:21 +01:00
cpfeiffer 09ff95eb34 Support for continuous hr readings (live activity) #323 2016-11-29 23:25:11 +01:00
cpfeiffer 49acde118d Do not log heartrate separately during miband 1s sync 2016-11-29 23:25:11 +01:00
cpfeiffer 011646b097 Fix activity data on Mi Band 1 #440 2016-11-29 22:22:54 +01:00
Andreas Shimokawa 2677dad873 Fix a recent regression that caused the database migration dialog to never pop up 2016-11-27 22:50:21 +01:00
Andreas Shimokawa 109a032f1e Pebble: fix Pebble LE address not being propery added to device attributes 2016-11-27 22:45:57 +01:00
Daniele Gobbetti 84327a5b86 Pebble: use also the device address as seed to store app configuration
This is not needed as long as one GB instance is used to manage a single pebble device, if multiple devices are managed the stored watchapp configuration could be messed up.
2016-11-27 11:31:03 +01:00
Andreas Shimokawa fa8df9f552 add missing migration script 2016-11-27 10:52:43 +01:00
Andreas Shimokawa 16b4bfd0e7 Pebble LE: also return to control center if successfully initialized 2016-11-27 10:38:16 +01:00
Andreas Shimokawa 723ad53588 Call getDevice always when connected
This fixes a longstanding bug where device attributes where ONLY updated when fetching activity data or when pairing a new device
2016-11-27 10:32:56 +01:00
Andreas Shimokawa 24752d3455 Pebble: try harder to get LE address into the database, does not work 2016-11-27 10:10:50 +01:00
Andreas Shimokawa 34ad088b88 Pebble: Experimental support for BLE on all models via dev option in Pebble Settings
HOWTO:
1) Pair you normal Pebble (not necessary if already done), make sure it was connected once
2) Unpair your LE pebble if already paired
3) Switch on "Always prefer BLE" in Pebble Settings
4) Tap on the + in Control Center to add a new device
5) Pair your Pebble-LE XXXX or Pebble Time LE XXXX inside Gadgetbridge's Device Discovery actibity

Now Gadgetbridge will connect to your LE Pebble when tapping on Pebble XXXX if "Always Prefer BLE" option is enabled.
You can easily switch back to classic LE by turning that option off again
2016-11-27 09:49:28 +01:00
cpfeiffer 2f7eb9ef23 Some more improvements to discovery
- pass service uuids to GBDeviceCandaidate so that DeviceCoordinators
  can detect devices by their services.

Note: they should not rely on service uuids being available
2016-11-27 02:46:07 +01:00
cpfeiffer b9ff2cd468 A few improvements to discovery
- display the right icon for found device candidates
- scan for specific LE services
2016-11-27 01:09:20 +01:00
Andreas Shimokawa 352fc1a030 fix wrong return value 2016-11-25 14:53:12 +01:00
Andreas Shimokawa a5263141d7 Pebble 2: Ignore all GATT communication with all other that the current device
Fixes a bad bug where disconnecting from another BLE device caused the Pebble2 to disconnect
2016-11-25 14:28:04 +01:00
cpfeiffer 2d4645f6cc Fix only the first day label being displayed in Week Steps charts 2016-11-24 23:35:10 +01:00
Andreas Shimokawa 84caf22479 fix weekly charts to start y axis at 0 2016-11-24 22:27:44 +01:00
cpfeiffer 7da328d5db Fix an invalid leftover check for array length
Also removed a method invocation that did not belong there.
2016-11-24 22:16:04 +01:00
Andreas Shimokawa 9d083e2330 Pebble: add Kickstart Watchface to app manager on FW 4.X
I know it only exist on 4.3+, but I am lazy
2016-11-24 22:10:32 +01:00
cpfeiffer 3fdfb7d172 Mi2: Support for setting the fitness goal (steps) 2016-11-24 21:58:32 +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
cpfeiffer 60cb67c3c8 Some cleanup 2016-11-24 21:15:27 +01:00
cpfeiffer cc0fbff297 Set the sample provider in getLatestActivitySample() 2016-11-24 21:15:27 +01:00
Andreas Shimokawa 381323011e Pebble 2: work around FW installation problems
Wait a 0.5s after each complete Pebble packet and do not longer wait at all after a completed GATT package chunk (was 0.1s)
Big outgoing messages will be now much faster such as firmware installations but smaller take more time than before.

(This is not the proper fix but I could update the firmware this way, failed 10 times before after a few percent)
2016-11-24 18:52:58 +01:00
cpfeiffer 67d89ce1b9 Create the correct start-sync timestamp #323 2016-11-22 22:52:26 +01:00
cpfeiffer dfbaba4cb6 Make sure that the charts display the requested time range
(instead of only the range with available samples)
2016-11-22 15:53:58 +01:00
cpfeiffer a8a7d8db31 Mi2: WIP synchronize only new data since last sync
(#323)
2016-11-22 00:05:41 +01:00
cpfeiffer 0c51f86afc Mi2: more work on activity data #323 2016-11-22 00:05:41 +01:00
cpfeiffer 82cd06f4c1 Mi2: WIP: initial support for activity data
(#323)
2016-11-22 00:05:41 +01:00
Andreas Shimokawa eb052cead3 Pebble 2: Also honor the mtu when client gets a change reported
Should help older LE Pebbles
2016-11-21 17:29:16 +01:00
Andreas Shimokawa 647b67cfca Pebble 2: call both requestMTU and use the characteristic write 2016-11-21 15:17:03 +01:00
Andreas Shimokawa fce86482b9 Pebble 2: try an alternative way of setting the MTU (might revert) 2016-11-21 14:54:01 +01:00
Andreas Shimokawa e8da301da3 Pebble 2: fix a few crashes with disconnect/ reconnect 2016-11-20 22:04:49 +01:00
Andreas Shimokawa 4f3c46f704 Pebble 2: only add second service if first one was added sucessfully 2016-11-20 00:12:41 +01:00
Andreas Shimokawa 3b250a4568 Pebble 2: initial hacky reconnect support
Works sometimes, at least less crashes
(#432)
2016-11-19 23:53:07 +01:00
Andreas Shimokawa 029cc02a29 Pebble: Add Pebble specific pairing activity mainly useful for Pebble 2 since it properly pairs the Pebble after connecting with BLE
Fixes #433
2016-11-19 22:13:00 +01:00
Andreas Shimokawa ddfab1cdae Pebble 2: use requestMTU() on Android 5+ instead of characteristics write.
This actually fixes MTU problems with older Pebbles (Time, OG)
2016-11-18 23:47:48 +01:00
Andreas Shimokawa 4dc085de57 Pebble 2: React to MTU notifications, fixes LE for older pebbles also
It seems that setting the MTU on older pebbles does not work, so just use what we can use.
Maybe old pebbles need setMTU() which only works on Android 5+, we could use that conditionally...
2016-11-18 23:47:48 +01:00
cpfeiffer 51fa31aa66 Fix BLE type conversions problems 2016-11-18 23:36:22 +01:00
Andreas Shimokawa 66e3de9168 Pebble 2: improve connection problems (at least for me) 2016-11-18 22:38:39 +01:00
cpfeiffer 96a16245df Update to MPAndroidChart 3.0.1 2016-11-18 21:31:55 +01:00
Andreas Shimokawa d41848014b fix database schema migration from 13 to 14 2016-11-16 11:37:36 +01:00
Andreas Shimokawa 485cda52a8 Pebble 2: actually report HRM feature to Charts Activity 2016-11-15 23:41:35 +01:00
Andreas Shimokawa d7256d172e I hate java 2016-11-15 23:23:21 +01:00
Andreas Shimokawa 163a7bdf15 Pebble 2: save heart rate values to database (hopefully) 2016-11-15 23:21:13 +01:00
Andreas Shimokawa 82a47022fa Pebble 2: allow to disable/enable HRM in context menu of Workout app
Okay this might be stupid  since Workout seems to work also works without HRM!
I assumed (wrongly) that I will disable Workout by disabling HRM

anyway, better than not being able to toggle it at all!
2016-11-15 12:17:51 +01:00
Andreas Shimokawa 4b7f47ba6c Pebble 2: add Workout system app to app manager on P2 and hexdump incoming HRM datalog 2016-11-15 11:56:14 +01:00
Daniele Gobbetti 1a22752b98 Pebble: enable localStorage
LocalStorage native functions are overridden to keep each watchface's settings separated. It's possible the bind method do not work on older versions of android.
2016-11-14 17:51:33 +01:00
cpfeiffer d8145a52f9 Activate the display when lifting the wrist #323
Configurable, defaults to true
2016-11-13 21:47:54 +01:00
Andreas Shimokawa 00a71f53b3 Pebble 2: add not yet working code (at least not without weird workarounds)
This is is a pain because of tons of weird pairing issues
2016-11-13 21:29:58 +01:00
cpfeiffer d89899557c Mi2: Add config option to configure date/time display
(added a new EventHandler method to set a specific configuration option)
2016-11-13 20:47:24 +01:00
cpfeiffer ddaf51768d Improved logging 2016-11-13 20:24:25 +01:00
cpfeiffer 3cc8d887ca Mi2: Initial support for wear location, hr during sleep and date format #323
- wear location from prefs is sent to the band
- hr measurement during sleep is sent to the band
- date format is sent to the band (date+time or just time)
  (TODO: needs preference option)
2016-11-13 01:44:52 +01:00
Andreas Shimokawa f68bbe453b Pebble: bump flags and version we report
Plus some small preparations for P2 support which do not hurt in master
2016-11-10 11:05:32 +01:00
Andreas Shimokawa eb7646d26a Pebble: Fix vanished Health system apps (for affected users)
This code also allows us to add new system apps which will then appended to the current list of previous Gadgetbridge users.
2016-11-09 19:20:37 +01:00
Andreas Shimokawa 837dfd5917 Pebble: fix Pebble Health vanishing when deactivating 2016-11-09 12:06:13 +01:00
cpfeiffer 3b474bb5a9 Move another notify registration to after initialization #408 2016-11-08 22:55:31 +01:00
Daniele Gobbetti 16c4f1a5ca Pebble: add toggle to use last known location for sunrise and sunset
This adds the feature discussed in #415, the used location is the last recorded by the network location provider, if it's not available then the stored location is used.
2016-11-06 15:42:52 +01:00
cpfeiffer 55f036c104 Move heart rate notification enamblement to after authentication
Might fix #408 and #425
2016-11-04 22:11:07 +01:00
Andreas Shimokawa 14ef5202e1 some internal testing which does not hurt in master 2016-11-03 11:07:44 +01:00
cpfeiffer 0076bbf572 Remove all Mi2 DeviceInfo stuff -- they're not used together #365
This might fix firmware downgrading on certain Mi1A devices
with hw revision 8
2016-10-30 23:04:21 +01:00
Daniele Gobbetti 879e47760b Stop discovery also if the user swipes the snackbar away. 2016-10-30 15:21:06 +01:00
Daniele Gobbetti 8c769b15c3 Use snackbar instead of progress dialog to find device. 2016-10-30 15:15:34 +01:00
Daniele Gobbetti a45f76d3bf Prevent disconnection if device is not connected. 2016-10-30 14:42:08 +01:00
Daniele Gobbetti d087e2142d Merge branch 'master' into new_GUI 2016-10-29 20:54:21 +02:00
Daniele Gobbetti b9bfb8c93a Use attr resources to enable theme dependent colors for the charts. 2016-10-29 20:29:35 +02:00
Daniele Gobbetti 8fdb233ef0 Bind connect and disconnect to the whole cards.
Use snackbars to give early feedback to the user (colors are wrong now, waiting for a change in master).
Removed hintTextView for good
2016-10-29 18:20:53 +02:00
Daniele Gobbetti a4b7b87b24 Merge branch 'master' into new_GUI 2016-10-29 16:40:33 +02:00
Andreas Shimokawa f755d99023 Pebble: Add context menu option in app manager to search a watchapp in the pebble appstore 2016-10-29 11:41:08 +02:00
cpfeiffer cea5f5fa36 Remove duplicate case here as well 2016-10-29 00:01:56 +02:00
cpfeiffer 1cadb692fe Wild guess at trying to fix spontaneous reboots during discovery #412 2016-10-28 23:48:13 +02:00
cpfeiffer a941a6cd5f Make some strings translatable 2016-10-28 23:47:39 +02:00
cpfeiffer 3db9748136 Mi2: Attempt to support non-repetitive alarms #323 2016-10-28 23:18:10 +02:00
cpfeiffer e5ade5c0ef Add Alamr.isRepetitive() convenience method 2016-10-28 22:40:34 +02:00
cpfeiffer 1352403089 Mi2: Allow for disabling alarms #323 2016-10-28 22:26:07 +02:00
Andreas Shimokawa 300d0466af Merge pull request #422 from roidelapluie/fcb
Mark 3rd party facebook apps notifications as Facebook
2016-10-28 10:45:40 +02:00
Andreas Shimokawa 55daaf247c Merge pull request #420 from atkyritsis/master
Removed duplicate if statement.
2016-10-28 10:45:09 +02:00
Julien Pivotto 67937dd6ee Mark 3rd party facebook apps notifications as Facebook
- Toffeed: https://f-droid.org/repository/browse/?fdid=me.jakelane.wrapperforfacebook
- Slimsocial: https://f-droid.org/repository/browse/?fdid=it.rignanese.leo.slimfacebook
- MaterialFBook: https://f-droid.org/repository/browse/?fdid=me.zeeroooo.materialfb

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2016-10-28 07:23:54 +02:00
Andreas Shimokawa 8603c3ffa0 Merge branch 'master' into new_GUI 2016-10-28 00:53:03 +02:00
Andreas Shimokawa d6b9e6d64b Pebble: Support sending byte arrays from app configuration data
Also add debug output if trying to encode unknown classes in PebbleProtocol

(Fixes #421)
2016-10-28 00:32:45 +02:00
Andreas Shimokawa bdf403210e Pebble: Fix configuration of certain pebble apps
for appkeys with index 0 it was assumed they were not found becaus JSONObject.getOpt() returns 0 if not found.
Use the getOpt() method variant with a fallback parameter instead and set that to -1 fixes the problem.

(Also fixes a missing debug output)

Fixes #419
2016-10-28 00:03:50 +02:00
atkyritsis 45cf4e5396 Removed duplicate if statement. 2016-10-27 18:44:27 +02:00
Andreas Shimokawa 4edfc44d64 Merge branch 'master' into new_GUI 2016-10-26 00:08:05 +02:00
Andreas Shimokawa d3571d53b2 Mi Band: allow to remove mac address from preferences
(this allows to clear an extra mi band from the control center)

Evil hack...
2016-10-26 00:03:54 +02:00
Daniele Gobbetti ee1cf74a7b ControlCenterv2: hotfix for referenced textview hidden by previous commit 2016-10-25 18:03:45 +02:00
Daniele Gobbetti d467b37493 ControlCenterv2: further steps:
Close drawer before launching activities (feels sloow).
Implement device deletion (untested).
Add app-management icon, remove tap-connected-device-for-primary-activity, hidden (not removed) text hint.
Use level-list for device icon.
Use the new control center when tapping GB notifications.
Added icons to the legacy control center context menu, perhaps it can be embedded in the card?
2016-10-25 17:49:21 +02:00
Daniele Gobbetti d93a5be57a Merge branch 'master' into new_GUI 2016-10-25 17:43:00 +02:00
Daniele Gobbetti 1f77e3e84f Coordinator: add explicit methods to determine if the device supports app management and which class is responsible for it. 2016-10-25 17:39:11 +02:00
cpfeiffer d302a0a5c3 Merge branch 'master' into new_GUI 2016-10-24 20:03:24 +02:00
cpfeiffer a39e3a035c Move device deletion logic to DeviceCoordinator and subclasses 2016-10-24 20:02:44 +02:00
Daniele Gobbetti cde09d71bc Fixed KitKat crashes and changed to RelativeLayout. Using CCv2 as default launcher activity.
Added lost-device icon and action, added background to buttons.
Overflow reveal is now animated inside the card.
Bind connect and disconnect actions to device-icon (short press to connect/launch default activity; long press to disconnect).
2016-10-24 17:41:56 +02:00
cpfeiffer 84f36b528a Merge remote-tracking branch 'origin/master' into new_GUI 2016-10-24 11:32:39 +02:00
cpfeiffer de46555e37 Mi2: display heart rate result from Debug screen as a toast #323 2016-10-24 00:23:59 +02:00
cpfeiffer b20a9c9ccc Some initial hacky support for hr readings (Debug activity only)
My Mi2 stopped reporting hr values a while ago though, even on-device.
2016-10-23 23:53:48 +02:00
cpfeiffer 17b70a1b82 Support for more than one alarm #323
Smart alarms not supported yet.
2016-10-23 23:05:54 +02:00
cpfeiffer 3a12ffd42d Mi2: Fix for alarm enablement. Was too late, apparently. 2016-10-23 22:38:57 +02:00
Daniele Gobbetti c20747226f Add dark theme 2016-10-21 23:01:10 +02:00
Daniele Gobbetti 00938baf7d Further refinements:
- disconnect by long-pressing device icon (temporary)
- use level-list to show battery level + charging
- remove padding around cards list
- use style colors for action icons (supports dark theme)
- add secondary text to the themes, even though the color is the same
- replace the info icon with three vertical dots
2016-10-21 17:44:36 +02:00
Andreas Shimokawa 68f83d3f33 Merge branch 'master' into new_GUI 2016-10-21 13:21:32 +02:00
Daniele Gobbetti 503bcee7b4 Support record version 13 (firmware 4.2) 2016-10-21 13:07:07 +02:00
Daniele Gobbetti 371f0ecdd0 Use a new GUI for the controlcenter.
The existing logic was mostly ported to the new activity, with the exception of device deletion (and all TODOs).
2016-10-21 13:01:30 +02:00
cpfeiffer ee24443b6a Make it really clear, that only the first alarm works #323 2016-10-21 01:01:30 +02:00
cpfeiffer 15954d4561 Initial support for alarms (one, atm) #323
(repetitinos not tested yet)
2016-10-21 00:50:41 +02:00
cpfeiffer 839da4f06a Shuffle some logging things around 2016-10-21 00:50:41 +02:00
cpfeiffer c87d08bf4b Small refactoring for initial support for Mi2 Alarms #323 2016-10-21 00:50:41 +02:00
Andreas Shimokawa cc2b22cfc7 prefer BIG_TEXT extra from notification only for email
(Some messengers accumulate messages in BIG_TEXT)
2016-10-19 18:38:26 +02:00
Andreas Shimokawa 336ffd5bf7 Extract EXTRA_BIG_TEXT instead of EXTRA_TEXT if available.
This makes K9 Mail usable with only using generic notifcations on Android >=5
(It shows the message preview now)
2016-10-18 23:44:00 +02:00
cpfeiffer 4122e0c20c Add button "Test New Functionality" 2016-10-11 23:35:58 +02:00
Daniele Gobbetti 21fc5c7498 Integrate Daniele's live-sensor-data support 2016-10-11 23:13:40 +02:00
cpfeiffer 713989ef38 Add event "test new function" for the debug screen 2016-10-11 23:06:59 +02:00
cpfeiffer 344f6bcaa0 Use separate AppCompatPreferenceActivity from Android samples
(instead of mixing it with our code)
2016-10-11 22:07:56 +02:00
cpfeiffer 363b7cbf28 @Override 2016-10-11 21:47:45 +02:00
cpfeiffer 7c3dc741d2 Send vibration off-commands to Mi2 (#323)
Far from perfect, but a little better.
2016-10-11 21:38:17 +02:00
cpfeiffer a559140f67 Fix the previous fix ;-) 2016-10-11 21:35:45 +02:00
cpfeiffer 1fc44034f0 Also use getGenericType() for the "summary" types 2016-10-11 21:28:28 +02:00
cpfeiffer e7c0afa603 Cleanup onNotification() 2016-10-11 21:18:43 +02:00
cpfeiffer f1243f52c1 Deactivate some unsupported things for Mi2 2016-10-11 20:23:25 +02:00
Andreas Shimokawa c65a0a16de fix mi band try vibration buttons 2016-10-11 17:57:50 +02:00
Andreas Shimokawa a094f0cc76 Mi Band: for vibration settings, group navication types (email, sms, chat, social network, navigation) 2016-10-11 15:20:55 +02:00
Andreas Shimokawa cd195a5969 map more apps to notification types (icons and colors on the pebble) 2016-10-11 11:54:52 +02:00
cpfeiffer 92c629c351 Ranem NotificationType.UNDEFINED to UNKNOWN 2016-10-10 23:06:44 +02:00
cpfeiffer 62828e5158 Remove ORIGIN_ notification constants, clean up
- MI preferences now use NotificationType.getFixedName() for preference
  keys
2016-10-10 22:45:26 +02:00
cpfeiffer 5c8525c5d0 Don't rely on File.canWrite() for directories, closes #406 2016-10-10 21:01:41 +02:00
cpfeiffer f57fec25f8 Remove the coordinator instance #323
For now, always iterate over the available coordinators instead.
Should fix MiBandSupport occasionally being used in place of MiBand2Support.
2016-10-10 20:52:40 +02:00
cpfeiffer db034a246c Add 'Try' button to vibration profile preferences, closes #405 2016-10-09 00:10:53 +02:00
cpfeiffer 9e32e7d0d3 Remove some Mi2 testing code, only use Mild Alerts for Mi1 (fow now) 2016-10-08 22:43:41 +02:00
cpfeiffer c2ff05e849 Make timestamp to mpandroidchart float x-value explicit 2016-10-08 21:27:32 +02:00
cpfeiffer 125c0092cb Storage and improved way of realtime data (hr, steps so far) 2016-10-08 01:35:58 +02:00
cpfeiffer 5a2ddaaec0 Use x-values instead of x indices for the charts 2016-10-08 01:35:03 +02:00
cpfeiffer 558c9e4664 Fiix visal glitch in weeksteps chart (first and last bar only partly visible) 2016-10-07 21:46:00 +02:00
cpfeiffer 7479c3d420 Whitelist 4.16.4.22 #369 2016-10-05 23:17:02 +02:00
cpfeiffer 713e9426b9 Re-enable UUID_PAIR again, when keeping data on device is configured) #250
This should fix data sharing with Mi Fit
2016-10-05 23:01:35 +02:00
cpfeiffer e5d178b315 Fix crash with mpandroidchart 3.0pre (master) 2016-10-04 23:39:14 +02:00
cpfeiffer 75bca1b924 Update to latest master in mpac and fix labels for sleep chart as well 2016-10-04 00:09:56 +02:00
cpfeiffer f35f76a42b Fix extraneous space at the bottom of the week steps chart 2016-10-04 00:04:04 +02:00
cpfeiffer eccf9164f6 No need to have a separate xLabelsFormatter 2016-10-03 23:48:32 +02:00
cpfeiffer dee492bc4f Fixes regarding xlabels -- must set them at the correct point in time
(otherwise we get ArrayIndexOutOfBoundsException when the chart
refreshes and the wrong xLabels, potentially with fewer entries are used)
2016-10-03 23:36:04 +02:00
cpfeiffer 827c99f620 Fix weekday charts, closes #403 2016-10-03 22:42:25 +02:00
Daniele Gobbetti bbecfbeace Check if the bluetoothReceiver is still valid before unregistering it.
Do not set the scan tipe as BT classic if the discovery action has been set by BLE scans.
2016-10-03 22:31:33 +02:00
cpfeiffer dd590528dc Add back the x-labels 2016-10-03 21:53:06 +02:00
cpfeiffer f23ed5ce69 Mi2: declare to always support hr #323 2016-10-03 21:17:58 +02:00
Andreas Shimokawa ed343778ee cleanup Debug activity a bit, add Spinner and remove a lot of buttons 2016-10-03 20:51:28 +02:00
cpfeiffer 5bdc7933b3 Somewhat hacky support for Mi2 notification icons #323 2016-10-02 23:04:59 +02:00
cpfeiffer 2a0d97b39a Improved error handling, display errors when deleting device 2016-09-30 23:07:30 +02:00
cpfeiffer 09502f96c9 AlertDialog.show() is non-modal, so put code into callback. Also added unpairing. 2016-09-30 22:58:28 +02:00
cpfeiffer 2e7fb57172 Display device name to delete, and use different API to delete device 2016-09-30 22:58:28 +02:00
cpfeiffer b890242c4f Only refresh when deletion of device was confirmed 2016-09-30 22:58:28 +02:00
Andreas Shimokawa 5e63b7ce04 Vibratissimo: do not show database migration activity 2016-09-30 21:43:44 +02:00
cpfeiffer f44974c215 Use findDevice() instead of getDevice() when you want to delete it 2016-09-30 21:27:33 +02:00
cpfeiffer 1fd6b59bf8 Fix logic error 2016-09-30 20:19:06 +02:00
cpfeiffer 27c83604d3 Update DeviceManager after deleting a device 2016-09-30 20:17:20 +02:00
Andreas Shimokawa 56d8a49d5b only disconnect device when confirming delete dialog 2016-09-30 19:20:04 +02:00
Andreas Shimokawa 5c0618d43d show confirm dialog before actually delete device
Also delete device last (after associated data), so that we do not leak if something fails

(#401)
2016-09-30 19:04:44 +02:00
Daniele Gobbetti 42f622af85 Support record version 12 (firmware 4.1) 2016-09-30 17:28:46 +02:00
Andreas Shimokawa 30d686fa50 support deleting devices and associated data
(#401)

TODO:
- remove device from list after deleting (needs changes to DeviceManager)
- confirmation dialog!!!
2016-09-30 13:41:06 +02:00
cpfeiffer e3f15f7bd8 Sort devices lexicographically 2016-09-29 22:56:16 +02:00
cpfeiffer fbfc9ed97f Workaround for https://github.com/PhilJay/MPAndroidChart/issues/2317 2016-09-29 22:45:17 +02:00
cpfeiffer f58b1f33c6 Fix parameter order for mpandroidchart 3.0 2016-09-29 22:45:17 +02:00
cpfeiffer 1b5bc23981 Initial port to mpandroidchart 3.0
does not quite work yet
2016-09-29 22:45:17 +02:00
cpfeiffer 0a4eefcf11 Use device information from the database for GBDevices
fixes offline charts not displaying heartrate for Mi1S
2016-09-29 22:40:16 +02:00
cpfeiffer 8f36712342 WIP: A little more Alert Notification Profile
I think we should rather focus on a code generator, though.
2016-09-29 20:32:15 +02:00
Daniele Gobbetti fabc52fdad Don't forward group summary notifications to the wearable, they are meant for the android device only
Possibly also related to #395
2016-09-27 17:33:10 +02:00
cpfeiffer dbdd7366ed Reenable the lollipop LE scanner, but after the plain BT scanner 2016-09-26 22:30:15 +02:00
cpfeiffer c2f8037f07 WIP: Alert Notification Profile 2016-09-26 22:21:59 +02:00
Andreas Shimokawa cb232638d4 disable new btle scanning, it does not work for me :( 2016-09-26 22:07:46 +02:00
Andreas Shimokawa 9cccb085c4 Pebble: allow sending acks to pebblekit android apps which always use transaction id -1 (this seems to be okay for pebblekit apps which do not want to use real transaction ids) 2016-09-26 21:51:11 +02:00
Andreas Shimokawa 55a1248e8f compile fix 2016-09-26 21:43:10 +02:00
cpfeiffer d4b134a490 WIP regarding heart rate profile 2016-09-26 11:44:57 +02:00
cpfeiffer 0341c7f61f fix e.printStackTrace() by logging instead 2016-09-26 11:44:08 +02:00
JohnnySun 3259efbd10 When discovery gadget use Lollipop+ device, use new BTLE API instead of old general BT discovery.
(cherry picked from commit 53e3fde7c06cbcb7665726eeb80544730196f928)
2016-09-26 11:43:28 +02:00
Andreas Shimokawa fd03dac5cd Pebble: try to work around duplicate Telegram messages
(#395)
2016-09-22 09:31:14 +02:00
Andreas Shimokawa 8080734470 Pebble: use telegram icon for telegram messages
also use the facebook icon for the official facebook app
(untested because we would never use facebook)
2016-09-21 21:31:23 +02:00
Andreas Shimokawa c8fb7c5d10 Add icon for Vibratissimo 2016-09-21 19:16:07 +02:00
cpfeiffer 1bd919ccaa For a start, we can reuse the alert notification from Mi 1 #323
So vibration works :-)
2016-09-20 23:41:50 +02:00
cpfeiffer ccdb843b6e Improved Mi Band 2 support #323
- connecting works and is stable
- firmware and hardware version is displayed
- time is set
2016-09-20 23:12:17 +02:00
Andreas Shimokawa 696611d392 Do not show "your activity" if activity tracking is not supported 2016-09-20 22:02:40 +02:00
Andreas Shimokawa 1f8cfa5a68 Vibratissimo: clear queue when setting vibration 2016-09-20 21:49:27 +02:00
Andreas Shimokawa 6a18d90fee Vibratissimo: add simple and buggy activity with a slider for vibration control
Also includes some fixes and "find your device" support ;)
2016-09-20 20:28:52 +02:00
Andreas Shimokawa da01a76594 fix BatteryInfoProfile NPE, show battery level for Vibratissimo 2016-09-19 16:37:45 +02:00
Andreas Shimokawa b2669d6fd7 Match manufacturer string with what we get from BLE device info 2016-09-19 15:00:24 +02:00
Andreas Shimokawa 8ba7bc7353 Add (useless) support for Vibratissimo "massage devices"
Don't take this serious. It will make the "massage device" vibrate when a phone call arrives.
It is inspired by the famous lawsuit[1] which has nothing to do with the Vibratissimo device maker.
After reading this I picked up the cheapest ble massage device just to see if we could support it.
And yes, we can.

[1] http://arstechnica.com/wp-content/uploads/2016/09/vibratorsuit.pdf
2016-09-19 12:37:41 +02:00
JohnnySun 53d4681763 Optimize Imports 2016-09-13 23:53:35 +08:00
JohnnySun 19fbe5719c When miband2 auth success, let application show miband status is connected 2016-09-13 23:50:35 +08:00
JohnnySun 08f2b0eb7c fix somebug and rewirte the auth process 2016-09-13 18:15:03 +08:00
JohnnySun 90d730bdc8 Added miband2 connection support 2016-09-13 01:28:50 +08:00
cpfeiffer e555066ffc Fix firmware2 not being set 2016-09-11 21:15:36 +02:00
Andreas Shimokawa 56c7b6b1cb fix sleep goal and step goal not being set in database (should fix user attribute table spamming) 2016-09-11 12:35:26 +02:00
Andreas Shimokawa 0cc95bd297 more debug 2016-09-11 12:23:36 +02:00
Andreas Shimokawa d0f8e308a4 also invalidate fw2 when invalidating fw 2016-09-11 12:23:14 +02:00
Andreas Shimokawa ec1f539267 revert accidentially commited stuff 2016-09-11 00:38:26 +02:00
Andreas Shimokawa 053b9553bc correct changelog (pebble health is also affected by userid and deviceid swapping) 2016-09-11 00:36:04 +02:00
Andreas Shimokawa 9c2e40ecc0 Pebble: fix mixup of userId and deviceId in contructor for Misfit and Morpheuz samples 2016-09-11 00:12:37 +02:00
Andreas Shimokawa e1927733ba remove special handling for conversations (latest release removed pebble messages) 2016-09-10 23:53:24 +02:00
cpfeiffer c31049839a Make DeviceCommunicationServiceTestCase runnable with robolectric
- enables the test for travis
- tests operation when not connected
- tests connecting
- tests operation when connected
2016-09-10 11:12:51 +02:00
cpfeiffer ec0a0db4f6 Make strings translatable in the database management activity 2016-09-06 22:59:08 +02:00
cpfeiffer d011c437a2 This hopefully fixes the recreation of the old activity db
(I cannot reproduce or test it)
2016-09-06 21:54:03 +02:00
cpfeiffer f2b344349f Make some primary and foreign keys not-nullable 2016-09-06 00:00:48 +02:00
cpfeiffer afef50dfab Hide the "merge old activity database" elements when there is no old db 2016-09-05 23:55:00 +02:00
cpfeiffer 411a90326e Fix method name 2016-09-04 22:39:35 +02:00
Daniele Gobbetti 5cbedc782d Pebble health: accept records of firmware 4.0 (nothing changed among the data we parse) 2016-09-04 15:59:19 +02:00
cpfeiffer 8e154ca67d slightly more testing of Device/Attributes 2016-09-03 21:16:45 +02:00
Andreas Shimokawa 5a49f1215e Display known devices from db even if Bluetooth is off or unsupported
This allows to view activity data without turning bt on or connecting to the pebble emulator via tcp/ip (needs modified manifest for internet access)
2016-09-02 10:54:32 +02:00
cpfeiffer 6f02f9e350 Unit-Test and fix *Attributes sort order
When adding e.g. new DeviceAttributes, we cannot simply add them to the
attributes list, because that list is supposed to be ordered. We could
insert it at the beginning, but that would be brittle to changes in the
GBDaoGenerator, so we simply re-fetch them from the db after adding
new attributes.
2016-09-02 00:34:30 +02: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
Daniele Gobbetti 6a2043eeb7 Create DB management activity by taking the existing functionalities from the debug activity. 2016-08-31 15:12:26 +02:00
Daniele Gobbetti 84e644fa1a Add preference for save raw pebble health data. 2016-08-31 14:05:02 +02:00
cpfeiffer cd535a0a45 Include known devices from the database in CC
(as long as device-support is still available)
Fixes non-paired devices not being displayed
2016-08-31 00:33:54 +02:00
cpfeiffer 6340bcff15 Small cleanup 2016-08-31 00:03:20 +02:00
Andreas Shimokawa 93b165ee96 onboarding: use the text area not the button itself for displaying the info text ;) 2016-08-29 00:32:36 +02:00
cpfeiffer bcb07ccacd Enable LoggingTest with robolectric 2016-08-29 00:26:29 +02:00
Andreas Shimokawa 07ee860b1c add information to onboarding activity, make strings translatable 2016-08-29 00:17:40 +02:00
Andreas Shimokawa c55369747d launch onboarding (database migration) activity from service when:
- device got initialized
- is not yet in the new device db
- an old database exists
2016-08-28 23:49:05 +02:00
cpfeiffer eb7771c1a9 Support for overlapping ActivityDescriptions + testcases 2016-08-28 00:22:34 +02:00
cpfeiffer 39c7762416 Update the device in case it has changed 2016-08-27 23:25:37 +02:00
cpfeiffer 1a22259b4e Good practice: use the DAO to insert/update instead of the session
(saves a few cycles to look up the correct DAO from the session)
2016-08-27 23:12:48 +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
cpfeiffer ae2df2580c Remove/document deprecated stuff 2016-08-27 22:45:27 +02:00
cpfeiffer e139840fee More appropriate user handling: update the user instead of creating new 2016-08-27 22:34:30 +02:00
cpfeiffer bfaaed7e5c Detcach samples from the session after querying, to save memory 2016-08-27 21:40:46 +02:00
cpfeiffer 083d752011 Even more documentation/specification 2016-08-27 20:14:42 +02:00
cpfeiffer ec9e999be1 Lots of documentation 2016-08-27 16:44:47 +02:00
cpfeiffer ec0db033b1 Avoid potential NPE when subclasses return null for rawKindSampleProperty 2016-08-27 15:36:42 +02:00
cpfeiffer 350e72d534 Initial support for user-configured activity descriptions
- for a given user and time span, there may be an ActivityDescription
  - with a textual description
  - and a list of tags
- every tag has
  - a name
  - and an optional description
2016-08-27 00:25:45 +02:00
Andreas Shimokawa 5ab40918c0 rename database from test-db5 to Gadgetbridge 2016-08-26 23:48:54 +02:00
Andreas Shimokawa 34aead6c63 remove obsolte stuff 2016-08-26 23:37:17 +02:00
cpfeiffer 69f73467ea Store not only device type, but also the model in the db 2016-08-26 21:16:01 +02:00
cpfeiffer c59553c9c9 Rename GBDevice#hardwareVersion to model
(e.g. while DeviceType is "PEBBLE" in general, the model
might specify a Pebble Time or Time Steel.
2016-08-26 20:57:59 +02:00
Andreas Shimokawa 4363f110fb finish onboarding activity after import 2016-08-25 01:27:09 +02:00
Andreas Shimokawa 063d00cc51 only launch onboarding after device is initialized and write device to database if not in yet. 2016-08-25 01:08:43 +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
cpfeiffer 38c4be4379 Remove isEqual() in favor of Objects.equals() 2016-08-24 23:14:25 +02:00
cpfeiffer bfc0b4faaf Add robolectric dependency and addd a first EntitiesTest
Use KitKat (19) as target sdk since robolectric 3.1.2/sqlite4java
does not understand "WITHOUT ROWID" tables.

Also, add constants for user's gender and document some things.
2016-08-24 22:56:42 +02:00
cpfeiffer 02ac70e2a7 Only dismiss the dialog is the activity is still alive 2016-08-24 22:56:42 +02:00
Andreas Shimokawa ec4469a87b Testing with dummy onboarding activity
crashes
2016-08-24 20:15:26 +02:00
Daniele Gobbetti 2a2ad20aa3 Store raw data in the DB for later interpretation. 2016-08-21 20:24:02 +02:00
Daniele Gobbetti b617ba7264 Fix the logic regarding the last sample of a run. Remove the unneded try-catch block and reuse the current DB session instead. 2016-08-21 17:38:07 +02:00
Andreas Shimokawa 0ae9955a6f Display Toast when trying to import old Misfit data (unsupported)
... and update TODO
2016-08-20 21:38:39 +02:00
Daniele Gobbetti 6119f3501a Import the old samples and map the ranges to overlays for pebble. 2016-08-19 21:09:32 +02:00
Andreas Shimokawa 3fb558c536 db refactoring: add raw data column in health overlay table and make rawType part of the composite key 2016-08-18 22:06:26 +02:00
Daniele Gobbetti 0126b90f20 Store the timestamps as sent by the pebble. Use a strict inequality operator at the end of the period to exclude the last sample. 2016-08-18 21:44:06 +02:00
cpfeiffer 7a16834482 *return* the created device! 2016-08-18 21:29:26 +02:00
cpfeiffer deeaa87df7 Batch the import of old activity samples to save memory during import 2016-08-18 20:51:15 +02:00
Andreas Shimokawa ce8af615d1 Merge branch 'composite-key-dao' 2016-08-18 20:35:56 +02:00
cpfeiffer 6e98defe94 Only import old activity data once per device, not for every provider 2016-08-18 20:29:20 +02:00
cpfeiffer fbf06c1fe3 Separate coordinator and support instances for Mi1 and Mi2 #323
+ Some more testing stuff for Mi2
2016-08-17 00:53:16 +02:00
cpfeiffer 26d490ffd6 Store the DeviceType in the Device entity
(so that we can later recreate a GBDevice from a Device)
2016-08-17 00:34:19 +02:00
cpfeiffer 9b7e8e06d6 Improved time conversion (0x2A0F)
- support for org.bluetooth.characteristic.local_time_information
- support for day of week in 0x2A2B

Unfortunately Mi Band 2 does not support 0x2A0F ;(
2016-08-15 00:40:35 +02:00
cpfeiffer 6843b5aa8f Add icon for Mi Band 2 2016-08-15 00:39:31 +02:00
cpfeiffer 8766fc5269 Handle MiBand2 device type 2016-08-14 23:25:35 +02:00
cpfeiffer a38bea892a Some logging of found devices/uuids 2016-08-14 23:21:09 +02:00
Andreas Shimokawa 4ddbbfdfb0 change db name to test-db5 2016-08-14 22:36:50 +02:00
Andreas Shimokawa 69933c5e92 db refactoring: depend on latest -fyg patched greendao, change column order again (primary keys first), remove index from pebble health overlay also 2016-08-14 22:33:41 +02:00
Andreas Shimokawa eb962c65f0 work towards composite keys
(builds but does not run because greendao generates wrong table creation code - we need to fix that)
2016-08-13 01:24:43 +02:00
cpfeiffer 7c060506cf Invalidate UserAttributes and DeviceAttributes when new ones are created 2016-08-13 00:52:35 +02:00
cpfeiffer b3984a409c Fix checking for up-to-date User and Device attributes 2016-08-13 00:27:38 +02:00
Andreas Shimokawa 68b303246d db refactoring: change column order for health overlay table also 2016-08-10 23:26:25 +02:00
Andreas Shimokawa 359ed46b06 db refactoring: remove raw activity kind field from pebble health minute data, add a blob column for raw undecoded health minute data.
also:
- change column order for all pebble related minute data tables (mandatory stuff first, then custom columns, for easier addition of new columns)
- remove unused code

TODO:
- fix column order in Mi Band table also
2016-08-10 23:06:07 +02:00
Daniele Gobbetti 23c289ce1a Use the real raw values as received by the device.
Some types were also added, even though they are educated guesses.
2016-08-09 20:22:05 +02:00
Daniele Gobbetti 22d0387f76 Fix the comparison order again ,as it was correct originally.
Partial revert of 5cfddbb7e9
2016-08-09 20:05:42 +02:00
Daniele Gobbetti 4a7a34f461 Use only the overlay table for storing overlay data.
This removes the need to wait to have minute samples to store the overlay data, hence store has been made void instead of boolean.
2016-08-09 18:05:24 +02:00
Daniele Gobbetti 5cfddbb7e9 Use the right properties to build the query and fix the comparison operators.
Performance: iterate first on the smaller dataset.
2016-08-09 17:52:07 +02:00
Andreas Shimokawa fe5ec74ca1 Pebble Health: read overlay data in sample provider and patch in raw kind
completely untested
2016-08-09 11:56:05 +02:00
Andreas Shimokawa 5072d6b959 Pebble: try to write to health activity overlay table 2016-08-08 19:16:53 +02:00
Andreas Shimokawa af58b4600d whoops 2016-08-07 12:15:40 +02:00
Andreas Shimokawa c4f83d68cd refactoring: add generic support for manually filtering samples by acticty kind in AbstractSampleProvider
This allows a lot of simplifications for Morpheuz and Misfit
2016-08-07 11:45:09 +02:00
Andreas Shimokawa 6b2565e4c9 DB refactoring: remove activity type from Morpheuz database, determinate it in PebbleMorpheuzSampleProvider instead 2016-08-07 01:47:15 +02:00
Andreas Shimokawa e05d40dc7e Pebble: Support for latest version of Morpheuz (4.6)
Also a few simplifications and minor fixes.
Morpheuz 3.7 should still work (last version for FW 2.x)
2016-08-06 01:19:38 +02:00
cpfeiffer a7b9ae5596 whitelist fw 4.15.12.10 #369 2016-08-04 00:05:58 +02:00
Andreas Shimokawa 9520e23439 fix negative steps in Charts with Morpheuz 2016-08-02 00:31:29 +02:00
cpfeiffer 43d7566c0b some more microsteps #206 2016-08-01 22:18:57 +02:00
Andreas Shimokawa 4fe498efc2 Pebble: delay 100ms after writing a pebble packet to the output steam
This fixes a problem on newer firmwares, probably from 3.0 on, where sending an
appmessage packet right after acknowledging a previous incoming appmessage
packet results in our outgoing appmessage packet to be NACKed by the pebble
firmware and not even reaching the app running on the pebble.
2016-07-31 23:49:19 +02:00
Andreas Shimokawa 8ba1ae3f3e create extra table for Morpheuz, remove more unused stuff
Pebble activity tracker now do not share a common base anymore.

TODO: consider creating a custom way of querying activity types like in Misfit. The activity kind stored in the database now is solely based on the intensity, so it is redundant.

(#206)
2016-07-31 00:06:26 +02:00
Andreas Shimokawa eabe625c47 rename some classes, remove obsolete ones 2016-07-30 23:22:27 +02:00
cpfeiffer b43b7948b0 Let GallCallback return boolean values in order to mark an event as "consumed"
(to avoid dispatching the event to further listeners (ble profiles)
2016-07-28 23:04:37 +02:00
cpfeiffer c9a9566dad Minor fixlet 2016-07-28 22:42:16 +02:00
cpfeiffer 493444a2a0 Remove unused stuff 2016-07-28 22:28:29 +02:00
cpfeiffer b22111df9d Fix field ordering of ActivitySample (c'tor!) and improve importer #206 2016-07-28 22:12:20 +02:00
Andreas Shimokawa 8ea29e6e1d Refactor database / sample access (#206)
We now have separate tables for each provider's samples but a common interface.
2016-07-27 23:34:13 +02:00
Andreas Shimokawa dd5c80c2e7 forgot to add file 2016-07-25 22:28:40 +02:00
Andreas Shimokawa 726f767576 work towards a Pebble Misfit raw sample table 2016-07-25 22:19:39 +02:00
cpfeiffer f5ba09ebe0 Some babysteps towards miband2 support #323
Start to implement standard BLE profiles/services.
2016-07-25 00:00:22 +02:00
cpfeiffer df59ce7b96 Switch light sleep and deep sleep #250
Apparently REM is considered deep sleep and NREM is considered light
sleep even though NREM (non-rapid-eye-movement) phase 3 is actually
defined as deep sleep.
2016-07-19 20:43:28 +02:00
cpfeiffer 1997a9b7fa some more service discovery logging 2016-07-18 23:55:44 +02:00
cpfeiffer 7b26986ab0 Fix for #349
We must not use UUID_CHAR_PAIR anymore. This prevents connecting
without being bonded. Connecting when bonded still works.

As without bonding, ControlCenter would not display the device anymore,
we have to re-install the "remember last connected device" in the
preferences thing.
2016-07-15 00:13:49 +02:00
cpfeiffer ebda3e1535 uncomment some constants 2016-07-14 20:37:20 +02:00
cpfeiffer 367091587f No more 0x8 in the logs
It's the confirmation that setting the latency succeeded.
2016-07-14 20:15:54 +02:00
cpfeiffer aa00d2f93a Avoid NPEs when device-name is null 2016-07-12 00:24:23 +02:00
cpfeiffer 76895aa2b1 Register to device name and alias changes and update accordingly 2016-07-11 00:28:15 +02:00
cpfeiffer 80930ce42a More logging for pairing, destroy pairing activity when bonding failed #349 2016-07-10 00:11:28 +02:00
Andreas Shimokawa 340a0f4a66 Fix coordinators not recognitzing devices by name
Do not ask a device candidate for its name , ask the underlying BluetoothDevice
The candidate uses the device alias - not good for matching
2016-07-09 23:10:21 +02:00
cpfeiffer f54163faeb centralize quit() functionality in GBApplication 2016-07-08 22:35:52 +02:00
cpfeiffer 9215233344 Whitelist 4.16.3.7 Mi1S firmware 2016-07-08 22:17:19 +02:00
cpfeiffer 8154a887cb When there are cached services, skip service discovery 2016-07-08 22:15:36 +02:00
Andreas Shimokawa 4de45787c3 Properly acquire network location if last location is not known
A toast will be shown if the network location provider is disabled.
Location will be automatically acquired after enabling it.

Fixes #346
2016-07-05 23:56:14 +02:00
cpfeiffer 20d8732d10 In GBDevice.toString(), return the correct state instead of the simplified one 2016-07-05 23:36:21 +02:00
cpfeiffer 154b7d28bb Let discovery activity also display device aliases 2016-07-05 23:36:21 +02:00
Andreas Shimokawa 903890067d Settings: properly check the input type flag
Fixes a bug where latitude/longitude could be made empty
2016-07-05 23:14:48 +02:00
cpfeiffer 94cc1a883a Use GBActivity in Pairing Activity for theming 2016-07-05 22:13:11 +02:00
cpfeiffer 3bb1a228ec Fix crash during device discovery 2016-07-05 21:48:33 +02:00
Andreas Shimokawa 43f95aee9c fix NPE 2016-07-05 21:47:51 +02:00
cpfeiffer 9ae69eac55 Avoid NPEs when BluetoothDevice.getName() returns null 2016-07-05 21:03:30 +02:00
cpfeiffer 9881b6c281 Do not display paired devices in the discovery activity 2016-07-05 20:46:47 +02:00
cpfeiffer abeb642972 Don't remember paired Mi device in preferences
(this was just a very old workaround for an even older Mi firmware
that couldn't pair)
2016-07-05 20:27:23 +02:00
cpfeiffer 8549031c6f Only attempt to reconnect when we were previously initialized 2016-07-04 23:38:25 +02:00
cpfeiffer 91d1cea51f Avoid potential NPEs 2016-07-04 22:40:24 +02:00
Andreas Shimokawa 73b2fc357e Pebble: Add some Pebble Time 2 support - NOT WORKING
Not working because these are expected to use BLE.
The Emulator should work though.
2016-07-04 22:09:56 +02:00
Andreas Shimokawa a2c2e48719 fix NPE in settings when last known position is null
This is not a proper fix, we would have to request a location first.
I just had a last known position when testing before. :/

Issue #346
2016-07-03 21:29:02 +02:00
cpfeiffer 8b24e098ea Set sampleProvider to avoid NPEs 2016-07-01 00:22:54 +02:00
cpfeiffer f65afa64d9 log raw activity data from mi band, closes #341
Hopefully aids in deciphering activity kinds.
2016-06-28 23:23:29 +02:00
cpfeiffer f0da25c49b Fix activity fetching getting stuck when double tapping #333 2016-06-28 23:07:24 +02:00
cpfeiffer 7613b62dab Improved discovery mechanism #323
Does not rely solely on mac addresses anymore. Should help when
mac address randomization is used.
2016-06-28 00:35:50 +02:00
cpfeiffer 76a44ad3a4 more logging to detect problems with external dirs: #343 2016-06-27 22:01:52 +02:00
cpfeiffer 56615de1f0 log FileNotFoundException when checking if directory is writable or not: #343 2016-06-27 21:29:39 +02:00
cpfeiffer e70a2290c3 sampleproviders now return device specific data #206 2016-06-27 20:43:48 +02:00
Daniele Gobbetti 1430619c30 Implement watchapp configuration presets.
This is a quick & dirty solution that may be improved by storing multiple presets in the DB in the future.
2016-06-26 11:55:08 +02:00
cpfeiffer 2fa166e381 Fix potential NPE, setup environment earlier 2016-06-25 18:58:54 +02:00
Andreas Shimokawa b5cf2b20be Pebble: In App Manager, enable adding of "Send Text" system app on non-aplite platforms
The App is not functional with Gadgetbridge, but since it is visible on the watch when canned messages for call dismissal is enabled, we support sorting it.
2016-06-25 18:08:53 +02:00
Daniele Gobbetti 20e2846d00 Enable localization of appmanager tab strip 2016-06-25 11:27:56 +02:00
Daniele Gobbetti 0f0a7ea925 Add send sms system app (commented because it only appears on Time series Pebbles after setting up SMS call decline) 2016-06-25 11:19:01 +02:00
Andreas Shimokawa 181df7311a add missing file 2016-06-24 14:57:01 +02:00
Andreas Shimokawa 659165fa4c Pebble: fix new app manager on 2.x
- properly intert apps reported from pebble into the corresponding tab
- disable tracking of installed apps
- disable drag and drop for apps and watchfaces
- ...
2016-06-24 13:39:29 +02:00
Andreas Shimokawa 1de6ee019f Pebble: fix regression. FW 2.x was completely broken
No one noticed, so it seems we can kill 2.x support soon :D
2016-06-24 12:07:44 +02:00
Andreas Shimokawa b77f3ad3bf Pebble: Implement call dismissal with canned messages
This also moved the canned replies setting to pebble settings
(we will change that if we have another device supporting this)
2016-06-24 10:25:08 +02:00
Andreas Shimokawa 67e5bc0434 Pebble: implement decline call with SMS
Based on a proposal by @danielegobbetti, thanks!

This still does not enable the feature since the necessary blobdb is not filled yet
2016-06-21 00:31:53 +02:00
Andreas Shimokawa 72dff2abd2 provide haptic feedback on long press in AppManager 2016-06-20 17:50:19 +02:00
Andreas Shimokawa 1a9c40e790 fix crash when rotating screen in AppManager 2016-06-20 17:42:32 +02:00
cpfeiffer 45fa930ac3 Properly check support for heartrate measurements 2016-06-19 23:22:28 +02:00
cpfeiffer 8772631087 Merge branch 'db-refactoring' 2016-06-19 22:53:09 +02:00
Andreas Shimokawa 4347f134d6 Pebble: add Music, Alarms, Notifications and Watchapps to System Apps
They can be ordered too!
2016-06-19 21:48:07 +02:00
cpfeiffer 9772d8af06 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-19 21:14:03 +02:00
Andreas Shimokawa 7597ce337d Pebble: do not move to last position if reinstalling an app, the order seems to be preserved on the pebble 2016-06-19 21:13:47 +02:00
Andreas Shimokawa 24e840e03b Pebble: remove "move to top" feature completely 2016-06-19 21:06:38 +02:00
Andreas Shimokawa 4b5969ef96 Merge branch 'master' into appmanager-fragments 2016-06-19 12:33:05 +02:00
Andreas Shimokawa f42899d910 Pebble: on FW 2.x do not send extended music info and do not send playstate
I don't think they are supported and I cannot test.
2016-06-19 12:17:19 +02:00
Andreas Shimokawa 64182941d0 Pebble: always hide move to top feature in AppManager, it was not working as expected
A proper solution is in appmanager-fragments branch
2016-06-19 11:48:29 +02:00
cpfeiffer 7aa900ce82 Workaround crash in debug activity
(when progress dialog is visible and changing orientation)
2016-06-19 00:53:53 +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 04c8a17d6e Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-19 00:12:02 +02:00
cpfeiffer 5607b1c892 Working merging of activity data, with (indeterminate) progress dialog 2016-06-19 00:10:47 +02:00
cpfeiffer dc932355b5 Some javadoc re DeviceManager 2016-06-18 23:40:37 +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
Daniele Gobbetti ad3f7e53b3 Try hard to hide the browser activity from the stack. 2016-06-18 21:08:51 +02:00
Daniele Gobbetti 7263307409 Merge remote-tracking branch 'origin/master' into appmanager-fragments 2016-06-18 19:00:23 +02:00
Daniele Gobbetti 966c3d4811 Various improvements to the configuration page:
- localstorage is now cleared at every launch: this prevents some clay configuration pages to send back to the watch a number of keys that were set by other configuration pages
- only execute JS on document ready: this prevents some race conditions
- added dummy getTimelineToken function to Pebble JS object
- corrected (hopefully!) a few logic errors in the JS code (this referenced where it wasn't)
- refactored the steps visualization in JS
- lifecycle changes to the java activity: now the configuration page gets closed as soon as the settings have been sent, and there is only one instance of it
2016-06-18 18:40:57 +02:00
Daniele Gobbetti fffeb87607 Use constant instead of hardcoded string 2016-06-18 18:33:35 +02:00
cpfeiffer 2890fd6737 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-18 01:27:19 +02:00
cpfeiffer 41e6833b2d Getting closer... db migration almost works. 2016-06-18 01:26:36 +02:00
Andreas Shimokawa e8f2a0bc9f Merge branch 'master' into appmanager-fragments 2016-06-17 22:47:17 +02:00
Andreas Shimokawa 79b439da28 Implement App Sorting
- grab icon to move apps
- cache can be sorted but nothing will be send to watch
- if sorting apps or watchfaces, order will be sent to watch
- we try to keep track of what is installed and what not

Firmware 2.x is currently not working properly
2016-06-17 22:43:06 +02:00
Daniele Gobbetti d5586478f3 Support legacy configuration pages #251
There are pages that do not honor return_to get parameter. This commit allows the user to enter the returned url manually.
2016-06-17 17:47:13 +02:00
cpfeiffer 13959677af More WIP for intrgrating old activity db into new one
(one demand to keep user in control)
2016-06-17 00:07:50 +02:00
cpfeiffer d544509b60 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-16 21:55:16 +02:00
cpfeiffer 687beee501 Migration work 2016-06-16 21:54:53 +02:00
Andreas Shimokawa 65ac4b364f Merge branch 'master' into appmanager-fragments 2016-06-16 01:09:35 +02:00
Andreas Shimokawa 9f61458790 Pebble: Allow installation of aplite apps on diorite 2016-06-16 00:59:15 +02:00
Andreas Shimokawa b79b94809a initial support for FW 4.0-dp1 2016-06-16 00:24:27 +02:00
Andreas Shimokawa 1c6c78507c Merge branch 'master' into appmanager-fragments 2016-06-15 22:53:41 +02:00
Andreas Shimokawa d225743d64 Pebble: some preparations for Pebble 2 2016-06-15 22:53:05 +02:00
Andreas Shimokawa 7937fd6ea7 Merge branch 'master' into appmanager-fragments 2016-06-15 22:36:06 +02:00
Andreas Shimokawa 7690ad3af6 make appmanager usable again 2016-06-15 22:29:30 +02:00
Daniele Gobbetti 4120d686b8 Some key events were not working with the default audio player. Reported in #322 2016-06-15 22:15:21 +02:00
Andreas Shimokawa b5693bcb45 play around with drag and drop list 2016-06-15 19:56:34 +02:00
cpfeiffer 71d99384c1 Cleanup, remove duplicated code, fix some TODOs 2016-06-14 23:10:35 +02:00
Andreas Shimokawa 4895704f99 add missing file 2016-06-14 22:55:38 +02:00
cpfeiffer a01507a924 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-14 20:14:04 +02:00
cpfeiffer 61957d6cb0 WIP: more db work 2016-06-14 20:13:08 +02:00
Andreas Shimokawa 3418543c31 play around with fragments 2016-06-14 20:04:54 +02:00
Andreas Shimokawa 1d6a697000 playing around with fragments 2016-06-14 15:56:38 +02:00
Andreas Shimokawa 98999993e5 Pebble: In AppManager allow moving apps on the device to the top (context menu) 2016-06-12 01:20:12 +02:00
Andreas Shimokawa f812fb1b1f Improvements to MusicPlayback receiver
- Also send duration if "duration" extra is present
- If "playing" and "postion" extras are present send a music state update

treat previous state and current state as equal if position delta is <=2 seconds
(Neccessary for some players which update every second - the pebble however counts by itself)
2016-06-11 23:37:03 +02:00
Andreas Shimokawa 2d080cabb2 fix NPE by using Objects.equals() 2016-06-11 22:32:38 +02:00
Andreas Shimokawa d1a62968f6 Do not send new audio metadata to device if nothing has changed
This prevents some players which send a metadata changed intent every second to drain the battery
2016-06-10 23:13:33 +02:00
Andreas Shimokawa 6de002c88b also try to get track number and number of tracks from notifications 2016-06-10 22:20:55 +02:00
Andreas Shimokawa 66b5a21cf2 also gather music info from notifications when screen is off 2016-06-10 00:03:48 +02:00
Andreas Shimokawa b0fe4b1519 also gather music info from notifications when screen is off 2016-06-09 23:39:00 +02:00
Andreas Shimokawa 9623449b6e Merge branch 'master' into feature-weather 2016-06-09 23:15:23 +02:00