@@ -21,11 +21,12 @@ public class AppSpecificSettings {
2121 private static final String DATABASE_NAME = "DATABASE_NAME" ;
2222 private static final String ENABLE_TEXT_LOGGING = "ENABLE_TEXT_LOGGING" ;
2323 private static final String TEXT_LOG_FILE_NAME = "TEXT_LOG_FILE_NAME" ;
24- private static final String AL_BASE_URL = "AL_BASE_URL" ;
24+ private static final String BASE_URL = "AL_BASE_URL" ;
2525 private static final String KM_BASE_URL = "KM_BASE_URL" ;
26- private static final String AL_SUPPORT_EMAIL_ID = "AL_SUPPORT_EMAIL_ID" ;
26+ private static final String SUPPORT_EMAIL_ID = "AL_SUPPORT_EMAIL_ID" ;
2727 private static final String ENABLE_LOGGING_IN_RELEASE_BUILD = "ENABLE_LOGGING_IN_RELEASE_BUILD" ;
28- private static final String AL_NOTIFICATION_AFTER_TIME = "AL_NOTIFICATION_AFTER_TIME" ;
28+ private static final String NOTIFICATION_AFTER_TIME = "AL_NOTIFICATION_AFTER_TIME" ;
29+ private static final String DATABASE_MIGRATION_RETRY_COUNT = "DATABASE_MIGRATION_RETRY_COUNT" ;
2930
3031 private AppSpecificSettings (Context context ) {
3132 this .sharedPreferences = AppContextService .getContext (context ).getSharedPreferences (MY_PREFERENCE , Context .MODE_PRIVATE );
@@ -66,11 +67,11 @@ public String getTextLogFileName() {
6667 }
6768
6869 public String getAlBaseUrl () {
69- return sharedPreferences .getString (AL_BASE_URL , null );
70+ return sharedPreferences .getString (BASE_URL , null );
7071 }
7172
7273 public AppSpecificSettings setAlBaseUrl (String url ) {
73- sharedPreferences .edit ().putString (AL_BASE_URL , url ).commit ();
74+ sharedPreferences .edit ().putString (BASE_URL , url ).commit ();
7475 return this ;
7576 }
7677
@@ -84,11 +85,11 @@ public AppSpecificSettings setKmBaseUrl(String url) {
8485 }
8586
8687 public String getSupportEmailId () {
87- return sharedPreferences .getString (AL_SUPPORT_EMAIL_ID , APPLOZIC_SUPPORT );
88+ return sharedPreferences .getString (SUPPORT_EMAIL_ID , APPLOZIC_SUPPORT );
8889 }
8990
9091 public AppSpecificSettings setSupportEmailId (String emailId ) {
91- sharedPreferences .edit ().putString (AL_SUPPORT_EMAIL_ID , emailId ).commit ();
92+ sharedPreferences .edit ().putString (SUPPORT_EMAIL_ID , emailId ).commit ();
9293 return this ;
9394 }
9495
@@ -102,16 +103,25 @@ public boolean isLoggingEnabledForReleaseBuild() {
102103 }
103104
104105 public AppSpecificSettings setNotificationAfterTime (long notificationAfterTime ) {
105- sharedPreferences .edit ().putLong (AL_NOTIFICATION_AFTER_TIME , notificationAfterTime ).commit ();
106+ sharedPreferences .edit ().putLong (NOTIFICATION_AFTER_TIME , notificationAfterTime ).commit ();
106107 return this ;
107108 }
108109
109110 public boolean isAllNotificationMuted () {
110- long notificationAfterTime = sharedPreferences .getLong (AL_NOTIFICATION_AFTER_TIME , 0 );
111+ long notificationAfterTime = sharedPreferences .getLong (NOTIFICATION_AFTER_TIME , 0 );
111112 Date date = Calendar .getInstance (TimeZone .getTimeZone ("UTC" )).getTime ();
112113 return (notificationAfterTime - date .getTime () > 0 );
113114 }
114115
116+ public int getCurrentDatabaseMigrationRetryCount () {
117+ return sharedPreferences .getInt (DATABASE_MIGRATION_RETRY_COUNT , 0 );
118+ }
119+
120+ public AppSpecificSettings setCurrentDatabaseMigrationRetryCount (int databaseMigrationRetryCount ) {
121+ sharedPreferences .edit ().putInt (DATABASE_MIGRATION_RETRY_COUNT , databaseMigrationRetryCount ).apply ();
122+ return this ;
123+ }
124+
115125 public boolean clearAll () {
116126 if (sharedPreferences != null ) {
117127 return sharedPreferences .edit ().clear ().commit ();
0 commit comments