1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Move database code into correct package

This commit is contained in:
Jan Berkel 2014-12-11 23:56:02 +00:00
parent ba4dd24bd5
commit 12291bceb5
6 changed files with 14 additions and 15 deletions

View File

@ -6,8 +6,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -56,8 +54,8 @@ import com.fsck.k9.mail.internet.TextBody;
import com.fsck.k9.mail.internet.MimeUtility.ViewableContainer; import com.fsck.k9.mail.internet.MimeUtility.ViewableContainer;
import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.mail.store.StorageManager;
import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.mail.store.UnavailableStorageException;
import com.fsck.k9.mail.store.LockableDatabase.DbCallback; import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback;
import com.fsck.k9.mail.store.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException;
import com.fsck.k9.provider.AttachmentProvider; import com.fsck.k9.provider.AttachmentProvider;
public class LocalFolder extends Folder implements Serializable { public class LocalFolder extends Folder implements Serializable {

View File

@ -21,8 +21,8 @@ import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MimeMessage; import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.mail.store.UnavailableStorageException;
import com.fsck.k9.mail.store.LockableDatabase.DbCallback; import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback;
import com.fsck.k9.mail.store.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException;
public class LocalMessage extends MimeMessage { public class LocalMessage extends MimeMessage {

View File

@ -32,9 +32,8 @@ import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store; import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.LockableDatabase; import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback;
import com.fsck.k9.mail.store.LockableDatabase.DbCallback; import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException;
import com.fsck.k9.mail.store.LockableDatabase.WrappedException;
import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.mail.store.StorageManager;
import com.fsck.k9.mail.store.StorageManager.StorageProvider; import com.fsck.k9.mail.store.StorageManager.StorageProvider;
import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.mail.store.UnavailableStorageException;
@ -724,6 +723,7 @@ public class LocalStore extends Store implements Serializable {
return Utility.combine(extraFlags, ',').toUpperCase(Locale.US); return Utility.combine(extraFlags, ',').toUpperCase(Locale.US);
} }
// TODO: database should not be exposed!
public LockableDatabase getDatabase() { public LockableDatabase getDatabase() {
return database; return database;
} }

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.store; package com.fsck.k9.mail.store.local;
import java.io.File; import java.io.File;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
@ -16,6 +16,8 @@ import android.util.Log;
import com.fsck.k9.K9; import com.fsck.k9.K9;
import com.fsck.k9.helper.FileHelper; import com.fsck.k9.helper.FileHelper;
import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.store.StorageManager;
import com.fsck.k9.mail.store.UnavailableStorageException;
public class LockableDatabase { public class LockableDatabase {
@ -33,7 +35,7 @@ public class LockableDatabase {
* <code>null</code>. * <code>null</code>.
* @return Any relevant data. Can be <code>null</code>. * @return Any relevant data. Can be <code>null</code>.
* @throws WrappedException * @throws WrappedException
* @throws UnavailableStorageException * @throws com.fsck.k9.mail.store.UnavailableStorageException
*/ */
T doDbWork(SQLiteDatabase db) throws WrappedException, UnavailableStorageException; T doDbWork(SQLiteDatabase db) throws WrappedException, UnavailableStorageException;
} }

View File

@ -18,7 +18,6 @@ import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message; import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.store.LockableDatabase;
import com.fsck.k9.provider.AttachmentProvider; import com.fsck.k9.provider.AttachmentProvider;
class StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { class StoreSchemaDefinition implements LockableDatabase.SchemaDefinition {

View File

@ -10,9 +10,9 @@ import com.fsck.k9.Preferences;
import com.fsck.k9.cache.EmailProviderCacheCursor; import com.fsck.k9.cache.EmailProviderCacheCursor;
import com.fsck.k9.helper.Utility; import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.store.LockableDatabase; import com.fsck.k9.mail.store.local.LockableDatabase;
import com.fsck.k9.mail.store.LockableDatabase.DbCallback; import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback;
import com.fsck.k9.mail.store.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException;
import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.mail.store.UnavailableStorageException;
import com.fsck.k9.mail.store.local.LocalStore; import com.fsck.k9.mail.store.local.LocalStore;
import com.fsck.k9.search.SqlQueryBuilder; import com.fsck.k9.search.SqlQueryBuilder;