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

Commit 696238e0 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Provide single threaded executor to UnfoldUnfoldTransitionFactory

This fixes a concurrency issue where HingeSensorAngleProvider was being stopped and started at the same time in a thread-pool after a fast fold/unfold, despite not providing concurrency guarantees.

In sysui, the background executor provided was already single threaded, so no issue arisen. From Launcher, THREAD_POOL_EXECUTOR was provided.

In a follow up cl, I'll add a @SingleThreadBackground annotation to the executor used in the unfold lib.

Bug: 261320823
Test: manually stress tested fold/unfold.
Change-Id: Iccf1f1f7246d8592d4d80a032479aa75f0050655
parent d058f555
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.net.Uri;
import android.os.Handler;
import android.os.SystemProperties;
import android.provider.Settings;
import android.util.Log;
import android.view.Display;

import androidx.annotation.NonNull;
@@ -227,10 +226,6 @@ public class TaskbarManager {
        mActivity = activity;
        UnfoldTransitionProgressProvider unfoldTransitionProgressProvider =
                getUnfoldTransitionProgressProviderForActivity(activity);
        if (unfoldTransitionProgressProvider == null) {
            Log.e("b/261320823", "UnfoldTransitionProgressProvider null in setActivity. "
                    + "Unfold animation for launcher will not work.");
        }
        mUnfoldProgressProvider.setSourceProvider(unfoldTransitionProgressProvider);

        if (mTaskbarActivityContext != null) {
+1 −4
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_O
import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;

@@ -63,7 +62,6 @@ import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.IBinder;
import android.os.SystemProperties;
import android.util.Log;
import android.view.Display;
import android.view.HapticFeedbackConstants;
import android.view.RemoteAnimationTarget;
@@ -722,7 +720,7 @@ public class QuickstepLauncher extends Launcher {
                            getSystemService(SensorManager.class),
                            getMainThreadHandler(),
                            getMainExecutor(),
                            /* backgroundExecutor= */ THREAD_POOL_EXECUTOR,
                            /* backgroundExecutor= */ UI_HELPER_EXECUTOR,
                            /* tracingTagPrefix= */ "launcher",
                            WindowManagerGlobal.getWindowManagerService()
                    );
@@ -739,7 +737,6 @@ public class QuickstepLauncher extends Launcher {
                    mUnfoldTransitionProgressProvider,
                    mRotationChangeProvider
            );
            Log.d("b/261320823", "initUnfoldTransitionProgressProvider completed");
        }
    }