@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); developerAccountManager = DeveloperAccountManager.getInstance(getApplication()); Bundle b = getIntent().getExtras(); if (b != null) { // TODO move packageName and iconFilePath assignments to // BaseDetailsActivity // Will this effect startActivity etc with regard to null behaviour? // Might be best to leave them here packageName = b.getString(BaseActivity.EXTRA_PACKAGE_NAME); developerId = b.getString(BaseActivity.EXTRA_DEVELOPER_ID); iconFilePath = b.getString(BaseActivity.EXTRA_ICON_FILE); accountName = b.getString(BaseActivity.EXTRA_AUTH_ACCOUNT_NAME); developerAccountManager.selectDeveloperAccount(accountName); } }
public boolean shouldRemoteUpdateStats() { long now = System.currentTimeMillis(); long lastUpdate = developerAccountManager.getLastStatsRemoteUpdateTime(accountName); // never updated if (lastUpdate == 0) { return true; } return (now - lastUpdate) >= Preferences.STATS_REMOTE_UPDATE_INTERVAL; }