From f8b5998e54e80d462e6e56069df748007d209fc2 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Tue, 29 Sep 2009 12:40:25 -0700 Subject: Reduce browser backup agent's amount of logging DEBUG=false now, and so we emit only one-line activity summaries during backup and restore. Change-Id: Iffca70f60581672ce686429db0a4382d934de663 --- src/com/android/browser/BrowserBackupAgent.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/com/android/browser/BrowserBackupAgent.java') diff --git a/src/com/android/browser/BrowserBackupAgent.java b/src/com/android/browser/BrowserBackupAgent.java index fe3b7eadf..387555d18 100644 --- a/src/com/android/browser/BrowserBackupAgent.java +++ b/src/com/android/browser/BrowserBackupAgent.java @@ -46,8 +46,8 @@ import java.util.zip.CRC32; * @hide */ public class BrowserBackupAgent extends BackupAgent { - static final String TAG = "BrowserBookmarkAgent"; - static final boolean DEBUG = true; + static final String TAG = "BrowserBackupAgent"; + static final boolean DEBUG = false; static final String BOOKMARK_KEY = "_bookmarks_"; /** this version num MUST be incremented if the flattened-file schema ever changes */ @@ -147,6 +147,7 @@ public class BrowserBackupAgent extends BackupAgent { // Okay, we have all the bookmarks -- now see if we need to add // them to the browser's database int N = bookmarks.size(); + int nUnique = 0; if (DEBUG) Log.v(TAG, "Restoring " + N + " bookmarks"); String[] urlCol = new String[] { BookmarkColumns.URL }; for (int i = 0; i < N; i++) { @@ -158,16 +159,18 @@ public class BrowserBackupAgent extends BackupAgent { BookmarkColumns.BOOKMARK + " == 1 ", null, null); // if not, insert it if (cursor.getCount() <= 0) { - Log.v(TAG, "Did not see url: " + mark.url); + if (DEBUG) Log.v(TAG, "Did not see url: " + mark.url); // Right now we do not reconstruct the db entry in its // entirety; we just add a new bookmark with the same data Bookmarks.addBookmark(null, getContentResolver(), mark.url, mark.title, null, false); + nUnique++; } else { - Log.v(TAG, "Skipping extant url: " + mark.url); + if (DEBUG) Log.v(TAG, "Skipping extant url: " + mark.url); } cursor.close(); } + Log.i(TAG, "Restored " + nUnique + " of " + N + " bookmarks"); } catch (IOException ioe) { Log.w(TAG, "Bad backup data; not restoring"); crc = -1; -- cgit v1.2.3