public long getSecondsUntilExpiration() { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds == UNLIMITED_AGE ? Integer.MAX_VALUE : (lastRefreshTimestampSeconds + maxAgeSeconds) - getCurrentTimestampSeconds(); }
/** * @param halfTime If <code>true</code> then half maximum age is used to determine expiration. * @return <code>true</code> if the maximum age has been reached. */ public boolean hasExpired(boolean halfTime) { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds != UNLIMITED_AGE && (lastRefreshTimestampSeconds + (maxAgeSeconds/(halfTime ? 2 : 1))) < getCurrentTimestampSeconds(); }
public void stampLastRefresh() { setLastRefreshTimestampSeconds(getCurrentTimestampSeconds()); }
public long getSecondsUntilExpiration() { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds == UNLIMITED_AGE ? Integer.MAX_VALUE : (lastRefreshTimestampSeconds + maxAgeSeconds) - getCurrentTimestampSeconds(); }
/** * @param halfTime If <code>true</code> then half maximum age is used to determine expiration. * @return <code>true</code> if the maximum age has been reached. */ public boolean hasExpired(boolean halfTime) { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds != UNLIMITED_AGE && (lastRefreshTimestampSeconds + (maxAgeSeconds/(halfTime ? 2 : 1))) < getCurrentTimestampSeconds(); }
public void stampLastRefresh() { setLastRefreshTimestampSeconds(getCurrentTimestampSeconds()); }
/** * @param halfTime If <code>true</code> then half maximum age is used to determine expiration. * @return <code>true</code> if the maximum age has been reached. */ public boolean hasExpired(boolean halfTime) { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds != UNLIMITED_AGE && (lastRefreshTimestampSeconds + (maxAgeSeconds/(halfTime ? 2 : 1))) < getCurrentTimestampSeconds(); }
public long getSecondsUntilExpiration() { // Note: Uses direct field access for performance reasons on Android return maxAgeSeconds == UNLIMITED_AGE ? Integer.MAX_VALUE : (lastRefreshTimestampSeconds + maxAgeSeconds) - getCurrentTimestampSeconds(); }
public void stampLastRefresh() { setLastRefreshTimestampSeconds(getCurrentTimestampSeconds()); }