diff options
Diffstat (limited to 'src/com/android/providers/contacts/ProfileDatabaseHelper.java')
-rw-r--r-- | src/com/android/providers/contacts/ProfileDatabaseHelper.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/com/android/providers/contacts/ProfileDatabaseHelper.java b/src/com/android/providers/contacts/ProfileDatabaseHelper.java index a23e5217..966ee7e8 100644 --- a/src/com/android/providers/contacts/ProfileDatabaseHelper.java +++ b/src/com/android/providers/contacts/ProfileDatabaseHelper.java @@ -42,18 +42,20 @@ public class ProfileDatabaseHelper extends ContactsDatabaseHelper { * Returns a new instance for unit tests. */ @NeededForTesting - public static ProfileDatabaseHelper getNewInstanceForTest(Context context) { - return new ProfileDatabaseHelper(context, null, false); + public static ProfileDatabaseHelper getNewInstanceForTest(Context context, String filename) { + return new ProfileDatabaseHelper(context, filename, false, /* isTestInstance=*/ true); } private ProfileDatabaseHelper( - Context context, String databaseName, boolean optimizationEnabled) { - super(context, databaseName, optimizationEnabled); + Context context, String databaseName, boolean optimizationEnabled, + boolean isTestInstance) { + super(context, databaseName, optimizationEnabled, isTestInstance); } public static synchronized ProfileDatabaseHelper getInstance(Context context) { if (sSingleton == null) { - sSingleton = new ProfileDatabaseHelper(context, DATABASE_NAME, true); + sSingleton = new ProfileDatabaseHelper(context, DATABASE_NAME, true, + /* isTestInstance=*/ false); } return sSingleton; } @@ -72,4 +74,18 @@ public class ProfileDatabaseHelper extends ContactsDatabaseHelper { db.insert(SEQUENCE_TABLE, null, values); } } + + @Override + protected void postOnCreate() { + } + + @Override + protected void setDatabaseCreationTime(SQLiteDatabase db) { + // We don't need the creation time for the profile DB. + } + + @Override + protected void loadDatabaseCreationTime(SQLiteDatabase db) { + // We don't need the creation time for the profile DB. + } } |