diff options
Diffstat (limited to 'core/java/android/backup')
6 files changed, 14 insertions, 13 deletions
diff --git a/core/java/android/backup/AbsoluteFileBackupHelper.java b/core/java/android/backup/AbsoluteFileBackupHelper.java index ab24675..1dbccc9 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/BackupDataInput.java b/core/java/android/backup/BackupDataInput.java index 69c206c..e67b0be 100644 --- a/core/java/android/backup/BackupDataInput.java +++ b/core/java/android/backup/BackupDataInput.java @@ -97,12 +97,7 @@ public class BackupDataInput { public void skipEntityData() throws IOException { if (mHeaderReady) { - int result = skipEntityData_native(mBackupReader); - if (result >= 0) { - return; - } else { - throw new IOException("result=0x" + Integer.toHexString(result)); - } + skipEntityData_native(mBackupReader); } else { throw new IllegalStateException("mHeaderReady=false"); } diff --git a/core/java/android/backup/BackupManager.java b/core/java/android/backup/BackupManager.java index c52fcd2..da1647a 100644 --- a/core/java/android/backup/BackupManager.java +++ b/core/java/android/backup/BackupManager.java @@ -43,7 +43,7 @@ public class BackupManager { private static final String TAG = "BackupManager"; /** @hide TODO: REMOVE THIS */ - public static final boolean EVEN_THINK_ABOUT_DOING_RESTORE = false; + public static final boolean EVEN_THINK_ABOUT_DOING_RESTORE = true; private Context mContext; private static IBackupManager sService; diff --git a/core/java/android/backup/FileBackupHelper.java b/core/java/android/backup/FileBackupHelper.java index 4058497..dacfc8f 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/IRestoreSession.aidl b/core/java/android/backup/IRestoreSession.aidl index 2a1fbc1..fd40d98 100644 --- a/core/java/android/backup/IRestoreSession.aidl +++ b/core/java/android/backup/IRestoreSession.aidl @@ -40,6 +40,8 @@ interface IRestoreSession { * Restore the given set onto the device, replacing the current data of any app * contained in the restore set with the data previously backed up. * + * @return Zero on success; nonzero on error. The observer will only receive + * progress callbacks if this method returned zero. * @param token The token from {@link getAvailableRestoreSets()} corresponding to * the restore set that should be used. * @param observer If non-null, this binder points to an object that will receive @@ -50,6 +52,9 @@ interface IRestoreSession { /** * End this restore session. After this method is called, the IRestoreSession binder * is no longer valid. + * + * <p><b>Note:</b> The caller <i>must</i> invoke this method to end the restore session, + * even if {@link getAvailableRestoreSets} or {@link performRestore} failed. */ void endRestoreSession(); } diff --git a/core/java/android/backup/SharedPreferencesBackupHelper.java b/core/java/android/backup/SharedPreferencesBackupHelper.java index 4a7b399..6a0bc96 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); |