Bug 826539 - Pinned tabs folder shouldn't be synced. r=nalexander

This commit is contained in:
Richard Newman 2013-01-03 21:25:38 -08:00
parent 56e31c2bb4
commit b6af78d1ce

View File

@ -192,12 +192,33 @@ public class AndroidBrowserBookmarksRepositorySession extends AndroidBrowserRepo
/**
* Return true if the provided record GUID should be skipped
* in child lists or fetch results.
*
* @param recordGUID the GUID of the record to check.
* @return true if the record should be skipped.
*/
public static boolean forbiddenGUID(String recordGUID) {
public static boolean forbiddenGUID(final String recordGUID) {
return recordGUID == null ||
"readinglist".equals(recordGUID) || // Temporary: Bug 762118
"places".equals(recordGUID) ||
"tags".equals(recordGUID);
// Temporarily exclude reading list items (Bug 762118; re-enable in Bug 762109.)
BrowserContract.Bookmarks.READING_LIST_FOLDER_GUID.equals(recordGUID) ||
BrowserContract.Bookmarks.PINNED_FOLDER_GUID.equals(recordGUID) ||
BrowserContract.Bookmarks.PLACES_FOLDER_GUID.equals(recordGUID) ||
BrowserContract.Bookmarks.TAGS_FOLDER_GUID.equals(recordGUID);
}
/**
* Return true if the provided parent GUID's children should
* be skipped in child lists or fetch results.
* This differs from {@link #forbiddenGUID(String)} in that we're skipping
* part of the hierarchy.
*
* @param parentGUID the GUID of parent of the record to check.
* @return true if the record should be skipped.
*/
public static boolean forbiddenParent(final String parentGUID) {
return parentGUID == null ||
// Temporarily exclude reading list items (Bug 762118; re-enable in Bug 762109.)
BrowserContract.Bookmarks.READING_LIST_FOLDER_GUID.equals(parentGUID) ||
BrowserContract.Bookmarks.PINNED_FOLDER_GUID.equals(parentGUID);
}
public AndroidBrowserBookmarksRepositorySession(Repository repository, Context context) {
@ -508,6 +529,7 @@ public class AndroidBrowserBookmarksRepositorySession extends AndroidBrowserRepo
if (record.deleted) {
return false;
}
BookmarkRecord bmk = (BookmarkRecord) record;
if (forbiddenGUID(bmk.guid)) {
@ -515,8 +537,8 @@ public class AndroidBrowserBookmarksRepositorySession extends AndroidBrowserRepo
return true;
}
if ("readinglist".equals(bmk.parentID)) { // Temporary: Bug 762118
Logger.debug(LOG_TAG, "Ignoring reading list item with guid: " + bmk.guid);
if (forbiddenParent(bmk.parentID)) {
Logger.debug(LOG_TAG, "Ignoring child " + bmk.guid + " of forbidden parent folder " + bmk.parentID);
return true;
}