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

Commit fdb0ec1d authored by zhangshuai10's avatar zhangshuai10 Committed by Android Build Coastguard Worker
Browse files

Added a check to avoid adding shared libraries to resources created based on system assets



System assets should not be modified after initialization.

Bug: 353608799
Test: manual.
Flag: EXEMPT bugfix

Signed-off-by: default avatarzhangshuai10 <zhangshuai10@xiaomi.corp-partner.google.com>
(cherry picked from https://partner-android-review.googlesource.com/q/commit:f0ad4e2d03180c2ac728f09ed1cbcdee0f02cb14)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c65db1c59f4c3672bbf8bc63e585cea00f73eb6a)
Merged-In: I106cdfff460096ff98e88e27316514fc29075e6a
Change-Id: I106cdfff460096ff98e88e27316514fc29075e6a
parent 6881fb10
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1833,9 +1833,10 @@ public class ResourcesManager {
                    // have shared library asset paths appended if there are any.
                    if (r.getImpl() != null) {
                        final ResourcesImpl oldImpl = r.getImpl();
                        final AssetManager oldAssets = oldImpl.getAssets();
                        // ResourcesImpl constructor will help to append shared library asset paths.
                        if (oldImpl.getAssets().isUpToDate()) {
                            final ResourcesImpl newImpl = new ResourcesImpl(oldImpl.getAssets(),
                        if (oldAssets != AssetManager.getSystem() && oldAssets.isUpToDate()) {
                            final ResourcesImpl newImpl = new ResourcesImpl(oldAssets,
                                    oldImpl.getMetrics(), oldImpl.getConfiguration(),
                                    oldImpl.getDisplayAdjustments());
                            r.setImpl(newImpl);