From 722d27f99c0b8ad4e69afdf7d8f0476b7d47053c Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 2 May 2016 17:16:05 -0700 Subject: [PATCH] Full-data restore path needs to pass along the widget metadata The engine itself knows about it, but that's at one remove from the code that needs to consume it. Make sure it gets passed up the chain. Bug 28346706 Change-Id: Ib94c9fbc512d92039bb7db5cd6b0b088a4a66027 --- .../android/server/backup/BackupManagerService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index 1b63cd4958dc4..98c986e644958 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -5245,6 +5245,10 @@ public class BackupManagerService { return mAgent; } + public byte[] getWidgetData() { + return mWidgetData; + } + public boolean restoreOneFile(InputStream instream, boolean mustKillAgent) { if (!isRunning()) { Slog.w(TAG, "Restore engine used after halting"); @@ -7676,6 +7680,9 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF void restoreWidgetData(String packageName, byte[] widgetData) { // Apply the restored widget state and generate the ID update for the app // TODO: http://b/22388012 + if (MORE_DEBUG) { + Slog.i(TAG, "Incorporating restored widget data"); + } AppWidgetBackupBridge.restoreWidgetState(packageName, widgetData, UserHandle.USER_SYSTEM); } @@ -8457,6 +8464,9 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // the engine bound the target's agent, so recover that binding // to use for the callback. mAgent = mEngine.getAgent(); + + // and the restored widget data, if any + mWidgetData = mEngine.getWidgetData(); } else { // Something went wrong somewhere. Whether it was at the transport // level is immaterial; we need to tell the transport to bail