OSDN Git Service

Fix restore from higher SDKs in SettingsBackupAgent
authorAnton Philippov <philippov@google.com>
Tue, 10 Apr 2018 21:52:28 +0000 (22:52 +0100)
committerAnton Philippov <philippov@google.com>
Tue, 10 Apr 2018 21:52:28 +0000 (22:52 +0100)
Actually skip the backup data for the unsupported key.

Bug: 77867300
Test: manual (adb shell bmgr restore com.android.providers.settings from
a backup set created by sdk 101)

Change-Id: I3d6a97ecbc0b048a3d07329542771f434e7e154d

packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java

index 313f73f..f728684 100644 (file)
@@ -253,6 +253,7 @@ public class SettingsBackupAgent extends BackupAgentHelper {
                     && !RESTORE_FROM_HIGHER_SDK_INT_SUPPORTED_KEYS.contains(key)) {
                 Log.w(TAG, "Not restoring unrecognized key '"
                         + key + "' from future version " + appVersionCode);
+                data.skipEntityData();
                 continue;
             }