Commit Graph

12 Commits (536b2bd8a09b876a0badcd4d8e04f2d403f277da)

Author SHA1 Message Date
Andreas Shimokawa 46171e4ab8 Some preparations for interactive notifications 2015-08-31 22:27:25 +02:00
cpfeiffer ba670bbb50 More testing work: with a new test for finding the device 2015-08-23 00:54:51 +02:00
cpfeiffer 77cad5c47f Initial support for testing the DeviceCommunicationService
Lots of support classes to enable local testing, without
a device or an emulator.
2015-08-22 01:09:56 +02:00
cpfeiffer a1cb246e27 Add and use a "client interface" for the actions of the service
Previously, the DeviceCommunicationService was invoked directly,
via
Intent intent = new Intent(foo, bar);
intent.setExtra(EXTRA_BAZ, baz);
startService(...);

and this was scattered throughout GadgetBridge.
Now there is a "frontend" available, so that you can call
the service more easily, like
GBApplication.deviceService().connect();

For a start, this client interface (DeviceService) actually
implements the same interface (EventHandler) as the receiving side
(DeviceSupport). This may change in the future.

This will also make testing much easier, because we can use
this client interface to invoke the test service as well.
2015-08-21 01:03:57 +02:00
cpfeiffer 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
cpfeiffer 2e3de0cd0f Always send out the current state of GBDevice when asking for version
In a second step, request the version from the device (and send updated
values then)

RequestVersionInfo is either a misnomer or misused, depending on your view.
It is actually used by activities to get the current state of thde device.

We now provide this as quickly as possible, with the drawback of sometimes
sending results twice.
2015-08-14 00:29:05 +02:00
cpfeiffer eec7fae288 Attempting to fix some connection problems after getting disconnected 2015-08-14 00:23:01 +02:00
Andreas Shimokawa 27f88e484d Make ControlCenter only ask for version details after device is initialized
This allows removal of a workaround which allowed ACTION_REQUEST_VERSIONINFO
to be used in connected state (instead of initialized state)
2015-08-07 22:07:48 +02:00
Andreas Shimokawa 6125594703 Various changes related to INITIALZED device state
Due to a bug in DeviceCommunicationService.isConnected(), devices using the
INITIALIZED state only worked when they had useAutoConnect set to true (Mi Band)

Now setting devices to INITIALIZED state to allow any action send to
DeviceCommunicationService is mandatory. As an exception only
REQUEST_VERSIONINFO will be also be allowed for CONNECTED state.

This also fixes a problem when notifications came in on the Pebble with 3.x
FW before we actually knew it was FW 3.x (INITZALIZED state on the Pebble
now implies that we know the FW version)
2015-08-07 13:24:54 +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
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