|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.ApplicationCache
public class ApplicationCache
Caches information about the current state of the application. Stores most recent activity and caches other information such as login details, so that the application is returned to its most recent state when brought back to the foreground or re-entered. The cached details can be cleared if required (as part of 'Remove user data' for example).
Field Summary | |
---|---|
static java.lang.String |
CONTACT_DATA
|
static java.lang.String |
CONTACT_ID
|
static java.lang.String |
CONTACT_MODIFIED
|
static java.lang.String |
CONTACT_NAME
|
static java.lang.String |
CONTACT_NETWORK
|
static java.lang.String |
CONTACT_NUMBER
|
static int |
CONTACT_PROFILE_ADD
|
static int |
CONTACT_PROFILE_EDIT
|
static int |
CONTACT_PROFILE_VIEW
|
static int |
CONTACT_PROFILE_VIEW_ME
|
static java.lang.String |
CONTACT_SUMMARY
|
private static java.lang.String |
FACEBOOK_SUBSCRIBED
|
private static java.lang.String |
FALSE
|
static long[] |
FREQUENCY_SETTING_LONG
|
private static java.lang.String |
HYVES_SUBSCRIBED
|
private boolean |
mAcceptedTermsAndConditions
|
private Contact |
mCurrentContact
|
private ContactSummary |
mCurrentContactSummary
|
private ActivitiesTable.TimelineSummaryItem |
mCurrentTimelineSummary
|
private boolean |
mFirstTimeLogin
|
private int |
mIdentityBeingProcessed
|
private ContactSummary |
mMeProfileSummary
|
private boolean |
mScanThirdPartyAccounts
|
private ServiceStatus |
mServiceStatus
|
private SyncStatus |
mSyncStatus
In memory cache of the current contacts sync status. |
private java.util.ArrayList<ThirdPartyAccount> |
mThirdPartyAccountsCache
|
static java.lang.String |
PREFS_CHECK_FREQUENCY
|
static java.lang.String |
PREFS_FILE
Login details are stored in the preferences file so that they can be used to pre-populate the edit fields if the user is interrupted in the middle of login/signup |
static java.lang.String |
PREFS_LAST_CHECKED_DATE
|
static java.lang.String |
PREFS_LAST_DIALOG_DATE
|
static java.lang.String |
PREFS_NAME
|
static java.lang.String |
PREFS_UPGRADE_LATEST_VERSION
|
static java.lang.String |
PREFS_UPGRADE_TEXT
|
static java.lang.String |
PREFS_UPGRADE_URL
|
static int |
RESULT_DELETE
|
static java.lang.String |
sIsNewMessage
|
static java.lang.String |
STARTUP_LAUNCH_PATH_KEY
|
static java.lang.String |
sWidgetProviderClassName
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_CAPABILITIES
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_ERROR_CODE
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_NAME_KEY
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_NETWORK_KEY
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_PASSWORD_KEY
|
static java.lang.String |
THIRD_PARTY_ACCOUNT_USERNAME_KEY
|
private static java.lang.String |
TRUE
|
Constructor Summary | |
---|---|
ApplicationCache()
|
Method Summary | |
---|---|
protected void |
clearCachedData(Context context)
Clear all cached data currently stored in People application. |
boolean |
firstTimeLogin()
Whether this is a first time login (on this device) for current account. |
boolean |
getAcceptedTermsAndConditions()
Return whether user has accepted the Terms and Conditions on sign-up. |
Contact |
getCurrentContact()
Gets the contact currently being viewed in the UI. |
ContactSummary |
getCurrentContactSummary()
Gets the summary information of the contact currently being viewed in the UI. |
ActivitiesTable.TimelineSummaryItem |
getCurrentTimelineSummary()
Gets the summary information of the Timeline currently being viewed in the UI. |
int |
getIdentityBeingProcessed()
Return index of the Identity currently being processed. |
ContactSummary |
getMeProfile()
Gets the ME profile object. |
boolean |
getScanThirdPartyAccounts()
Return whether application should re-scan 3rd party accounts. |
ServiceStatus |
getServiceStatus()
Return status of request issued to People service. |
static int |
getSnsSubscribedWarningId(Context context)
Return the resource ID for the SNS Subscribed warning (e.g. |
SyncStatus |
getSyncStatus()
Gets the current sync state, or NULL if the state has not been set in this JVM instance. |
java.util.ArrayList<ThirdPartyAccount> |
getThirdPartyAccounts()
Return cached list of 3rd party accounts (Identities) associated with current login. |
private static java.lang.String |
getValue(Context context,
java.lang.String key,
java.lang.String defaultValue)
Get a value from the preferences file. |
int[] |
getWidgetIdList(Context context)
Get list of IDs of Home-screen widgets. |
static boolean |
isBooleanValue(Context context,
java.lang.String key)
|
private static boolean |
isFacebookInThirdPartyAccountList(java.util.ArrayList<ThirdPartyAccount> list)
Return TRUE if the given ThirdPartyAccount contains a Facebook account. |
private static boolean |
isHyvesInThirdPartyAccountList(java.util.ArrayList<ThirdPartyAccount> list)
Return TRUE if the given ThirdPartyAccount contains a Hyves account. |
void |
setAcceptedTermsAndConditions(boolean state)
Set whether user has accepted the Terms and Conditions on sign-up. |
static void |
setBooleanValue(Context context,
java.lang.String key,
boolean value)
|
void |
setCurrentContact(Contact contact)
Sets the contact currently being viewed in the UI. |
void |
setCurrentContactSummary(ContactSummary contactSummary)
Sets the summary information of the contact currently being viewed in the UI. |
void |
setCurrentTimelineSummary(ActivitiesTable.TimelineSummaryItem timelineSummary)
Sets the summary information of the Timeline Item currently being viewed in the UI. |
void |
setFirstTimeLogin(boolean state)
Set whether this is a first time login (on this device) for current account. |
void |
setIdentityBeingProcessed(int index)
Set index of Identity currently being processed. |
void |
setMeProfile(ContactSummary summary)
Sets the ME profile object. |
void |
setScanThirdPartyAccounts(boolean state)
Set whether application should re-scan 3rd party accounts. |
void |
setServiceStatus(ServiceStatus status)
Set status of request issued to People service. |
void |
setSyncStatus(SyncStatus syncStatus)
Sets the current sync status. |
private static void |
setValue(Context context,
java.lang.String key,
java.lang.String value)
Set a value in the preferences file. |
void |
storeThirdPartyAccounts(Context context,
java.util.ArrayList<ThirdPartyAccount> list)
Cache list of 3rd party accounts (Identities) associated with current login. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String TRUE
private static final java.lang.String FALSE
public static final java.lang.String PREFS_FILE
public static final java.lang.String CONTACT_DATA
public static final java.lang.String CONTACT_SUMMARY
public static final java.lang.String CONTACT_ID
public static final java.lang.String CONTACT_NAME
public static final java.lang.String CONTACT_NUMBER
public static final java.lang.String CONTACT_NETWORK
public static final java.lang.String CONTACT_MODIFIED
public static final java.lang.String STARTUP_LAUNCH_PATH_KEY
public static final int RESULT_DELETE
public static final int CONTACT_PROFILE_VIEW
public static final int CONTACT_PROFILE_EDIT
public static final int CONTACT_PROFILE_ADD
public static final int CONTACT_PROFILE_VIEW_ME
public static final java.lang.String THIRD_PARTY_ACCOUNT_NAME_KEY
public static final java.lang.String THIRD_PARTY_ACCOUNT_NETWORK_KEY
public static final java.lang.String THIRD_PARTY_ACCOUNT_USERNAME_KEY
public static final java.lang.String THIRD_PARTY_ACCOUNT_PASSWORD_KEY
public static final java.lang.String THIRD_PARTY_ACCOUNT_CAPABILITIES
public static final java.lang.String THIRD_PARTY_ACCOUNT_ERROR_CODE
private static final java.lang.String FACEBOOK_SUBSCRIBED
private static final java.lang.String HYVES_SUBSCRIBED
public static final java.lang.String PREFS_NAME
public static final java.lang.String PREFS_CHECK_FREQUENCY
public static final java.lang.String PREFS_LAST_DIALOG_DATE
public static final java.lang.String PREFS_LAST_CHECKED_DATE
public static final java.lang.String PREFS_UPGRADE_LATEST_VERSION
public static final java.lang.String PREFS_UPGRADE_URL
public static final java.lang.String PREFS_UPGRADE_TEXT
public static java.lang.String sWidgetProviderClassName
public static java.lang.String sIsNewMessage
public static final long[] FREQUENCY_SETTING_LONG
private SyncStatus mSyncStatus
private boolean mFirstTimeLogin
private boolean mScanThirdPartyAccounts
private boolean mAcceptedTermsAndConditions
private int mIdentityBeingProcessed
private java.util.ArrayList<ThirdPartyAccount> mThirdPartyAccountsCache
private ContactSummary mMeProfileSummary
private Contact mCurrentContact
private ContactSummary mCurrentContactSummary
private ServiceStatus mServiceStatus
private ActivitiesTable.TimelineSummaryItem mCurrentTimelineSummary
Constructor Detail |
---|
public ApplicationCache()
Method Detail |
---|
public boolean firstTimeLogin()
public void setFirstTimeLogin(boolean state)
aState
- True if this is our 1st time sync.public void setScanThirdPartyAccounts(boolean state)
state
- true if application should re-scan 3rd party accounts.public boolean getScanThirdPartyAccounts()
public void setIdentityBeingProcessed(int index)
index
- Index of Identity currently being processed.public int getIdentityBeingProcessed()
public void setAcceptedTermsAndConditions(boolean state)
state
- true if user has accepted terms and conditions.public boolean getAcceptedTermsAndConditions()
protected void clearCachedData(Context context)
public ContactSummary getMeProfile()
public void setMeProfile(ContactSummary summary)
summary
- ContyactSummary for Me profile.public Contact getCurrentContact()
public void setCurrentContact(Contact contact)
contact
- The currently viewed contact.public ContactSummary getCurrentContactSummary()
public void setCurrentContactSummary(ContactSummary contactSummary)
contactSummary
- Contact summary information.public ServiceStatus getServiceStatus()
public void setServiceStatus(ServiceStatus status)
status
- of request issued to People service.public void storeThirdPartyAccounts(Context context, java.util.ArrayList<ThirdPartyAccount> list)
list
- List of ThirdPartyAccount items retrieved from current login.public java.util.ArrayList<ThirdPartyAccount> getThirdPartyAccounts()
private static boolean isFacebookInThirdPartyAccountList(java.util.ArrayList<ThirdPartyAccount> list)
list
- List of ThirdPartyAccount objects, can be NULL.
private static boolean isHyvesInThirdPartyAccountList(java.util.ArrayList<ThirdPartyAccount> list)
list
- List of ThirdPartyAccount objects, can be NULL.
public int[] getWidgetIdList(Context context)
context
- Current context.
private static void setValue(Context context, java.lang.String key, java.lang.String value)
context
- Android context.key
- Preferences file parameter key.value
- Preference value.public SyncStatus getSyncStatus()
public void setSyncStatus(SyncStatus syncStatus)
syncStatus
- New sync status.private static java.lang.String getValue(Context context, java.lang.String key, java.lang.String defaultValue)
context
- Android context.key
- Preferences file parameter key.defaultValue
- Preference value.
public static int getSnsSubscribedWarningId(Context context)
context
- Android context.
java.security.InvalidParameterException
- when context is NULL.public static boolean isBooleanValue(Context context, java.lang.String key)
public static void setBooleanValue(Context context, java.lang.String key, boolean value)
public ActivitiesTable.TimelineSummaryItem getCurrentTimelineSummary()
public void setCurrentTimelineSummary(ActivitiesTable.TimelineSummaryItem timelineSummary)
timelineSummary
- Timeline summary information.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc