diff options
author | 2009-09-30 16:17:37 -0700 | |
---|---|---|
committer | 2009-09-30 17:07:37 -0700 | |
commit | 436344ae12c819f58306ceb94241a266141e1218 (patch) | |
tree | 32688c8fbc1d40fe88ef86d034052f9608176d14 | |
parent | 7e1af37c3148112d9c801272bfa6359a005baf6d (diff) |
Turn off most of the backup-related debug logging
The core logging in BackupManagerService and in the Google backup transport are
still enabled at this point.
Change-Id: I10abfa565bbd1097dd3631051b6aca163e4af33a
8 files changed, 15 insertions, 14 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index d6f024b65139..fc00a4c324d7 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -122,7 +122,7 @@ public final class ActivityThread { private static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV; private static final boolean DEBUG_BROADCAST = false; private static final boolean DEBUG_RESULTS = false; - private static final boolean DEBUG_BACKUP = true; + private static final boolean DEBUG_BACKUP = false; private static final boolean DEBUG_CONFIGURATION = false; private static final long MIN_TIME_BETWEEN_GCS = 5*1000; private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";"); diff --git a/core/java/android/app/BackupAgent.java b/core/java/android/app/BackupAgent.java index 0ac8a1e4cfdc..b20799840946 100644 --- a/core/java/android/app/BackupAgent.java +++ b/core/java/android/app/BackupAgent.java @@ -36,6 +36,7 @@ import java.io.IOException; */ public abstract class BackupAgent extends ContextWrapper { private static final String TAG = "BackupAgent"; + private static final boolean DEBUG = false; public BackupAgent() { super(null); @@ -116,7 +117,7 @@ public abstract class BackupAgent extends ContextWrapper { ParcelFileDescriptor data, ParcelFileDescriptor newState) throws RemoteException { // !!! TODO - real implementation; for now just invoke the callbacks directly - Log.v(TAG, "doBackup() invoked"); + if (DEBUG) Log.v(TAG, "doBackup() invoked"); BackupDataOutput output = new BackupDataOutput(data.getFileDescriptor()); try { BackupAgent.this.onBackup(oldState, output, newState); @@ -132,7 +133,7 @@ public abstract class BackupAgent extends ContextWrapper { public void doRestore(ParcelFileDescriptor data, int appVersionCode, ParcelFileDescriptor newState) throws RemoteException { // !!! TODO - real implementation; for now just invoke the callbacks directly - Log.v(TAG, "doRestore() invoked"); + if (DEBUG) Log.v(TAG, "doRestore() invoked"); BackupDataInput input = new BackupDataInput(data.getFileDescriptor()); try { BackupAgent.this.onRestore(input, appVersionCode, newState); diff --git a/core/java/android/backup/AbsoluteFileBackupHelper.java b/core/java/android/backup/AbsoluteFileBackupHelper.java index ab246754b5af..1dbccc9c47af 100644 --- a/core/java/android/backup/AbsoluteFileBackupHelper.java +++ b/core/java/android/backup/AbsoluteFileBackupHelper.java @@ -31,6 +31,7 @@ import java.io.FileDescriptor; */ public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelper { private static final String TAG = "AbsoluteFileBackupHelper"; + private static final boolean DEBUG = false; Context mContext; String[] mFiles; @@ -54,8 +55,7 @@ public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements Ba } public void restoreEntity(BackupDataInputStream data) { - // TODO: turn this off before ship - Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size()); + if (DEBUG) Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size()); String key = data.getKey(); if (isKeyInList(key, mFiles)) { File f = new File(key); diff --git a/core/java/android/backup/FileBackupHelper.java b/core/java/android/backup/FileBackupHelper.java index 405849705ff7..dacfc8f557dc 100644 --- a/core/java/android/backup/FileBackupHelper.java +++ b/core/java/android/backup/FileBackupHelper.java @@ -26,6 +26,7 @@ import java.io.FileDescriptor; /** @hide */ public class FileBackupHelper extends FileBackupHelperBase implements BackupHelper { private static final String TAG = "FileBackupHelper"; + private static final boolean DEBUG = false; Context mContext; File mFilesDir; @@ -60,8 +61,7 @@ public class FileBackupHelper extends FileBackupHelperBase implements BackupHelp } public void restoreEntity(BackupDataInputStream data) { - // TODO: turn this off before ship - Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size()); + if (DEBUG) Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size()); String key = data.getKey(); if (isKeyInList(key, mFiles)) { File f = new File(mFilesDir, key); diff --git a/core/java/android/backup/SharedPreferencesBackupHelper.java b/core/java/android/backup/SharedPreferencesBackupHelper.java index 4a7b399a5bde..6a0bc9653409 100644 --- a/core/java/android/backup/SharedPreferencesBackupHelper.java +++ b/core/java/android/backup/SharedPreferencesBackupHelper.java @@ -26,6 +26,7 @@ import java.io.FileDescriptor; /** @hide */ public class SharedPreferencesBackupHelper extends FileBackupHelperBase implements BackupHelper { private static final String TAG = "SharedPreferencesBackupHelper"; + private static final boolean DEBUG = false; private Context mContext; private String[] mPrefGroups; @@ -56,9 +57,9 @@ public class SharedPreferencesBackupHelper extends FileBackupHelperBase implemen public void restoreEntity(BackupDataInputStream data) { Context context = mContext; - // TODO: turn this off before ship - Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size()); String key = data.getKey(); + if (DEBUG) Log.d(TAG, "got entity '" + key + "' size=" + data.size()); + if (isKeyInList(key, mPrefGroups)) { File f = context.getSharedPrefsFile(key).getAbsoluteFile(); writeFile(f, data); diff --git a/libs/utils/BackupData.cpp b/libs/utils/BackupData.cpp index 2535094a89d7..adb3174990a4 100644 --- a/libs/utils/BackupData.cpp +++ b/libs/utils/BackupData.cpp @@ -107,7 +107,7 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize) } else { k = key; } - if (true) { + if (false) { LOGD("Writing entity: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), key.string(), dataSize); } diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java index fb5e4e6f2c21..bb9206cf1b50 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -51,7 +51,7 @@ import android.util.Log; */ public class SettingsBackupAgent extends BackupHelperAgent { // STOPSHIP: set DEBUG to false - private static final boolean DEBUG = true; + private static final boolean DEBUG = false; private static final String KEY_SYSTEM = "system"; private static final String KEY_SECURE = "secure"; diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index a7deed615bd6..c62444de6d51 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -140,7 +140,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen static final boolean DEBUG_PROVIDER = localLOGV || false; static final boolean DEBUG_USER_LEAVING = localLOGV || false; static final boolean DEBUG_RESULTS = localLOGV || false; - static final boolean DEBUG_BACKUP = localLOGV || true; + static final boolean DEBUG_BACKUP = localLOGV || false; static final boolean DEBUG_CONFIGURATION = localLOGV || false; static final boolean VALIDATE_TOKENS = false; static final boolean SHOW_ACTIVITY_START_TIME = true; @@ -11374,8 +11374,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen try { proc.thread.scheduleCreateBackupAgent(app, backupMode); } catch (RemoteException e) { - // !!! TODO: notify the backup manager that we crashed, or rely on - // death notices, or...? + // Will time out on the backup manager side } } else { if (DEBUG_BACKUP) Log.v(TAG, "Agent proc not running, waiting for attach"); |