use of com.vodafone360.people.service.interfaces.IPeopleService in project 360-Engine-for-Android by 360.
the class DatabaseHelper method deleteTimelineActivity.
/***
* Removes the selected timeline activity from the database.
*
* @param application The MainApplication
* @param timelineItem TimelineSummaryItem to be deleted
* @return SUCCESS or a suitable error code
*/
public ServiceStatus deleteTimelineActivity(MainApplication application, TimelineSummaryItem timelineItem, boolean isTimelineAll) {
if (Settings.ENABLED_DATABASE_TRACE)
trace(false, "DatabaseHelper.deleteTimelineActivity()");
ServiceStatus status = ServiceStatus.SUCCESS;
if (isTimelineAll) {
status = ActivitiesTable.deleteTimelineActivities(mContext, timelineItem, getWritableDatabase(), getReadableDatabase());
} else {
status = ActivitiesTable.deleteTimelineActivity(mContext, timelineItem, getWritableDatabase(), getReadableDatabase());
}
if (status == ServiceStatus.SUCCESS) {
// Update Notifications in the Notification Bar
IPeopleService peopleService = application.getServiceInterface();
long localContactId = 0L;
if (timelineItem.mLocalContactId != null) {
localContactId = timelineItem.mLocalContactId;
}
peopleService.updateChatNotification(localContactId);
}
fireDatabaseChangedEvent(DatabaseChangeType.ACTIVITIES, true);
return status;
}
use of com.vodafone360.people.service.interfaces.IPeopleService in project 360-Engine-for-Android by 360.
the class RemoteServiceTest method testGetServiceInterface.
/**
* Test getServiceInterface() from RemoteService.
*
* @throws Exception Issue setting up the service.
*/
@MediumTest
public final void testGetServiceInterface() throws Exception {
/** Setup test preconditions (i.e. startService). **/
startService(new Intent(getContext(), RemoteService.class));
/** Perform test (i.e. getServiceInterface). **/
IPeopleService mPeopleService = mApplication.getServiceInterface();
/** Test if mPeopleService is correctly initialised. **/
assertNotNull("IPeopleService should not be NULL", mPeopleService);
IWorkerThreadControl workerThreadControl = (IWorkerThreadControl) FrameworkUtils.get(mPeopleService, "mWorkerThreadControl");
assertNotNull("Expecting mWorkerThreadControl not to be NULL", workerThreadControl);
RemoteService service = (RemoteService) FrameworkUtils.get(mPeopleService, "mService");
assertNotNull("Expecting mService not to be NULL", service);
UiAgent handlerAgent = (UiAgent) FrameworkUtils.get(mPeopleService, "mHandlerAgent");
assertNotNull("Expecting mHandlerAgent not to be NULL", handlerAgent);
ApplicationCache applicationCache = (ApplicationCache) FrameworkUtils.get(mPeopleService, "mApplicationCache");
assertNotNull("Expecting mApplicationCache not to be NULL", applicationCache);
}
Aggregations