fix survey request display logic

This commit is contained in:
Eric House 2014-08-18 07:28:28 -07:00
parent b278696a30
commit e04f7c8f35

View file

@ -513,7 +513,7 @@ public class Utils {
private static void setFirstBootStatics( Context context ) private static void setFirstBootStatics( Context context )
{ {
if ( null == s_isFirstBootThisVersion ) { if ( null == s_isFirstBootThisVersion ) {
int thisVersion = getAppVersion( context ); final int thisVersion = getAppVersion( context );
int prevVersion = 0; int prevVersion = 0;
SharedPreferences prefs = SharedPreferences prefs =
context.getSharedPreferences( HIDDEN_PREFS, context.getSharedPreferences( HIDDEN_PREFS,
@ -530,11 +530,13 @@ public class Utils {
s_isFirstBootThisVersion = new Boolean( newVersion ); s_isFirstBootThisVersion = new Boolean( newVersion );
s_isFirstBootEver = new Boolean( -1 == prevVersion ); s_isFirstBootEver = new Boolean( -1 == prevVersion );
int firstVersion = prefs.getInt( FIRST_VERSION_KEY, thisVersion ); int firstVersion = prefs.getInt( FIRST_VERSION_KEY, 0 );
s_firstVersion = new Boolean( firstVersion == thisVersion ); s_firstVersion = new Boolean( firstVersion == thisVersion );
if ( newVersion || s_firstVersion ) { if ( newVersion || 0 == firstVersion ) {
SharedPreferences.Editor editor = prefs.edit() SharedPreferences.Editor editor = prefs.edit();
.putInt( SHOWN_VERSION_KEY, thisVersion ); if ( newVersion ) {
editor.putInt( SHOWN_VERSION_KEY, thisVersion );
}
if ( 0 == firstVersion ) { if ( 0 == firstVersion ) {
editor.putInt( FIRST_VERSION_KEY, thisVersion ); editor.putInt( FIRST_VERSION_KEY, thisVersion );
} }