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

Commit a5dbbb09 authored by Brandon Liu's avatar Brandon Liu
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
Change-Id: Idae846c9f799887635f85bec5e0cb912b5eaa1b1
parent 9df00b18
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1745,10 +1745,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.");
                        }
                    }
                }
            }