Commit Graph

53 Commits (fa8df9f552265e207b500b91cf9658f53d9c5090)

Author SHA1 Message Date
cpfeiffer a39e3a035c Move device deletion logic to DeviceCoordinator and subclasses 2016-10-24 20:02:44 +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
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
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
Andreas Shimokawa 696611d392 Do not show "your activity" if activity tracking is not supported 2016-09-20 22:02:40 +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
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
Andreas Shimokawa 34aead6c63 remove obsolte stuff 2016-08-26 23:37:17 +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
Andreas Shimokawa ec4469a87b Testing with dummy onboarding activity
crashes
2016-08-24 20:15:26 +02:00
cpfeiffer f54163faeb centralize quit() functionality in GBApplication 2016-07-08 22:35:52 +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 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
Andreas Shimokawa 88f338b0b9 Reenable our discovery activity for Android 6
Now that we request location we are allowed to do a btle scan again
2016-05-26 14:58:36 +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 0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
Andreas Shimokawa 4bcebca744 Work towards dark theme, remove -v21 specific theme definition 2016-04-14 15:21:25 +02:00
Lem Dulfo 83e6e6b85f Add background image for empty ControlCenter 2016-04-10 21:11:41 +02:00
Lem Dulfo 80a21f2ec2 Move Discovery functionality to FAB 2016-04-10 21:11:41 +02:00
Lem Dulfo 5a3004cbce AppCompat and FAB, more Material Design 2016-04-10 21:11:41 +02:00
Andreas Shimokawa 767f359319 Launch Android's Bluetooth settings instead of our activiy on Android >= 6.0
BLE scanning does not work on Android 6.0 and for the Pebble it does not add any value anyway.
2016-03-22 13:43:01 +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 864e0953d9 only allow starting AppManager after device is initalized (else platform cant be determined) 2016-03-03 14:29:46 +01:00
Andreas Shimokawa 652c5575b3 user ckChangeLog to display the Changelog
There were other fancier libraries, but this one was so simple to integrate, that I could not resist ;)
2016-03-02 00:37:43 +01:00
Andreas Shimokawa 1a96bd31e5 Request permissions at runtime on Android 6. Closes #219
TODO: Tell the user why we request that and if he really needs it (if he does not have both a Mi Band and a Pebble she does not need all)
2016-02-21 15:29:18 +01:00
Andreas Shimokawa d7f74851e2 Pebble: allow reinstallation of apps in pbw-cache from App Manager (long press menu)
See #93
Also bump version, update CHANGELOG.md
2016-01-02 12:24:23 +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 6d7428ad29 Require initialized state for some more actions 2015-12-09 00:03:39 +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
Andreas Shimokawa aca0149b45 use DeviceHelper in DeviceSupportFactory to determine supported device from bt addresses
This fixes a bug when Pebble was detected as Mi when unpaired.
Since we were not able to read the device name, it was considered MI by duplicated and
faulty code. Fixes #177.
2015-12-01 11:39:34 +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 b43e96318a Also support pulldown to sync in ControlCenter #138
Should factor out some common code between ChartsActivity
and ControlCenter, though.
2015-10-18 01:39:25 +02:00
cpfeiffer 1e56e540fa Remove hardcoded equals("MI") in favor of DeviceCoordintator #136 2015-10-18 01:01:13 +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 070876db06 Allow disconnecting when device is connecting
Also require "initialized" state for "find device"
2015-08-24 13:19:17 +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
Andreas Shimokawa a7796ecbc6 Pebble: Emulator support
NOTE:
- supports aplite and basalt emulator
- needs recompilation of Gadgetbridge with INTERNET permission

TODO:
- fix disconnect issues
- emulator special packet support
- string localization
- ...
2015-08-19 00:06:15 +02:00
cpfeiffer 567f27b0f4 Some initial fixes found by static analysis #92 2015-08-16 00:17:16 +02:00
cpfeiffer d0229847e7 onFirmwareVersionReq() is no more
- version information is now provided implicitly by device initialization
- ACTION_REQUEST_VERSIONINFO is now ACTION_REQUEST_DEVICEINFO and it will
  return the current device state of the service without asking any DeviceSupport
  instance.
- ACTION_CONNECT now implicitly answers with a device update intent if it
  IS already connected.
2015-08-14 23:37:47 +02:00