Merge "Resources: fix race with creating theme" into oc-dev

am: 5f70bc89be

Change-Id: I73bb76a7ff3fe6d3e0a974b5cbaed34c632ee8ae
This commit is contained in:
Adam Lesinski
2017-05-23 23:19:26 +00:00
committed by android-build-merger

View File

@@ -1760,7 +1760,9 @@ public class Resources {
public final Theme newTheme() {
Theme theme = new Theme();
theme.setImpl(mResourcesImpl.newThemeImpl());
mThemeRefs.add(new WeakReference<>(theme));
synchronized (mThemeRefs) {
mThemeRefs.add(new WeakReference<>(theme));
}
return theme;
}