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

Commit e0f0bde0 authored by Brandon Liu's avatar Brandon Liu Committed by Android Build Coastguard Worker
Browse files

Adding check to validate assets before appending shared library

Bug: b/344805124
Test: Verified all affected tests passed
Flag: android.content.res.register_resource_paths
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a5dbbb092fbe6c912c3cce1143d72f3a14aa451b)
Merged-In: Idae846c9f799887635f85bec5e0cb912b5eaa1b1
Change-Id: Idae846c9f799887635f85bec5e0cb912b5eaa1b1
parent a3ec1eab
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1834,10 +1834,15 @@ public class ResourcesManager {
                    if (r.getImpl() != null) {
                        final ResourcesImpl oldImpl = r.getImpl();
                        // ResourcesImpl constructor will help to append shared library asset paths.
                        if (oldImpl.getAssets().isUpToDate()) {
                            final ResourcesImpl newImpl = new ResourcesImpl(oldImpl.getAssets(),
                                    oldImpl.getMetrics(), oldImpl.getConfiguration(),
                                    oldImpl.getDisplayAdjustments());
                            r.setImpl(newImpl);
                        } else {
                            Slog.w(TAG, "Skip appending shared library asset paths for the "
                                    + "Resource as its assets are not up to date.");
                        }
                    }
                }
            }