diff --git a/build.gradle b/build.gradle index 7187516bb0..1674515b14 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ allprojects { maven { url "https://cloudant.github.io/cloudant-sync-eap/repository" } maven { url 'https://maven.fabric.io/public' } maven { url "https://s3.amazonaws.com/repo.commonsware.com" } - maven { url 'https://nexus.pentaho.org/content/groups/omni/' } + // maven { url 'https://nexus.pentaho.org/content/groups/omni/' } maven { url 'https://dl.bintray.com/ibm-watson-health/ibm-fhir-server-releases' content { @@ -74,7 +74,7 @@ subprojects { ext.androidBuildToolsVersion = '29.0.3' ext.androidMinSdkVersion = 19 ext.androidCompileSdkVersion = 29 - ext.androidTargetSdkVersion = 29 + ext.androidTargetSdkVersion = 31 ext.androidAnnotationsVersion = '3.0.1' ext.androidAnnotationsAPIVersion = '3.0.1' diff --git a/opensrp-chw/build.gradle b/opensrp-chw/build.gradle index 7f885101af..559889c76f 100644 --- a/opensrp-chw/build.gradle +++ b/opensrp-chw/build.gradle @@ -230,8 +230,8 @@ android { ba { dimension = 'baseDimension' applicationIdSuffix ".ba" - versionCode 8 - versionName "1.0.8" + versionCode 9 + versionName "1.0.9" buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' @@ -244,13 +244,13 @@ android { buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Ward", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' buildConfigField "String", 'DEFAULT_LOCATION', '"Village Sublocations"' buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"Village"' - buildConfigField "int", "DATABASE_VERSION", '23' + buildConfigField "int", "DATABASE_VERSION", '24' } chad { dimension = 'baseDimension' applicationIdSuffix ".chad" - versionCode 3 - versionName "1.0.3" + versionCode 4 + versionName "1.0.4" buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' @@ -262,7 +262,7 @@ android { buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Clinic" , "CHSS" , "CHA"}' buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHA"' - buildConfigField "int", "DATABASE_VERSION", '15' + buildConfigField "int", "DATABASE_VERSION", '16' buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' buildConfigField "int", "MAX_READ_TIMEOUT", '5' } @@ -270,10 +270,10 @@ android { resConfigs "en", "fr" dimension = 'baseDimension' applicationIdSuffix ".drc" - versionCode 11 - versionName "1.0.16" - buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' - buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' + versionCode 12 + versionName "1.0.17" + buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10' + buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "String", 'opensrp_url', '"https://wcaro-cd.smartregister.org/opensrp/"' buildConfigField "String", 'guidebooks_url', '"https://opensrp.s3.amazonaws.com/media/drc/"' @@ -286,13 +286,13 @@ android { buildConfigField "String", 'DEFAULT_LOCATION', '"VILLAGE/COMMUNAUTE"' buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' buildConfigField "int", "MAX_READ_TIMEOUT", '5' - buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATABASE_VERSION", '13' } guinea { dimension = 'baseDimension' applicationIdSuffix ".guinea" - versionCode 4 - versionName "1.0.3" + versionCode 5 + versionName "1.0.4" buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '1000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '500' @@ -307,13 +307,13 @@ android { buildConfigField "String", 'DEFAULT_LOCATION_PREVIEW', '"Village"' buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHW"' buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' - buildConfigField "int", "DATABASE_VERSION", '8' + buildConfigField "int", "DATABASE_VERSION", '9' } togo { dimension = 'baseDimension' applicationIdSuffix ".togo" - versionCode 26 - versionName "1.2.7" + versionCode 27 + versionName "1.2.8" buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '1000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '500' @@ -327,12 +327,12 @@ android { buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '10' buildConfigField "int", "MAX_READ_TIMEOUT", '10' - buildConfigField "int", "DATABASE_VERSION", '21' + buildConfigField "int", "DATABASE_VERSION", '22' } liberia { dimension = 'baseDimension' - versionCode 8 - versionName "1.0.1" + versionCode 9 + versionName "1.0.2" buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' @@ -346,13 +346,13 @@ android { buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHA"' buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' buildConfigField "int", "MAX_READ_TIMEOUT", '5' - buildConfigField "int", "DATABASE_VERSION", '8' + buildConfigField "int", "DATABASE_VERSION", '9' } lmh { dimension = 'baseDimension' applicationIdSuffix ".lmh" - versionCode 7 - versionName "2.0.3" + versionCode 8 + versionName "2.0.4" buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '1' @@ -364,7 +364,7 @@ android { buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Country" , "County" , "District", "Clinics", "CHSS", "Village","Commune"}' buildConfigField "String", 'DEFAULT_LOCATION', '"Commune"' buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"Commune"' - buildConfigField "int", "DATABASE_VERSION", '7' + buildConfigField "int", "DATABASE_VERSION", '8' } } diff --git a/opensrp-chw/src/ba/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/ba/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index 0a4ab3f3e5..a585ea5f07 100644 --- a/opensrp-chw/src/ba/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/ba/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -102,6 +102,9 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 23: upgradeToVersion23(context, db); break; + case 24: + upgradeToVersion24(db); + break; default: break; } @@ -371,4 +374,8 @@ private static void upgradeToVersion23(Context context, SQLiteDatabase db) { } } + private static void upgradeToVersion24(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } + } diff --git a/opensrp-chw/src/chad/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/chad/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index f50fdad831..97bc688f77 100644 --- a/opensrp-chw/src/chad/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/chad/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -70,6 +70,9 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 15: upgradeToVersion15(db); break; + case 16: + upgradeToVersion16(db); + break; default: break; } @@ -223,4 +226,8 @@ private static void initializeIndicatorDefinitions(ReportingLibrary reportingLib reportingLibrary.readConfigFile(configFile, sqLiteDatabase); } } + + private static void upgradeToVersion16(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } } diff --git a/opensrp-chw/src/drc/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/drc/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index a7075c42af..616274af23 100644 --- a/opensrp-chw/src/drc/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/drc/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -48,11 +48,15 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 12: upgradeToVersion12(db); break; + case 13: + upgradeToVersion13(db); + break; default: break; } upgradeTo++; } + RepositoryUtils.updateClientValidateStatus(db); } private static void upgradeToVersion2(Context context, SQLiteDatabase db) { @@ -165,4 +169,8 @@ private static void upgradeToVersion11(SQLiteDatabase db) { private static void upgradeToVersion12(SQLiteDatabase db) { RepositoryUtils.updateNullEventIds(db); } + + private static void upgradeToVersion13(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } } diff --git a/opensrp-chw/src/guinea/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/guinea/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index 81e8ad5229..a832636b75 100644 --- a/opensrp-chw/src/guinea/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/guinea/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -50,6 +50,9 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 8: upgradeToVersion8(db); break; + case 9: + upgradeToVersion9(db); + break; default: break; } @@ -158,5 +161,9 @@ private static void upgradeToVersion7(SQLiteDatabase db) { } } + private static void upgradeToVersion9(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } + } diff --git a/opensrp-chw/src/liberia/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/liberia/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index d0b52a8cc2..b24863ccca 100644 --- a/opensrp-chw/src/liberia/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/liberia/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -49,6 +49,8 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 8: upgradeToVersion8(db); break; + case 9: + upgradeToVersion9(db); default: break; } @@ -152,6 +154,10 @@ private static void upgradeToVersion7(SQLiteDatabase db) { } private static void upgradeToVersion8(SQLiteDatabase db) { - RepositoryUtils.updateNullEventIds(db); + RepositoryUtils.updateNullEventIds(db); + } + + private static void upgradeToVersion9(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); } } \ No newline at end of file diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index 23a4e227ab..c8bbfb6a73 100644 --- a/opensrp-chw/src/lmh/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -47,6 +47,8 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 7: upgradeToVersion7(db); break; + case 8: + upgradeToVersion8(db); default: break; } @@ -146,4 +148,8 @@ private static void upgradeToVersion7(SQLiteDatabase db) { Timber.e(e, "upgradeToVersion7"); } } + + private static void upgradeToVersion8(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } } \ No newline at end of file diff --git a/opensrp-chw/src/main/AndroidManifest.xml b/opensrp-chw/src/main/AndroidManifest.xml index 52dfd8d690..2fbaf7d4c9 100644 --- a/opensrp-chw/src/main/AndroidManifest.xml +++ b/opensrp-chw/src/main/AndroidManifest.xml @@ -127,7 +127,8 @@ android:name=".activity.ChildProfileActivity" android:launchMode="singleTop" android:label="@string/child_details" - android:theme="@style/ChwTheme.NoActionBar"> + android:theme="@style/ChwTheme.NoActionBar" + android:exported="true"> @@ -170,6 +171,7 @@ android:roundIcon="@drawable/ic_launcher_round" android:screenOrientation="portrait" android:theme="@style/ChwTheme.Login" + android:exported="true" android:windowSoftInputMode="stateAlwaysHidden|adjustResize"> @@ -301,6 +303,15 @@ + + + + + + + + diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/util/RepositoryUtils.java b/opensrp-chw/src/main/java/org/smartregister/chw/util/RepositoryUtils.java index abcb2e487f..81f36fa2d7 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/util/RepositoryUtils.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/util/RepositoryUtils.java @@ -26,6 +26,8 @@ public interface RepositoryUtils { String EVENT_ID = "id"; String _ID = "_id"; + String VALIDATION_STATUS = "validationStatus"; + String STATUS_INVALID = "Invalid"; String ADD_MISSING_REPORTING_COLUMN = "ALTER TABLE 'indicator_queries' ADD COLUMN expected_indicators TEXT NULL;"; String FAMILY_MEMBER_ADD_REASON_FOR_REGISTRATION = "ALTER TABLE 'ec_family_member' ADD COLUMN reasons_for_registration TEXT NULL;"; @@ -132,4 +134,9 @@ static String getEventId(String jsonString) { return eventId; } + static void updateClientValidateStatus (SQLiteDatabase db) + { + db.execSQL(String.format("UPDATE client Set %s = '%s'",VALIDATION_STATUS,STATUS_INVALID)); + } + } diff --git a/opensrp-chw/src/test/java/org/smartregister/chw/repository/ChwRepositoryFlvTest.java b/opensrp-chw/src/test/java/org/smartregister/chw/repository/ChwRepositoryFlvTest.java new file mode 100644 index 0000000000..57e14539b0 --- /dev/null +++ b/opensrp-chw/src/test/java/org/smartregister/chw/repository/ChwRepositoryFlvTest.java @@ -0,0 +1,28 @@ +package org.smartregister.chw.repository; + +import net.sqlcipher.database.SQLiteDatabase; + +import org.junit.Test; +import org.mockito.Mockito; +import org.smartregister.immunization.repository.VaccineRepository; + +import static org.mockito.Mockito.verify; + + +public class ChwRepositoryFlvTest { + + @Test + public void testOnUpgrade() { + SQLiteDatabase db = Mockito.mock(SQLiteDatabase.class); + ChwRepositoryFlv.onUpgrade(null, db, 1, 2); + verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_EVENT_ID_COL); + verify(db).execSQL(VaccineRepository.EVENT_ID_INDEX); + verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_FORMSUBMISSION_ID_COL); + verify(db).execSQL(VaccineRepository.FORMSUBMISSION_INDEX); + verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL); + verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL_INDEX); + verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_HIA2_STATUS_COL); + + + } +} \ No newline at end of file diff --git a/opensrp-chw/src/test/java/org/smartregister/chw/util/AllClientUtilsTest.java b/opensrp-chw/src/test/java/org/smartregister/chw/util/AllClientUtilsTest.java new file mode 100644 index 0000000000..2fa5e9f883 --- /dev/null +++ b/opensrp-chw/src/test/java/org/smartregister/chw/util/AllClientUtilsTest.java @@ -0,0 +1,48 @@ +package org.smartregister.chw.util; + +import android.app.Activity; +import android.os.Bundle; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.Map; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class AllClientUtilsTest { + + @Mock + private Activity mockActivity; + + @Mock + private CommonPersonObjectClient mockPatient; + + @Mock + private Bundle mockBundle; + + @Mock + private Map map; + + + @Before + public void setup (){ + MockitoAnnotations.initMocks(this); + } + + @Test + public void testGoToChildProfileAboveFiveYears() { + String dobString = "15"; + when(mockPatient.getColumnmaps()).thenReturn(map); + when(map.get(DBConstants.KEY.DOB)).thenReturn(dobString); + AllClientsUtils.goToChildProfile(mockActivity, mockPatient, mockBundle); + verify(mockActivity).startActivity(ArgumentMatchers.any()); + + } +} diff --git a/opensrp-chw/src/test/java/org/smartregister/chw/util/RepositoryUtilsTest.java b/opensrp-chw/src/test/java/org/smartregister/chw/util/RepositoryUtilsTest.java index 598fbb6163..480fc0f7d4 100644 --- a/opensrp-chw/src/test/java/org/smartregister/chw/util/RepositoryUtilsTest.java +++ b/opensrp-chw/src/test/java/org/smartregister/chw/util/RepositoryUtilsTest.java @@ -1,8 +1,11 @@ package org.smartregister.chw.util; +import net.sqlcipher.Cursor; import net.sqlcipher.MatrixCursor; import net.sqlcipher.database.SQLiteDatabase; +import org.json.JSONException; +import org.json.JSONObject; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,7 +16,18 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.smartregister.chw.application.ChwApplication; +import org.smartregister.domain.Event; import org.smartregister.repository.EventClientRepository; +import org.smartregister.sync.helper.ECSyncHelper; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @RunWith(RobolectricTestRunner.class) @Config(application = ChwApplication.class, sdk = 22) @@ -22,6 +36,13 @@ public class RepositoryUtilsTest { @Mock private SQLiteDatabase database; + @Mock + private Cursor cursor; + + @Mock + private ECSyncHelper ecSyncHelper; + + @Before public void setUp() { MockitoAnnotations.initMocks(this); @@ -35,7 +56,7 @@ public void updateNullEventIdsUpdatesCorrectEvents() { ArgumentMatchers.any(String[].class), ArgumentMatchers.eq("eventId IS NULL AND validationStatus = ?"), ArgumentMatchers.any(String[].class), ArgumentMatchers.isNull(), ArgumentMatchers.isNull(), ArgumentMatchers.isNull()); RepositoryUtils.updateNullEventIds(database); - Mockito.verify(database).execSQL("UPDATE event SET eventId = '3b598b80-13ee-4a9a-8cd1-8e66fa76bbe9', " + + verify(database).execSQL("UPDATE event SET eventId = '3b598b80-13ee-4a9a-8cd1-8e66fa76bbe9', " + "syncStatus = 'Synced' WHERE formSubmissionId = '45a294f5-ec2f-4233-847a-6f7910a6e63f';"); } @@ -131,4 +152,41 @@ private static String getSampleEventJSONString() { "}"; } + @Test + public void testReadEvents() throws JSONException { + List expectedEvents = new ArrayList<>(); + Event event1 = new Event(); + event1.setEventId("event1"); + event1.setBaseEntityId("158cb2d0-a78f-4087-9ccc-0a0de9724548"); + expectedEvents.add(event1); + when(cursor.getCount()).thenReturn(1); + when(cursor.moveToFirst()).thenReturn(true); + when(cursor.isAfterLast()).thenReturn(false, false, true); + when(cursor.getString(cursor.getColumnIndex("json"))).thenReturn(getSampleEventJSONString(), getSampleEventJSONString()); + when(ecSyncHelper.convert(new JSONObject(getSampleEventJSONString()), Event.class)).thenReturn(event1); + + List actualEvents = RepositoryUtils.readEvents(cursor); + + assertEquals(expectedEvents.get(0).getBaseEntityId(), actualEvents.get(0).getBaseEntityId()); + } + + + @Test + public void addDetailsColumnToFamilySearchTableShouldAddColumnsSuccessfully() { + // When + RepositoryUtils.addDetailsColumnToFamilySearchTable(database); + + // Then + verify(database, times(1)).execSQL("ALTER TABLE ec_family ADD COLUMN entity_type VARCHAR; " + + "UPDATE ec_family SET entity_type = 'ec_family' WHERE id is not null;"); + verify(database, times(5)).execSQL(anyString()); + } + + @Test + public void updateClientValidationStatusTest() + { + RepositoryUtils.updateClientValidateStatus(database); + verify(database, times(1)).execSQL(anyString()); + } + } diff --git a/opensrp-chw/src/togo/java/org/smartregister/chw/repository/ChwRepositoryFlv.java b/opensrp-chw/src/togo/java/org/smartregister/chw/repository/ChwRepositoryFlv.java index e7fbba4475..1bc1128373 100644 --- a/opensrp-chw/src/togo/java/org/smartregister/chw/repository/ChwRepositoryFlv.java +++ b/opensrp-chw/src/togo/java/org/smartregister/chw/repository/ChwRepositoryFlv.java @@ -109,6 +109,9 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, case 21: upgradeToVersion21(db); break; + case 22: + upgradeToVersion22(db); + break; default: break; } @@ -424,4 +427,8 @@ private static void upgradeToVersion20(SQLiteDatabase db) { private static void upgradeToVersion21(SQLiteDatabase db) { RepositoryUtils.updateNullEventIds(db); } + + private static void upgradeToVersion22(SQLiteDatabase db) { + RepositoryUtils.updateClientValidateStatus(db); + } }