зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1411654 - Pre: Remove unused PerProfileDatabaseProvider. r=mcomella
No idea what is going on with this hierarchy, but this isn't used and isn't helping anything. MozReview-Commit-ID: Ir3LxLYHR6M --HG-- extra : rebase_source : c883a3fa60d1a47b19b53f2bbc7a9c2f0e2cf711
This commit is contained in:
Родитель
39c11c49d5
Коммит
95a99b4b2a
|
@ -51,7 +51,6 @@
|
|||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/dlc/DownloadContentTelemetry.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/preferences/LocaleListPreference.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/media/MediaControlService.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/db/PerProfileDatabaseProvider.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/PrintHelper.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/animation/PropertyAnimator.java"/>
|
||||
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/RemotePresentationService.java"/>
|
||||
|
|
|
@ -42,8 +42,6 @@ import java.util.Arrays;
|
|||
*
|
||||
* * {@link AbstractPerProfileDatabaseProvider} provides a simple abstraction for
|
||||
* querying databases that are stored in the user's profile directory.
|
||||
* * {@link PerProfileDatabaseProvider} is a simple version that only allows a
|
||||
* single ContentProvider to access each per-profile database.
|
||||
* * {@link SharedBrowserDatabaseProvider} is an example of a per-profile provider
|
||||
* that allows for multiple providers to safely work with the same databases.
|
||||
*/
|
||||
|
@ -134,7 +132,7 @@ public abstract class AbstractTransactionalProvider extends ContentProvider {
|
|||
* If we're not in a batch, but we are in a write transaction,
|
||||
* end it.
|
||||
*
|
||||
* @see PerProfileDatabaseProvider#markWriteSuccessful(SQLiteDatabase)
|
||||
* @see AbstractTransactionalProvider#markWriteSuccessful(SQLiteDatabase)
|
||||
*/
|
||||
protected void endWrite(final SQLiteDatabase db) {
|
||||
if (isInBatch()) {
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.gecko.db;
|
||||
|
||||
import org.mozilla.gecko.AppConstants.Versions;
|
||||
import org.mozilla.gecko.db.PerProfileDatabases.DatabaseHelperFactory;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
/**
|
||||
* Abstract class containing methods needed to make a SQLite-based content
|
||||
* provider with a database helper of type T, where one database helper is
|
||||
* held per profile.
|
||||
*/
|
||||
public abstract class PerProfileDatabaseProvider<T extends SQLiteOpenHelper> extends AbstractPerProfileDatabaseProvider {
|
||||
private PerProfileDatabases<T> databases;
|
||||
|
||||
@Override
|
||||
protected PerProfileDatabases<T> getDatabases() {
|
||||
return databases;
|
||||
}
|
||||
|
||||
protected abstract String getDatabaseName();
|
||||
|
||||
/**
|
||||
* Creates and returns an instance of the appropriate DB helper.
|
||||
*
|
||||
* @param context to use to create the database helper
|
||||
* @param databasePath path to the DB file
|
||||
* @return instance of the database helper
|
||||
*/
|
||||
protected abstract T createDatabaseHelper(Context context, String databasePath);
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
synchronized (this) {
|
||||
databases = new PerProfileDatabases<T>(
|
||||
getContext(), getDatabaseName(), new DatabaseHelperFactory<T>() {
|
||||
@Override
|
||||
public T makeDatabaseHelper(Context context, String databasePath) {
|
||||
final T helper = createDatabaseHelper(context, databasePath);
|
||||
if (Versions.feature16Plus) {
|
||||
helper.setWriteAheadLoggingEnabled(true);
|
||||
}
|
||||
return helper;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -565,7 +565,6 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [
|
|||
'db/LocalURLMetadata.java',
|
||||
'db/LoginsProvider.java',
|
||||
'db/PasswordsProvider.java',
|
||||
'db/PerProfileDatabaseProvider.java',
|
||||
'db/PerProfileDatabases.java',
|
||||
'db/RemoteClient.java',
|
||||
'db/RemoteTab.java',
|
||||
|
|
Загрузка…
Ссылка в новой задаче