Merge "Move the call to flush() to avoid a race condition"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ee28ca0a62
@@ -463,6 +463,7 @@ final class PersistentDataStore {
|
||||
|
||||
TypedXmlSerializer serializer = Xml.resolveSerializer(os);
|
||||
saveToXml(serializer);
|
||||
serializer.flush();
|
||||
|
||||
mHandler.removeCallbacksAndMessages(/* token */ null);
|
||||
mHandler.post(() -> {
|
||||
@@ -481,8 +482,6 @@ final class PersistentDataStore {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
serializer.flush();
|
||||
} catch (IOException ex) {
|
||||
Slog.w(TAG, "Failed to process the XML serializer.", ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user