fix DatabaseIndexingManagerTest hanging in tests
Test: make RunSettingsRoboTests -j40 Change-Id: I755c04daadcb8804d97f72521d84573d80b4ff19
This commit is contained in:
@@ -293,7 +293,8 @@ public class IndexDatabaseHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
static void setBuildIndexed(Context context, String buildNo) {
|
||||
context.getSharedPreferences(SHARED_PREFS_TAG, 0).edit().putBoolean(buildNo, true).commit();
|
||||
// Use #apply() instead of #commit() since #commit() Robolectric loop indefinitely in sdk 26
|
||||
context.getSharedPreferences(SHARED_PREFS_TAG, 0).edit().putBoolean(buildNo, true).apply();
|
||||
}
|
||||
|
||||
private void dropTables(SQLiteDatabase db) {
|
||||
|
@@ -70,7 +70,7 @@ import java.util.Set;
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(
|
||||
manifest = TestConfig.MANIFEST_PATH,
|
||||
sdk = TestConfig.SDK_VERSION,
|
||||
sdk = TestConfig.SDK_VERSION_O,
|
||||
shadows = {
|
||||
ShadowRunnableAsyncTask.class,
|
||||
}
|
||||
|
Reference in New Issue
Block a user