summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherPreferencesBackupHelper.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-10-16 09:24:19 -0700
committerDanesh M <daneshm90@gmail.com>2015-09-27 18:55:56 -0700
commit8d43f06829523a920904c958e6545648b0b0c200 (patch)
tree642c551460c3ef832525a71069ceb7d0e3ce90d1 /src/com/android/launcher3/LauncherPreferencesBackupHelper.java
parent78e301e3cf00d6f57ec1d131979a47294d3b3668 (diff)
downloadandroid_packages_apps_Trebuchet-8d43f06829523a920904c958e6545648b0b0c200.tar.gz
android_packages_apps_Trebuchet-8d43f06829523a920904c958e6545648b0b0c200.tar.bz2
android_packages_apps_Trebuchet-8d43f06829523a920904c958e6545648b0b0c200.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.java44
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);
- }
- }
-}