summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Bernardo Rufino <brufino@google.com> 2021-11-02 10:41:12 +0000
committer Bernardo Rufino <brufino@google.com> 2021-11-02 11:42:11 +0000
commit7c296d7514fe9d9f237c43b3554a2b5646035428 (patch)
tree0aa696711c1e651bb2499ab13ecc9eeedae5709b /libs/androidfw/StringPool.cpp
parent31d70842e0033660e73c1c553deade4f213bd411 (diff)
Refactor Bundle for thread-safety of Bundle.hasFileDescriptors()
After aosp/1878338, I realized Bundle.hasFileDescriptors() was accessing mParcelledData and mMap without a lock. So, to avoid locking there, I made mParcelledData volatile (since after mParcelledData is null, it can never be non-null again and mMap is guaranteed to be non-null). So, moved assignments to mParcelledData to be last wrt mMap and mParcelledByNative to ensure visibility of those fields. While refactoring copyInternal(), realized that method was always used after constructing an uninitialized Bundle, so to avoid mistakes with objects not properly initialized, I created a constructor in Bundle, PersistableBundle & BaseBundle that does that copyInternal() did. Bug: 195622897 Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest Change-Id: I5c9337496da7ecf87f10370726099dcb247a6789
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions