Commit Graph

172 Commits (18926e6bbdb7e4a65d939f3af192eb9bcc5f6588)

Author SHA1 Message Date
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
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
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
cpfeiffer 5eb8f57b4c Some more byte -> int conversions 2016-03-07 22:47: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
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
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 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
Daniele Gobbetti 94c8633bad Move the generic user info outside the miband preferences activity. They still have to be renamed. 2016-02-02 14:32:19 +01:00
cpfeiffer a6d3c50f94 Fix discovery of Mi Band 1S #196
closes #204
2016-01-06 23:38:17 +01:00
cpfeiffer 41dde9a9c2 Programmatically perform a bonding
(i.e. bluetooth-level pairing). Previously the pairing appeared to
happen automagically, but this doesn't work (anymore). So now we first
pair on the bluetooth-level, then application level.
2016-01-06 00:16:41 +01:00
Daniele Gobbetti 0dda5c214b Add preference for reserved alarm slots (for calendar event notification)
Just this, no logic to support the choice yet.
2015-12-17 16:11:35 +01:00
cpfeiffer f258e62633 Refactoring: centralize GBDevice creation
- created and provided by DeviceHelper
- passed from UI to service
- without UI, service uses DeviceHelper directly

=> Cleaner and less duplicated code
2015-12-13 00:43:07 +01:00
cpfeiffer 0d63e5b770 User Info is probably the same for MI 1A and 1S #178
Can you please test whether this fixes the connection problems?
2015-12-08 21:48:56 +01:00
cpfeiffer 134eeacaea Whitelisted 5.15.7.14 2015-12-07 01:22:27 +01:00
cpfeiffer 365ce61cb6 Support for firmware upgrade/downgrade on Mi 1A.
I hope I didn't break firmware upgrades on some Mi 1 models
other than mine (my hardware revision is 2).

Upgrades for Mi 1S are currently disabled, we need some brave
souls who can help us test this.

Closes #173
Also see: #169
2015-12-07 01:14:06 +01:00
cpfeiffer b056e1b2a0 tiny log addition 2015-12-07 01:13:47 +01:00
cpfeiffer bd0716ba58 Some more lint warnings fixed 2015-11-23 23:04:46 +01:00
cpfeiffer 81c2f657bd Some lint fixes 2015-11-23 22:46:12 +01:00
cpfeiffer 4200e77016 Disable activity data fetching when not supported
Closes #149
2015-10-24 23:28:55 +02:00
cpfeiffer c350f04fa9 Make "Locate device" work with newer firmware and MI1A. (#136)
Separate the different notification logic into distinct strategy classes.
2015-10-22 00:53:27 +02:00
cpfeiffer 3b94a96060 Fix some warnings 2015-10-21 23:29:37 +02:00
Sergey Trofimov d57c6166b9 Fix pairing with MI1A 2015-10-18 21:54:22 +03:00
Andreas Shimokawa 5860c4f4f9 Pebble: WIP support for flashing language files (.pbl)
NOTES:
- YOU SHOULD NOT TRY THIS YET ;)
- This was only tested with the unoffical japansese language pack
- Problably needs proper crc calculation (I just hardcoded the one for the japanese language pack)
2015-10-06 23:56:01 +09:00
cpfeiffer 586d959055 Merge branch 'master' into live-activity-data 2015-10-02 23:49:03 +02:00
Daniele Gobbetti f8edf5c525 Move BLE standard characteristic and services debug names to the right class. 2015-09-28 16:28:08 +02:00
Daniele Gobbetti deea721090 Add verbatim Official BLE Services, Descriptors and Characteristics.
Move the already defined constants to these new classes.
2015-09-28 12:51:01 +02:00
cpfeiffer 4250a002b4 Merge branch 'master' into live-activity-data 2015-09-27 00:16:04 +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 3852fcd756 Reuse MiBandDateConverter 2015-09-23 23:16:42 +02:00
Andreas Shimokawa 77b4bb9cf1 Mi Band: Do not whitelist 1.0.10.14 anymore, vibration seems to be broken with Gadgetbridge 2015-09-20 22:13:25 +02:00
Daniele Gobbetti 55341678b3 Add firmwares from the wiki. 2015-09-17 16:56:23 +02:00
Daniele Gobbetti b73ff49681 Use data type constant instead of hardcoded value 2015-09-17 16:56:23 +02:00
cpfeiffer 518b1ee6f4 Merge branch 'master' into live-activity-data 2015-09-07 21:41:02 +02:00
Daniele Gobbetti 6c28b50f52 allow the transfer of activity data without clearing MiBand's memory 2015-09-07 12:06:56 +02:00
cpfeiffer ab8982e7f2 WIP: support for live display of activity data 2015-09-02 08:02:26 +02:00
Daniele Gobbetti ee3ca5998e Fail early when opening a pebble file.
Fixes #102

We could also use a whitelist approach instead, but we can't be sure that the user installs a file with .fw extension, hence i preferred to only avoid loading files which are known to be of the wrong type.
2015-08-31 17:41:09 +02:00
cpfeiffer 41d8bcf634 Make firmware and app installation a bit more user friendly #30 2015-08-30 00:21:51 +02:00
Daniele Gobbetti 26792717d4 Add showing when the device wasn't worn by the user 2015-08-28 14:58:30 +02:00
Daniele Gobbetti cbea0feb9e Centralize the calendar conversion to/from byte array take 2.
Move to an independent class.
2015-08-28 10:40:25 +02:00
Daniele Gobbetti 677e0808bf Centralize the calendar conversion to/from byte array. 2015-08-27 13:12:09 +02:00
Daniele Gobbetti df417e5c6c Fix bug regarding setting wear location.
Closes #95
2015-08-21 15:23:48 +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 e6a0c35f73 Extract checksum implementations into separate class CheckSums 2015-08-17 22:43:42 +02:00
Andreas Shimokawa 6fede31bdf Pebble: make watchapp installation available on FW 3.x without the need for setting an option 2015-08-17 18:07:47 +02:00
cpfeiffer ecc483f027 Remove now unused class 2015-08-14 23:50:21 +02:00
Andreas Shimokawa 5a8c9a9180 Pebble: cache installed pbw files on sdcard if force untested option is set
This will be needed for FW 3.x on demand installations.
2015-08-11 12:04:45 +02:00
Daniele Gobbetti fe11e6d306 Some BTLE cleanup:
- the BASE_UUID is shared between all BTLE devices, not miband specific. So are the UUID DESCRIPTORS. Hence these have been moved to AbstractBTLEDeviceSupport
- the gatt-characteristic-property-constants used previously in MiBandNotifyAction are also general, and exposed by the gatt subsystem, hence the specific action has been dropped moving the logic to the NotifyAction class
 - the logic for checking the gatt-characteristic-property-constants has been extended also to the ReadAction and WriteAction class, this way we won't try to read (or write)  a characteristic that isn't readable (or writeable)
2015-08-07 16:59:52 +02:00
cpfeiffer 9004a8b0c1 Experimental: ACTION_START is now optional -- ACTION_CONNECT is sufficient 2015-08-06 23:17:41 +02:00
cpfeiffer 2a2eae068a Improvements to the install activity #30
- made it independent of Mi fw and Pebble fw + app classes
- automatically connect to the last used device
- some other small fixes/improvements
2015-08-06 02:17:38 +02:00
Daniele Gobbetti 495a8cc650 Reorder the lines in the MiBandService class.
No functional changes, just clarity enhanchement.
2015-08-05 17:32:02 +02:00
cpfeiffer e92c9dbbb5 Better check for fw version major (#30) 2015-08-04 23:08:40 +02:00
cpfeiffer 910d9ef398 Make firmware reading a bit more failsafe #30 2015-08-04 23:02:36 +02:00
cpfeiffer c407ed1a76 Last refactoring for now: BluetoothCommunicationService
- rename to DeviceCommunicationService
- move all bluetooth related bits into separate DeviceSupportFactory
  class
2015-08-04 01:01:14 +02:00
cpfeiffer 7c597b325a Big refactoring: move classes and packages around to get a better structure
- model package contains mostly shared interfaces (UI+service), not named GB*
- impl package contains implementations of those interfaces, named GB*
  the impl classes should not be used by the service (not completely done)
- the service classes should mostly use classes inside the service and deviceevents
  packages (tbd)

Every device now has two packages:
- devices/[device name] for UI related functionality
- service[device name] for lowlevel communication
2015-08-03 23:09:49 +02:00