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
This commit is contained in:
Christopher Tate
2009-09-30 16:17:37 -07:00
parent 7e1af37c31
commit 436344ae12
8 changed files with 15 additions and 14 deletions

View File

@@ -122,7 +122,7 @@ public final class ActivityThread {
private static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV; private static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV;
private static final boolean DEBUG_BROADCAST = false; private static final boolean DEBUG_BROADCAST = false;
private static final boolean DEBUG_RESULTS = 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 boolean DEBUG_CONFIGURATION = false;
private static final long MIN_TIME_BETWEEN_GCS = 5*1000; private static final long MIN_TIME_BETWEEN_GCS = 5*1000;
private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";"); private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";");

View File

@@ -36,6 +36,7 @@ import java.io.IOException;
*/ */
public abstract class BackupAgent extends ContextWrapper { public abstract class BackupAgent extends ContextWrapper {
private static final String TAG = "BackupAgent"; private static final String TAG = "BackupAgent";
private static final boolean DEBUG = false;
public BackupAgent() { public BackupAgent() {
super(null); super(null);
@@ -116,7 +117,7 @@ public abstract class BackupAgent extends ContextWrapper {
ParcelFileDescriptor data, ParcelFileDescriptor data,
ParcelFileDescriptor newState) throws RemoteException { ParcelFileDescriptor newState) throws RemoteException {
// !!! TODO - real implementation; for now just invoke the callbacks directly // !!! 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()); BackupDataOutput output = new BackupDataOutput(data.getFileDescriptor());
try { try {
BackupAgent.this.onBackup(oldState, output, newState); BackupAgent.this.onBackup(oldState, output, newState);
@@ -132,7 +133,7 @@ public abstract class BackupAgent extends ContextWrapper {
public void doRestore(ParcelFileDescriptor data, int appVersionCode, public void doRestore(ParcelFileDescriptor data, int appVersionCode,
ParcelFileDescriptor newState) throws RemoteException { ParcelFileDescriptor newState) throws RemoteException {
// !!! TODO - real implementation; for now just invoke the callbacks directly // !!! 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()); BackupDataInput input = new BackupDataInput(data.getFileDescriptor());
try { try {
BackupAgent.this.onRestore(input, appVersionCode, newState); BackupAgent.this.onRestore(input, appVersionCode, newState);

View File

@@ -31,6 +31,7 @@ import java.io.FileDescriptor;
*/ */
public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelper { public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelper {
private static final String TAG = "AbsoluteFileBackupHelper"; private static final String TAG = "AbsoluteFileBackupHelper";
private static final boolean DEBUG = false;
Context mContext; Context mContext;
String[] mFiles; String[] mFiles;
@@ -54,8 +55,7 @@ public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements Ba
} }
public void restoreEntity(BackupDataInputStream data) { public void restoreEntity(BackupDataInputStream data) {
// TODO: turn this off before ship if (DEBUG) Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
String key = data.getKey(); String key = data.getKey();
if (isKeyInList(key, mFiles)) { if (isKeyInList(key, mFiles)) {
File f = new File(key); File f = new File(key);

View File

@@ -26,6 +26,7 @@ import java.io.FileDescriptor;
/** @hide */ /** @hide */
public class FileBackupHelper extends FileBackupHelperBase implements BackupHelper { public class FileBackupHelper extends FileBackupHelperBase implements BackupHelper {
private static final String TAG = "FileBackupHelper"; private static final String TAG = "FileBackupHelper";
private static final boolean DEBUG = false;
Context mContext; Context mContext;
File mFilesDir; File mFilesDir;
@@ -60,8 +61,7 @@ public class FileBackupHelper extends FileBackupHelperBase implements BackupHelp
} }
public void restoreEntity(BackupDataInputStream data) { public void restoreEntity(BackupDataInputStream data) {
// TODO: turn this off before ship if (DEBUG) Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
String key = data.getKey(); String key = data.getKey();
if (isKeyInList(key, mFiles)) { if (isKeyInList(key, mFiles)) {
File f = new File(mFilesDir, key); File f = new File(mFilesDir, key);

View File

@@ -26,6 +26,7 @@ import java.io.FileDescriptor;
/** @hide */ /** @hide */
public class SharedPreferencesBackupHelper extends FileBackupHelperBase implements BackupHelper { public class SharedPreferencesBackupHelper extends FileBackupHelperBase implements BackupHelper {
private static final String TAG = "SharedPreferencesBackupHelper"; private static final String TAG = "SharedPreferencesBackupHelper";
private static final boolean DEBUG = false;
private Context mContext; private Context mContext;
private String[] mPrefGroups; private String[] mPrefGroups;
@@ -56,9 +57,9 @@ public class SharedPreferencesBackupHelper extends FileBackupHelperBase implemen
public void restoreEntity(BackupDataInputStream data) { public void restoreEntity(BackupDataInputStream data) {
Context context = mContext; Context context = mContext;
// TODO: turn this off before ship
Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
String key = data.getKey(); String key = data.getKey();
if (DEBUG) Log.d(TAG, "got entity '" + key + "' size=" + data.size());
if (isKeyInList(key, mPrefGroups)) { if (isKeyInList(key, mPrefGroups)) {
File f = context.getSharedPrefsFile(key).getAbsoluteFile(); File f = context.getSharedPrefsFile(key).getAbsoluteFile();
writeFile(f, data); writeFile(f, data);

View File

@@ -107,7 +107,7 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize)
} else { } else {
k = key; k = key;
} }
if (true) { if (false) {
LOGD("Writing entity: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), key.string(), LOGD("Writing entity: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), key.string(),
dataSize); dataSize);
} }

View File

@@ -51,7 +51,7 @@ import android.util.Log;
*/ */
public class SettingsBackupAgent extends BackupHelperAgent { public class SettingsBackupAgent extends BackupHelperAgent {
// STOPSHIP: set DEBUG to false // 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_SYSTEM = "system";
private static final String KEY_SECURE = "secure"; private static final String KEY_SECURE = "secure";

View File

@@ -140,7 +140,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
static final boolean DEBUG_PROVIDER = localLOGV || false; static final boolean DEBUG_PROVIDER = localLOGV || false;
static final boolean DEBUG_USER_LEAVING = localLOGV || false; static final boolean DEBUG_USER_LEAVING = localLOGV || false;
static final boolean DEBUG_RESULTS = 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 DEBUG_CONFIGURATION = localLOGV || false;
static final boolean VALIDATE_TOKENS = false; static final boolean VALIDATE_TOKENS = false;
static final boolean SHOW_ACTIVITY_START_TIME = true; static final boolean SHOW_ACTIVITY_START_TIME = true;
@@ -11374,8 +11374,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
try { try {
proc.thread.scheduleCreateBackupAgent(app, backupMode); proc.thread.scheduleCreateBackupAgent(app, backupMode);
} catch (RemoteException e) { } catch (RemoteException e) {
// !!! TODO: notify the backup manager that we crashed, or rely on // Will time out on the backup manager side
// death notices, or...?
} }
} else { } else {
if (DEBUG_BACKUP) Log.v(TAG, "Agent proc not running, waiting for attach"); if (DEBUG_BACKUP) Log.v(TAG, "Agent proc not running, waiting for attach");