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

Commit 9c5f71f3 authored by Meng Wang's avatar Meng Wang
Browse files

PersistableBundle.restoreFromXml should return a mutable bundle.

Issue:
  Currently, restoreFromXml/readFromStream returns an immutable
  PersistableBundle.EMPTY when the underlying XML file is
  ill-formatted. Otherwise it returns a mutable one.
  This inconsistent behavior easily causes crash when returned
  PersistableBundle is mutated.

Fix:
  Make restoreFromXml consistently return a mutable
  PersistableBundle.

Bug: 185436202
Test: make
Change-Id: I3c9ab4df9f0fea2d46d1c9b72ffd4b65790180b2
parent 958f9efb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ public final class PersistableBundle extends BaseBundle implements Cloneable, Pa
                        new MyReadMapCallback()));
            }
        }
        return EMPTY;
        return new PersistableBundle();  // An empty mutable PersistableBundle
    }

    @Override