public static synchronized Apptentive . DateTime getTimeAtInstall ( Selector selector ) { ensureLoaded ( ) ; for ( VersionHistoryEntry entry : versionHistoryEntries ) { switch ( selector ) { case total : // Since the list is ordered, this will be the first and oldest entry. return new Apptentive . DateTime ( entry . getTimestamp ( ) ) ; case version_code : if ( entry . getVersionCode ( ) == RuntimeUtils . getAppVersionCode ( ApptentiveInternal . getInstance ( ) . getApplicationContext ( ) ) ) { return new Apptentive . DateTime ( entry . getTimestamp ( ) ) ; } break ; case version_name : Apptentive . Version entryVersionName = new Apptentive . Version ( ) ; Apptentive . Version currentVersionName = new Apptentive . Version ( ) ; entryVersionName . setVersion ( entry . getVersionName ( ) ) ; currentVersionName . setVersion ( RuntimeUtils . getAppVersionName ( ApptentiveInternal . getInstance ( ) . getApplicationContext ( ) ) ) ; if ( entryVersionName . equals ( currentVersionName ) ) { return new Apptentive . DateTime ( entry . getTimestamp ( ) ) ; } break ; } } return new Apptentive . DateTime ( Util . currentTimeSeconds ( ) ) ; }
Returns the number of seconds since the first time we saw this release of the app . Since the version entries are always stored in order the first matching entry happened first .