Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Mar 13, 2023
1 parent 03c693a commit 0d910f7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/com/android/launcher3/util/MainThreadInitializedObject.java
Expand Up @@ -57,15 +57,16 @@ public T get(Context context) {
}

if (mValue == null) {
Context app;
try {
app = context.getApplicationContext();
} catch (Exception ignored) {
// https://github.com/LawnchairLauncher/lawnchair/issues/3111
app = LawnchairApp.getInstance();
}
Context appContext = app;
if (Looper.myLooper() == Looper.getMainLooper()) {
Context app;
try {
app = context.getApplicationContext();
} catch (Exception ignored) {
// https://github.com/LawnchairLauncher/lawnchair/issues/3111
app = LawnchairApp.getInstance();
}
Context appContext = app;

mValue = TraceHelper.allowIpcs("main.thread.object",
() -> mProvider.get(appContext));
onPostInit(context);
Expand Down

0 comments on commit 0d910f7

Please sign in to comment.