mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
rectify crash on crdroid : https://paste.crdroid.net/7fKtss
This commit is contained in:
@@ -1055,19 +1055,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
|
||||
/** Receives animation progress from sysui process. */
|
||||
private void initRemotelyCalculatedUnfoldAnimation(UnfoldTransitionConfig config) {
|
||||
|
||||
Handler handler;
|
||||
try {
|
||||
handler = getMainThreadHandler();
|
||||
} catch (Throwable t) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
|
||||
RemoteUnfoldSharedComponent unfoldComponent =
|
||||
UnfoldTransitionFactory.createRemoteUnfoldSharedComponent(
|
||||
/* context= */ this,
|
||||
config,
|
||||
getMainExecutor(),
|
||||
handler,
|
||||
getMainThreadHandler(),
|
||||
/* backgroundExecutor= */ UI_HELPER_EXECUTOR,
|
||||
/* bgHandler= */ UI_HELPER_EXECUTOR.getHandler(),
|
||||
/* tracingTagPrefix= */ "launcher",
|
||||
|
||||
@@ -28,6 +28,8 @@ import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.window.OnBackInvokedDispatcher;
|
||||
|
||||
@@ -392,6 +394,15 @@ public abstract class BaseActivity extends ComponentActivity implements Activity
|
||||
mEventCallbacks[event].add(callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Handler getMainThreadHandler() {
|
||||
try {
|
||||
return new Handler(Looper.getMainLooper());
|
||||
} catch (Throwable t) {
|
||||
return super.getMainThreadHandler();
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes a previously added callback */
|
||||
public void removeEventCallback(@ActivityEvent int event, Runnable callback) {
|
||||
mEventCallbacks[event].remove(callback);
|
||||
|
||||
Reference in New Issue
Block a user