|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.activities.FetchCallLogEvents
public class FetchCallLogEvents
Fetches call log events from the Native call log. These are treated as Activities and displayed in Timeline UI.
Nested Class Summary | |
---|---|
private static class |
FetchCallLogEvents.InternalState
Internal states for Call log event sync. |
Field Summary | |
---|---|
private static java.lang.String[] |
CALL_LOG_PROJECTION
Set of Call log items to be fetched by query on Native call-log. |
private static int |
COLUMN_CALLLOG_DATE
|
private static int |
COLUMN_CALLLOG_ID
|
private static int |
COLUMN_CALLLOG_PHONE
|
private static int |
COLUMN_CALLLOG_TYPE
|
private static int |
MAX_CALL_LOG_ITEMS_PER_PAGE
|
private static int |
MAX_ITEMS_TO_WRITE
|
private static int |
MAX_NUMBER_OF_PAGES
the number of timeline pages to be loaded by one ISyncHelper |
private Context |
mContext
|
private ContentResolver |
mCr
|
private DatabaseHelper |
mDb
|
private ActivitiesEngine |
mEngine
|
private FetchCallLogEvents.InternalState |
mInternalState
|
private Cursor |
mNativeCursor
|
private long |
mNewestPhoneCall
the current newest phone call time |
private long |
mOldestPhoneCall
the current oldest phone call time |
private int |
mPageCount
the number of pages have been read |
private boolean |
mRefresh
is true if newer events need to be loaded, false - if older |
private java.util.ArrayList<ActivitiesTable.TimelineSummaryItem> |
mSyncItemList
|
private static java.lang.String |
NATIVE_NUMBER_UNKNOWN_STRING
|
Constructor Summary | |
---|---|
FetchCallLogEvents(Context context,
ActivitiesEngine engine,
DatabaseHelper db,
boolean refresh)
Constructor. |
Method Summary | |
---|---|
private void |
addCallLogData(int id)
Create TimelineSummaryItem from Native call-log item. |
void |
cancel()
Cancel fetch of call log events. |
private void |
complete(ServiceStatus status)
Completion of fetch from Native call log. |
private static ActivityItem.Type |
nativeTypeToNpType(int nativeType)
Convert native call type to type stored in People's ActivityItem. |
void |
run()
Drive internal state machine, either start call log sync, fetch next page of call-log items or complete call-log sync operation. |
private void |
saveTimestamp()
This method updates the newest and oldest phone calls timestamps in the database. |
private void |
startSyncCallLog()
Start sync of call events from Native call log. |
private void |
syncNextPage()
Sync next page of call-log events (page-size is 2). |
private ServiceStatus |
updateDatabase()
|
private void |
updateTimeStamps()
This method goes through the event list and updates the current newest and oldest phone call timestamps. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int MAX_CALL_LOG_ITEMS_PER_PAGE
private static final int MAX_ITEMS_TO_WRITE
private static final int MAX_NUMBER_OF_PAGES
private static final java.lang.String NATIVE_NUMBER_UNKNOWN_STRING
private Context mContext
private ContentResolver mCr
private Cursor mNativeCursor
private ActivitiesEngine mEngine
private DatabaseHelper mDb
private final java.util.ArrayList<ActivitiesTable.TimelineSummaryItem> mSyncItemList
private boolean mRefresh
private int mPageCount
private long mOldestPhoneCall
private long mNewestPhoneCall
private FetchCallLogEvents.InternalState mInternalState
private static final java.lang.String[] CALL_LOG_PROJECTION
private static final int COLUMN_CALLLOG_ID
private static final int COLUMN_CALLLOG_PHONE
private static final int COLUMN_CALLLOG_DATE
private static final int COLUMN_CALLLOG_TYPE
Constructor Detail |
---|
FetchCallLogEvents(Context context, ActivitiesEngine engine, DatabaseHelper db, boolean refresh)
context
- Context - actually RemoteServe's Context.engine
- Handle to ActivitiesEngine.db
- Handle to DatabaseHelper.refresh
- boolean - true if new phone call need to be fetched, false
- if olderMethod Detail |
---|
public void run()
run
in interface ActivitiesEngine.ISyncHelper
public void cancel()
cancel
in interface ActivitiesEngine.ISyncHelper
private void startSyncCallLog()
private void syncNextPage()
private ServiceStatus updateDatabase()
private void updateTimeStamps()
private void saveTimestamp()
private void addCallLogData(int id)
id
- ID of item from Native log.private void complete(ServiceStatus status)
status
- ServiceStatus containing result of sync.private static ActivityItem.Type nativeTypeToNpType(int nativeType)
nativeType
- Native call type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc