Bug 856163 - Part 4: Use gecko package for database classes. r=lucasr f=rnewman

--HG--
rename : mobile/android/base/db/BrowserContract.java.in => mobile/android/base/db/BrowserContract.java
rename : mobile/android/base/db/BrowserProvider.java.in => mobile/android/base/db/BrowserProvider.java
rename : mobile/android/base/db/FormHistoryProvider.java.in => mobile/android/base/db/FormHistoryProvider.java
rename : mobile/android/base/db/GeckoProvider.java.in => mobile/android/base/db/GeckoProvider.java
rename : mobile/android/base/db/PasswordsProvider.java.in => mobile/android/base/db/PasswordsProvider.java
rename : mobile/android/base/db/TabsProvider.java.in => mobile/android/base/db/TabsProvider.java
This commit is contained in:
Brian Nicholson 2013-04-09 17:10:48 -07:00
parent 6b250b918a
commit e3dad06d73
12 changed files with 28 additions and 34 deletions

View File

@ -229,7 +229,7 @@
android:configChanges="orientation|screenSize"
android:excludeFromRecents="true"/>
<provider android:name="@ANDROID_PACKAGE_NAME@.db.BrowserProvider"
<provider android:name="org.mozilla.gecko.db.BrowserProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.browser"
android:permission="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER">
@ -244,17 +244,17 @@
Fennec versions into the same process. (Bug 749727.)
Process name is a mangled version to avoid a Talos bug. (Bug 750548.)
-->
<provider android:name="@ANDROID_PACKAGE_NAME@.db.PasswordsProvider"
<provider android:name="org.mozilla.gecko.db.PasswordsProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords"
android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"
android:process="@MANGLED_ANDROID_PACKAGE_NAME@.PasswordsProvider"/>
<provider android:name="@ANDROID_PACKAGE_NAME@.db.FormHistoryProvider"
<provider android:name="org.mozilla.gecko.db.FormHistoryProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory"
android:permission="@ANDROID_PACKAGE_NAME@.permissions.FORMHISTORY_PROVIDER"
android:protectionLevel="signature"/>
<provider android:name="@ANDROID_PACKAGE_NAME@.db.TabsProvider"
<provider android:name="org.mozilla.gecko.db.TabsProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.tabs"
android:permission="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER"/>

View File

@ -163,6 +163,12 @@ FENNEC_JAVA_FILES = \
VideoPlayer.java \
WebAppAllocator.java \
ZoomConstraints.java \
db/BrowserContract.java \
db/BrowserProvider.java \
db/FormHistoryProvider.java \
db/GeckoProvider.java \
db/PasswordsProvider.java \
db/TabsProvider.java \
gfx/Axis.java \
gfx/BitmapUtils.java \
gfx/BufferedCairoImage.java \
@ -252,15 +258,9 @@ FENNEC_PP_JAVA_VIEW_FILES = \
FENNEC_PP_JAVA_FILES = \
App.java \
AppConstants.java \
WebApp.java \
WebApps.java \
db/BrowserContract.java \
db/BrowserProvider.java \
db/PasswordsProvider.java \
db/FormHistoryProvider.java \
db/TabsProvider.java \
db/GeckoProvider.java \
AppConstants.java \
$(NULL)
FENNEC_PP_XML_FILES = \

View File

@ -3,7 +3,6 @@
* 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/. */
#filter substitution
package org.mozilla.gecko.db;
import org.mozilla.gecko.AppConstants;
@ -244,7 +243,7 @@ public class BrowserContract {
// Title of the tab.
public static final String TITLE = "title";
// Topmost URL from the history array. Allows processing of this tab without
// parsing that array.
public static final String URL = "url";
@ -280,7 +279,7 @@ public class BrowserContract {
// Sync-assigned GUID for client device. NULL for local tabs.
public static final String GUID = "guid";
// Last modified time for the client's tab record. For remote records, a server
// Last modified time for the client's tab record. For remote records, a server
// timestamp provided by Sync during insertion.
public static final String LAST_MODIFIED = "last_modified";
}

View File

@ -3,8 +3,7 @@
* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@.db;
package org.mozilla.gecko.db;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -618,7 +617,7 @@ public class BrowserProvider extends ContentProvider {
qualifyColumn(TABLE_BOOKMARKS, Bookmarks.IS_DELETED) + " = 0 AND " +
qualifyColumn(TABLE_BOOKMARKS, Bookmarks.URL) +
" NOT IN (SELECT " + History.URL + " FROM " + TABLE_HISTORY + ")" +
" UNION ALL" +
" UNION ALL" +
// History with and without bookmark.
" SELECT " + qualifyColumn(TABLE_BOOKMARKS, Bookmarks._ID) + " AS " + Combined.BOOKMARK_ID + ", " +
qualifyColumn(TABLE_HISTORY, History.URL) + " AS " + Combined.URL + ", " +
@ -1028,7 +1027,7 @@ public class BrowserProvider extends ContentProvider {
if (bookmark.has("pinned")) {
try {
// Create a fake bookmark in the hidden pinned folder to pin bookmark
// to about:home top sites. Pass pos as the pinned position to pin
// to about:home top sites. Pass pos as the pinned position to pin
// sites in the order that bookmarks are specified in bookmarks.json.
if (bookmark.getBoolean("pinned")) {
createBookmark(db, title, url, pos, Bookmarks.FIXED_PINNED_LIST_ID);
@ -1980,7 +1979,7 @@ public class BrowserProvider extends ContentProvider {
/**
* Remove any thumbnails that for sites that aren't likely to be ever shown.
* Items will be removed according to a frecency calculation and only if they are not pinned
*
*
* Call this method within a transaction.
*/
private void expireThumbnails(final SQLiteDatabase db) {
@ -3172,7 +3171,7 @@ public class BrowserProvider extends ContentProvider {
+ " WHERE " + Bookmarks.IS_DELETED + " = 0"
+ " AND " + Bookmarks.URL + " IS NOT NULL)";
return deleteFavicons(uri, faviconSelection, null) +
return deleteFavicons(uri, faviconSelection, null) +
deleteThumbnails(uri, thumbnailSelection, null);
}

View File

@ -2,8 +2,7 @@
* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@.db;
package org.mozilla.gecko.db;
import java.lang.IllegalArgumentException;
import java.util.HashMap;

View File

@ -2,8 +2,7 @@
* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@.db;
package org.mozilla.gecko.db;
import java.io.File;
import java.util.HashMap;
@ -236,7 +235,7 @@ public abstract class GeckoProvider extends ContentProvider {
if (useTransaction) {
db.beginTransaction();
}
// onPreInsert does a check for the item in the deleted table in some cases
// so we put it inside this transaction
onPreInsert(values, uri, db);

View File

@ -2,8 +2,7 @@
* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@.db;
package org.mozilla.gecko.db;
import java.lang.IllegalArgumentException;
import java.util.HashMap;

View File

@ -2,8 +2,7 @@
* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@.db;
package org.mozilla.gecko.db;
import java.io.File;
import java.util.Collections;
@ -358,7 +357,7 @@ public class TabsProvider extends ContentProvider {
} else {
deleted = deleteInTransaction(uri, selection, selectionArgs);
}
if (deleted > 0)
getContext().getContentResolver().notifyChange(uri, null);

View File

@ -324,7 +324,7 @@ public class testBrowserProvider extends ContentProviderTest {
@Override
public void setUp() throws Exception {
super.setUp("@ANDROID_PACKAGE_NAME@.db.BrowserProvider", "AUTHORITY");
super.setUp("org.mozilla.gecko.db.BrowserProvider", "AUTHORITY");
loadContractInfo();
mTests.add(new TestSpecialFolders());

View File

@ -250,7 +250,7 @@ public class testBrowserProviderPerf extends ContentProviderTest {
@Override
public void setUp() throws Exception {
super.setUp("@ANDROID_PACKAGE_NAME@.db.BrowserProvider", "AUTHORITY");
super.setUp("org.mozilla.gecko.db.BrowserProvider", "AUTHORITY");
mGenerator = new Random(19580427);

View File

@ -288,7 +288,7 @@ public class testDistribution extends ContentProviderTest {
@Override
public void setUp() throws Exception {
// TODO: Set up the content provider after setting the distribution.
super.setUp("@ANDROID_PACKAGE_NAME@.db.BrowserProvider", "AUTHORITY");
super.setUp("org.mozilla.gecko.db.BrowserProvider", "AUTHORITY");
}
private void delete(File file) throws Exception {

View File

@ -332,7 +332,7 @@ public class testMigration extends ContentProviderTest {
@Override
public void setUp() throws Exception {
super.setUp("@ANDROID_PACKAGE_NAME@.db.BrowserProvider", "AUTHORITY");
super.setUp("org.mozilla.gecko.db.BrowserProvider", "AUTHORITY");
}
@Override