Commit Graph

330 Commits (2c0b105aa62d43fc8698b895fd0af7fd76fa67ff)

Author SHA1 Message Date
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
cpfeiffer 3fdfb7d172 Mi2: Support for setting the fitness goal (steps) 2016-11-24 21:58:32 +01:00
cpfeiffer cc0fbff297 Set the sample provider in getLatestActivitySample() 2016-11-24 21:15:27 +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 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 485cda52a8 Pebble 2: actually report HRM feature to Charts Activity 2016-11-15 23:41:35 +01:00
cpfeiffer d8145a52f9 Activate the display when lifting the wrist #323
Configurable, defaults to true
2016-11-13 21:47:54 +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 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
cpfeiffer a941a6cd5f Make some strings translatable 2016-10-28 23:47:39 +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 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 a39e3a035c Move device deletion logic to DeviceCoordinator and subclasses 2016-10-24 20:02:44 +02:00
cpfeiffer 3a12ffd42d Mi2: Fix for alarm enablement. Was too late, apparently. 2016-10-23 22:38:57 +02:00
cpfeiffer c87d08bf4b Small refactoring for initial support for Mi2 Alarms #323 2016-10-21 00:50:41 +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 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 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 cd195a5969 map more apps to notification types (icons and colors on the pebble) 2016-10-11 11:54:52 +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 db034a246c Add 'Try' button to vibration profile preferences, closes #405 2016-10-09 00:10:53 +02:00
cpfeiffer 7479c3d420 Whitelist 4.16.4.22 #369 2016-10-05 23:17:02 +02:00
cpfeiffer 5bdc7933b3 Somewhat hacky support for Mi2 notification icons #323 2016-10-02 23:04:59 +02:00
cpfeiffer e3f15f7bd8 Sort devices lexicographically 2016-09-29 22:56:16 +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 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 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 90d730bdc8 Added miband2 connection support 2016-09-13 01:28:50 +08:00
cpfeiffer 411a90326e Fix method name 2016-09-04 22:39:35 +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 bfaaed7e5c Detcach samples from the session after querying, to save memory 2016-08-27 21:40:46 +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 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
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 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
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 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 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
cpfeiffer a7b9ae5596 whitelist fw 4.15.12.10 #369 2016-08-04 00:05:58 +02:00
cpfeiffer 43d7566c0b some more microsteps #206 2016-08-01 22:18:57 +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
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 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 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 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 9215233344 Whitelist 4.16.3.7 Mi1S firmware 2016-07-08 22:17:19 +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
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
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
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 e70a2290c3 sampleproviders now return device specific data #206 2016-06-27 20:43:48 +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
cpfeiffer 45fa930ac3 Properly check support for heartrate measurements 2016-06-19 23:22:28 +02:00
cpfeiffer 9772d8af06 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-19 21:14:03 +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 41e6833b2d Getting closer... db migration almost works. 2016-06-18 01:26:36 +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
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 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
cpfeiffer 71d99384c1 Cleanup, remove duplicated code, fix some TODOs 2016-06-14 23:10:35 +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 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
Steffen Liebergeld e386d6da43 Add onSetMusicState(MusicStateSpec stateSpec)
This commit contains the infrastructure needed for the
NotificationHandler to send music state information to the device. That
is, it introduces a call onSetMusicState(MusicStateSpec stateSpec), that
in turn sets up an intent to the service, which will then call the
encodeSetMusicState() function of the device. encodeSetMusicState is
available for pebble only. There are empty stubs for other devices.
2016-06-08 20:31:48 +02:00
cpfeiffer 3b87966fe9 Merge branch 'master' into db-refactoring 2016-06-06 22:16:40 +02:00
cpfeiffer ca26e27c60 Basic support for Mi Band 2 #323, untested 2016-06-05 22:31:07 +02:00
Szymon Tomasz Stefanek 60fc29cc4d Add support for shifting the device time by N hours to allow for sleep data gathering of shift workers 2016-06-03 04:43:12 +02:00
Andreas Shimokawa cb1ec5dccb Make calendar event type byte instead of int
Now the UUID will be constructed like this:

High 64bit 0x4742474200 | type
Low 64bit id
2016-05-24 13:11:57 +02:00
Andreas Shimokawa efe5e546fd Merge branch 'master' into feature-sunrise 2016-05-22 23:36:09 +02:00
Andreas Shimokawa ca714417ac Pebble: also copy pbw to cache on Firmware 2.x
Neccessary step towards watchface configuration on 2.x
2016-05-22 11:33:14 +02:00
cpfeiffer 4b374e3f7e Implement changeStoredSamplesType() 2016-05-16 23:45:21 +02:00
Andreas Shimokawa 4bd578ebea Pebble: send sunrise/sunset to watch for today and tomorrow, also delete previous timeline pins 2016-05-16 23:37:40 +02:00
cpfeiffer 876bdac918 More WIP: remove now unused code, better use of generics 2016-05-16 23:36:54 +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
Andreas Shimokawa 017f650b3f Pebble: send sunrine and sunset pins to timeline when setting time in debug menu
This is just a test and it will leak your timeline data, since we never delete it.
Also this adds some rough infrastructure for calendar events.
2016-05-16 17:30:11 +02:00
cpfeiffer 5963843216 Experimental support for #274 (untested yet) 2016-05-15 00:15:31 +02:00
cpfeiffer 8ca821ab8a More WIP on db refactoring 2016-05-13 23:47:47 +02:00
cpfeiffer d0c8483d92 More WIP 2016-05-08 23:49:15 +02:00
cpfeiffer 9532fc879f "Ported" to AbstractSampleProvider 2016-05-08 23:17:05 +02:00
cpfeiffer 21cafa83d8 WIP: some more query work 2016-05-08 22:58:50 +02:00
cpfeiffer cc5941f7eb Merge branch 'master' into db-refactoring 2016-05-05 10:19:19 +02:00
cpfeiffer 808e12d680 A little more WIP 2016-05-05 10:19:01 +02:00
Andreas Shimokawa 045d5119ff Do not update summary for checkbox preference
Was causing summary to get overwritten by "true" or "false" when changing preferences
2016-05-04 13:07:11 +02:00
Andreas Shimokawa 619a17425f Mi Band: Display hint about starting Activity Activity instead of App Manager
TODO: Fix the string, I have no idea how to properly name the Activity Activity
2016-05-04 12:31:29 +02:00
cpfeiffer e35ce978bd Remove now unused imports + fix one more SharedPreferences usage 2016-04-25 23:43:19 +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 faa6a9d906 use android:summary="%s" for ListPreferences 2016-04-14 16:44:44 +02:00
cpfeiffer f15a97d994 Initial live heartrate measurement in the live activity tab #178 2016-04-12 23:12:50 +02:00
Andreas Shimokawa a15b327ff1 Refactoring: get rid of ServiceCommand, use new CallSpec and MusicSpec to pass Call and Music info 2016-04-04 20:08:34 +02:00
cpfeiffer b129844169 Small fixes to PR 273 #232
- dynamically toggle hr sleep support when preference changes
- check hr support dynaically after device info is available to avoid false error message
2016-04-03 22:38:06 +02:00
Christian Fischer 20aa7d9ad9 add preference to set hartrate sleep detection 2016-04-02 16:09:30 +02:00
cpfeiffer 4631df67ac Some more logging + add svg launcher again (somehow it was not added again) 2016-03-30 22:53:08 +02:00
Andreas Shimokawa adfef3db42 Prepare code for more music metadata (duration, track count, current track number)
Oh and format code
2016-03-27 17:45:44 +02:00
cpfeiffer 9d9ef8a6f8 Some cleanup 2016-03-23 22:06:48 +01:00
Andreas Shimokawa df3a06ac9b Reformat code, make getter of @NonNull members also @NonNull 2016-03-22 21:55:15 +01:00
cpfeiffer b0ec74696d Give better feedback when a firmware cannot be installed #234 2016-03-22 16:12:27 +01:00
Andreas Shimokawa dbeded8d04 In Control Center, do not show alarm configuration in context menu if device does not support it 2016-03-20 17:53:55 +01:00
Andreas Shimokawa 4be1926459 reformat code though Android Studio 2016-03-20 15:00:05 +01:00
cpfeiffer 4f956000c5 Enhanced support for firmware detection, recognition and upgrade #234
Also supports double firmware upgrade for Mi1S.
- so far, only hr firmware upgrade is tested for 1S
- adds junit testcases for firmware recognition and handling
2016-03-20 01:07:57 +01:00
cpfeiffer c5a887192d Remove/revert some temporary test code 2016-03-16 00:27:32 +01:00
cpfeiffer 91f02ae920 WIP: Lots of work towards double firmware update for Mi 1S #234 2016-03-16 00:27:08 +01:00
Andreas Shimokawa a3ee3c15fc Pebble: copy pebble-app-js.js out of the pbw upon installation not upon reading the .pbw
This eliminates the need to copy the whole file into a byte[], and all file size limts are gone.
2016-03-08 11:41:20 +01:00
Andreas Shimokawa 88982a6174 Merge pull request #235 from Freeyourgadget/feature-configuration
Use external browser for configuring pebble apps
2016-03-08 10:41:46 +01:00
cpfeiffer 5eb8f57b4c Some more byte -> int conversions 2016-03-07 22:47:34 +01:00
Andreas Shimokawa f616e4f571 Pebble: skip .js file if too large instead of breaking installation
(Hotfix)
2016-03-03 17:46:58 +01:00
Andreas Shimokawa bd7b34985b reformat code and optimize imports 2016-03-03 15:47:00 +01:00
Andreas Shimokawa 2a7f9226a0 Pebble: send configuration to watch
TODO: handle booleans
2016-03-03 14:23:17 +01:00
Andreas Shimokawa 63d938559e pass GBDevice down to ExternalPebbleJSActivity to determine the platform version (aplite,basalt,chalk) 2016-03-03 11:52:30 +01:00
Daniele Gobbetti 089a59168e Initial support for using an external browser for configuring pebble apps. This allows existing configuration pages to work without having internet access ourselves.
This is a better approach as initially thought in #191.

What is missing is outlined in the (several) TODOs.
2016-03-02 21:07:27 +01:00
Andreas Shimokawa fc464d112d change some more short and byte to int regarding Morpheuz 2016-02-29 23:13:07 +01:00
cpfeiffer cbe73f71a1 Fix some typos (thanks!) #178 2016-02-29 22:08:34 +01: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
cpfeiffer ddde25e5df Initial firmware update support for Mi1S #234 2016-02-28 02:46:48 +01:00
Andreas Shimokawa c449181083 Pebble: store appKeys in .json also.
Rumour says someone needs it soon...
2016-02-27 11:40:37 +01:00
cpfeiffer de6f898fef Some more fixes regarding heart rate measurement #178 2016-02-27 11:18:16 +01:00
Kasha 9e636d66f6 Initial heart rate support by KashaMalaga #178
(removed unrelated Android M fixes and squashed commits)
2016-02-27 00:05:06 +01:00
Andreas Shimokawa 70ae5a2a3a Pebble: Allow to select the preferred activity tracker via settings activity (Health, Misfit, Morpheuz) 2016-02-18 20:41:22 +01:00
cpfeiffer c86365ee2e Some more Mi Band pairing improvements #180
- listen to notifications early -- the band then actually tells us that
  authentication is required
- check for this after sending user info
- add authentication states to GBDevice
- workaround for event problems in pairing activity (delivered although
  already unregistered)
- BtLEQueue now deals with gatt events coming *before* connectGatt()
  actually returned (namely the connection event)
2016-02-13 00:15:16 +01:00
Daniele Gobbetti 20c4e49fe1 Refactoring of the Pebble Health steps data receiver.
Added logic to deal with pebble health sleep data.
Added database helper to change the type of a range of samples (needed for sleep data).
Fixes to the Pebble Health sample provider.
2016-02-09 17:52:21 +01:00
danielegobbetti 2f8207abf9 Initial support for reading pebble health steps/activity data. 2016-02-07 09:27:51 +01:00