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

Commit 9d28de67 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Set timeouts for SurfaceSyncGroup based on HW timeout

SurfaceSyncGroup is timing out on an emulator target. Use
ro.hw_timeout_multiplier to address this and other slow
target.

Test: presubmit
Bug: 273314551
Change-Id: I83dc352a24caabba2429ecf3f76c63500fa8a44d
parent 93ce6198
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -11626,7 +11626,8 @@ public final class ViewRootImpl implements ViewParent,


        mNumPausedForSync++;
        mNumPausedForSync++;
        mHandler.removeMessages(MSG_PAUSED_FOR_SYNC_TIMEOUT);
        mHandler.removeMessages(MSG_PAUSED_FOR_SYNC_TIMEOUT);
        mHandler.sendEmptyMessageDelayed(MSG_PAUSED_FOR_SYNC_TIMEOUT, 1000);
        mHandler.sendEmptyMessageDelayed(MSG_PAUSED_FOR_SYNC_TIMEOUT,
                1000 * Build.HW_TIMEOUT_MULTIPLIER);
        return mActiveSurfaceSyncGroup;
        return mActiveSurfaceSyncGroup;
    };
    };


+2 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.annotation.UiThread;
import android.annotation.UiThread;
import android.os.Binder;
import android.os.Binder;
import android.os.BinderProxy;
import android.os.BinderProxy;
import android.os.Build;
import android.os.Debug;
import android.os.Debug;
import android.os.Handler;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.HandlerThread;
@@ -62,7 +63,7 @@ public final class SurfaceSyncGroup {
    private static final int MAX_COUNT = 100;
    private static final int MAX_COUNT = 100;


    private static final AtomicInteger sCounter = new AtomicInteger(0);
    private static final AtomicInteger sCounter = new AtomicInteger(0);
    private static final int TRANSACTION_READY_TIMEOUT = 1000;
    private static final int TRANSACTION_READY_TIMEOUT = 1000 * Build.HW_TIMEOUT_MULTIPLIER;


    private static Supplier<Transaction> sTransactionFactory = Transaction::new;
    private static Supplier<Transaction> sTransactionFactory = Transaction::new;