using namespace ctx;
ContactsDbAgent::ContactsDbAgent(IAgentUtil* agentUtil) :
+ __idle(true),
__agentUtil(agentUtil)
{
_D("Created");
bool ContactsDbAgent::doAction(uint8_t length, const void* command)
{
- _D("Command: %d", reinterpret_cast<const char*>(command)[0]);
+ char cmd = reinterpret_cast<const char*>(command)[0];
+ _D("Command: %d", cmd);
+
+ __idle = (cmd == GEOFENCE_CMD_STOP);
//TODO
// Regarding the given command, start or stop monitoring the DB changes.
// If a change is detected, send a signal to the ContactsDbChanges publisher.
+
return true;
}
+
+bool ContactsDbAgent::isIdle()
+{
+ return __idle;
+}
using namespace ctx;
GeofenceAgent::GeofenceAgent(IAgentUtil* agentUtil) :
+ __idle(true),
__agentUtil(agentUtil)
{
_D("Created");
bool GeofenceAgent::doAction(uint8_t length, const void* command)
{
- _D("Command: %d", reinterpret_cast<const char*>(command)[0]);
+ char cmd = reinterpret_cast<const char*>(command)[0];
+ _D("Command: %d", cmd);
+
+ __idle = (cmd == GEOFENCE_CMD_STOP);
//TODO
// Regarding the given command, start or stop monitoring Home/Work geofencing events.
// If an event is detected, send a signal to the GeofenceEvent publisher.
// This may require to assign an app id to this user session daemon,
// as the Geofence API requires the package id to distinguish a client.
+
return true;
}
+
+bool GeofenceAgent::isIdle()
+{
+ return __idle;
+}