com.vodafone360.people.engine.upgrade
Class UpgradeUtils

java.lang.Object
  extended by com.vodafone360.people.engine.upgrade.UpgradeUtils

public class UpgradeUtils
extends java.lang.Object

Utility class for upgrade related functionality.


Constructor Summary
UpgradeUtils()
           
 
Method Summary
protected static void cacheUpdate(Context context, UpgradeStatus upgradeStatus)
          Caches the mUpgradeStatus value if set, but clears the cache if NULL.
protected static long getAgeMillis(long time)
          Returns the age of a given System.currentTimeMillis() value.
protected static UpgradeStatus getCachedUpdate(Context context, long checkFrequencyMillis)
          Gets an UpgradeStatus object, if one is stored in the Cache.
static long getCheckFrequency(Context context)
          Return the PREFS_CHECK_FREQUENCY Preference value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeUtils

public UpgradeUtils()
Method Detail

getCheckFrequency

public static long getCheckFrequency(Context context)
Return the PREFS_CHECK_FREQUENCY Preference value.

Parameters:
context - Context
Returns:
Current value for PREFS_CHECK_FREQUENCY or the PREFS_CHECK_FREQUENCY_DEFAULT

cacheUpdate

protected static void cacheUpdate(Context context,
                                  UpgradeStatus upgradeStatus)
Caches the mUpgradeStatus value if set, but clears the cache if NULL.

Parameters:
context - - the context to use
upgradeStatus - - the upgrade properties - can be null

getCachedUpdate

protected static UpgradeStatus getCachedUpdate(Context context,
                                               long checkFrequencyMillis)
Gets an UpgradeStatus object, if one is stored in the Cache.

Parameters:
context - - the context to use
checkFrequencyMillis - - the frequency with which to check
Returns:
the cached UpgradeStatus or null if none available

getAgeMillis

protected static long getAgeMillis(long time)
Returns the age of a given System.currentTimeMillis() value.

Parameters:
time - Time to check
Returns:
Age in milliseconds


JavaDoc