Handle empty/unspecified crop properly in wallpaper restore

Pass 'null' as the crop hint when the crop as expressed in the restored
wallpaper metadata is either unspecified or effectively empty.

Bug 30521402
Bug 30274136

Change-Id: I14e5d2bae1ec30fb27e8fd45b340b2ca87f35a01
This commit is contained in:
Christopher Tate
2016-08-08 13:09:02 -07:00
parent a6b1a9485c
commit dd7110db2b

View File

@@ -238,7 +238,7 @@ public class WallpaperBackupAgent extends BackupAgent {
Slog.v(TAG, "Restored crop hint " + cropHint); Slog.v(TAG, "Restored crop hint " + cropHint);
} }
try (FileInputStream in = new FileInputStream(stage)) { try (FileInputStream in = new FileInputStream(stage)) {
mWm.setStream(in, cropHint, true, which); mWm.setStream(in, cropHint.isEmpty() ? null : cropHint, true, which);
} finally {} // auto-closes 'in' } finally {} // auto-closes 'in'
} }
} }