[Launcher Jank] Avoid lock contention on AssetManager in all apps preinflate thread

Create a separate context with a separate AssetManager obj.

Bug: 337056120
Flag: NONE
Test: presubmit
Change-Id: Ic6765f7f19b649605aec6a889f8382ee10f929b0
This commit is contained in:
Fengjiang Li committed 2024-04-29 04:43:25 +00:00
1 parent 4e741082dc
commit b2d0845a29
3 files changed
+33 -1

No files matched your search

@@ -412,6 +412,8 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
public static <T extends BaseActivity> T fromContext(Context context) {
if (context instanceof BaseActivity) {
return (T) context;
} else if (context instanceof ActivityContextDelegate) {
return (T) ((ActivityContextDelegate) context).mDelegate;
} else if (context instanceof ContextWrapper) {
return fromContext(((ContextWrapper) context).getBaseContext());
} else {