Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee28ca0a authored by Piotr Wilczyński's avatar Piotr Wilczyński Committed by Android (Google) Code Review
Browse files

Merge "Move the call to flush() to avoid a race condition"

parents cfc2fc9b a8ec0f5d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
        }