OSDN Git Service

Fix wifi AP backup
authorChristopher Tate <ctate@google.com>
Wed, 18 Feb 2015 01:04:01 +0000 (17:04 -0800)
committerThe Android Automerger <android-build@google.com>
Thu, 19 Feb 2015 04:57:17 +0000 (20:57 -0800)
An OutputStream buffers only by explicit contract.  OutputStreamWriter
buffers internally, always.  Do not get these behaviors confused.

Bug 19341967

Change-Id: I0610ed625b0175620083dd286f3a73c24956b171

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

index 6b7ac8c..b4d8c63 100644 (file)
@@ -942,6 +942,7 @@ public class SettingsBackupAgent extends BackupAgentHelper {
                 ByteArrayOutputStream bos = new ByteArrayOutputStream();
                 OutputStreamWriter out = new OutputStreamWriter(bos);
                 fromFile.write(out);
+                out.flush();
                 return bos.toByteArray();
             } else {
                 return EMPTY_DATA;