diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2014-10-16 09:24:19 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2014-10-28 09:27:10 -0700 |
commit | 33d443897658e6ad8b76bd2e58e3598161fd3ead (patch) | |
tree | 2205d9f2b6c9ce04a1fbb47495b45eae04345a11 /src/com/android/launcher3/LauncherPreferencesBackupHelper.java | |
parent | 09ae4aef52b4486b97ecc77feeb64307bcbd3993 (diff) | |
download | android_packages_apps_Trebuchet-33d443897658e6ad8b76bd2e58e3598161fd3ead.tar.gz android_packages_apps_Trebuchet-33d443897658e6ad8b76bd2e58e3598161fd3ead.tar.bz2 android_packages_apps_Trebuchet-33d443897658e6ad8b76bd2e58e3598161fd3ead.zip |
Updating backup restore logic
> Adding DeviceProfile information in the backup
> Removing SharedPreference backup
> Adding helper methods to abort backup in the middle
> Comparing keys against the backup journal during restore
to avoid restoring corrupt/lost entries
> Old backups are still compatible, but lost keys verification
will be ignored in that case.
Bug: 17937935
Bug: 17951775
Bug: 17260941
Change-Id: Iad48646cfdd69abaff5c163b2055f3b8a9b39b19
Diffstat (limited to 'src/com/android/launcher3/LauncherPreferencesBackupHelper.java')
-rw-r--r-- | src/com/android/launcher3/LauncherPreferencesBackupHelper.java | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/com/android/launcher3/LauncherPreferencesBackupHelper.java b/src/com/android/launcher3/LauncherPreferencesBackupHelper.java deleted file mode 100644 index 6f9c05c88..000000000 --- a/src/com/android/launcher3/LauncherPreferencesBackupHelper.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3; - -import android.app.backup.BackupDataInputStream; -import android.app.backup.SharedPreferencesBackupHelper; -import android.content.Context; -import android.util.Log; - -public class LauncherPreferencesBackupHelper extends SharedPreferencesBackupHelper { - - private static final String TAG = "LauncherPreferencesBackupHelper"; - private static final boolean VERBOSE = LauncherBackupAgentHelper.VERBOSE; - - private final boolean mRestoreEnabled; - - public LauncherPreferencesBackupHelper(Context context, String sharedPreferencesKey, - boolean restoreEnabled) { - super(context, sharedPreferencesKey); - mRestoreEnabled = restoreEnabled; - } - - @Override - public void restoreEntity(BackupDataInputStream data) { - if (mRestoreEnabled) { - if (VERBOSE) Log.v(TAG, "restoring preferences"); - super.restoreEntity(data); - } - } -} |