summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserBackupAgent.java
diff options
context:
space:
mode:
authorChristopher Tate <ctate@android.com>2009-09-29 12:40:25 -0700
committerChristopher Tate <ctate@android.com>2009-09-29 12:40:25 -0700
commitf8b5998e54e80d462e6e56069df748007d209fc2 (patch)
treeb727f191c6405048956297d899e783db0c3d3074 /src/com/android/browser/BrowserBackupAgent.java
parent5d590de2d2d6338de0a516718bec4d390355a0af (diff)
downloadandroid_packages_apps_Gello-f8b5998e54e80d462e6e56069df748007d209fc2.tar.gz
android_packages_apps_Gello-f8b5998e54e80d462e6e56069df748007d209fc2.tar.bz2
android_packages_apps_Gello-f8b5998e54e80d462e6e56069df748007d209fc2.zip
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
Diffstat (limited to 'src/com/android/browser/BrowserBackupAgent.java')
-rw-r--r--src/com/android/browser/BrowserBackupAgent.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/browser/BrowserBackupAgent.java b/src/com/android/browser/BrowserBackupAgent.java
index fe3b7ead..387555d1 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;