Move database package to common module
PiperOrigin-RevId: 396936785
This commit is contained in:
parent
4433ac5a2a
commit
5a2fd983a9
@ -19,12 +19,12 @@ import android.database.sqlite.SQLiteDatabase;
|
|||||||
import android.database.sqlite.SQLiteException;
|
import android.database.sqlite.SQLiteException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides {@link SQLiteDatabase} instances to ExoPlayer components, which may read and write
|
* Provides {@link SQLiteDatabase} instances to media library components, which may read and write
|
||||||
* tables prefixed with {@link #TABLE_PREFIX}.
|
* tables prefixed with {@link #TABLE_PREFIX}.
|
||||||
*/
|
*/
|
||||||
public interface DatabaseProvider {
|
public interface DatabaseProvider {
|
||||||
|
|
||||||
/** Prefix for tables that can be read and written by ExoPlayer components. */
|
/** Prefix for tables that can be read and written by media library components. */
|
||||||
String TABLE_PREFIX = "ExoPlayer";
|
String TABLE_PREFIX = "ExoPlayer";
|
||||||
|
|
||||||
/**
|
/**
|
@ -23,15 +23,16 @@ import android.database.sqlite.SQLiteOpenHelper;
|
|||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link SQLiteOpenHelper} that provides instances of a standalone ExoPlayer database.
|
* An {@link SQLiteOpenHelper} that provides instances of a standalone database.
|
||||||
*
|
*
|
||||||
* <p>Suitable for use by applications that do not already have their own database, or that would
|
* <p>Suitable for use by applications that do not already have their own database, or that would
|
||||||
* prefer to keep ExoPlayer tables isolated in their own database. Other applications should prefer
|
* prefer to keep tables used by media library components isolated in their own database. Other
|
||||||
* to use {@link DefaultDatabaseProvider} with their own {@link SQLiteOpenHelper}.
|
* applications should prefer to use {@link DefaultDatabaseProvider} with their own {@link
|
||||||
|
* SQLiteOpenHelper}.
|
||||||
*/
|
*/
|
||||||
public final class ExoDatabaseProvider extends SQLiteOpenHelper implements DatabaseProvider {
|
public final class ExoDatabaseProvider extends SQLiteOpenHelper implements DatabaseProvider {
|
||||||
|
|
||||||
/** The file name used for the standalone ExoPlayer database. */
|
/** The file name used for the standalone database. */
|
||||||
public static final String DATABASE_NAME = "exoplayer_internal.db";
|
public static final String DATABASE_NAME = "exoplayer_internal.db";
|
||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
@ -26,8 +26,8 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility methods for accessing versions of ExoPlayer database components. This allows them to be
|
* Utility methods for accessing versions of media library database components. This allows them to
|
||||||
* versioned independently to the version of the containing database.
|
* be versioned independently to the version of the containing database.
|
||||||
*/
|
*/
|
||||||
public final class VersionTable {
|
public final class VersionTable {
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user