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

Commit a5c31b95 authored by David Lin's avatar David Lin Committed by Android (Google) Code Review
Browse files

Merge "Avoid mutating requests HashSet from different threads." into 24D1-dev

parents 837a4496 65d8f469
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -180,14 +180,19 @@ constructor(
                    override fun show(
                        sensorId: Int,
                        @BiometricRequestConstants.RequestReason reason: Int
                    ) =
                    ) {
                        Log.d(TAG, "ISidefpsController#show invoked $sensorId, $reason")
                        if (reason.isReasonToAutoShow(activityTaskManager)) {
                            show(SideFpsUiRequestSource.AUTO_SHOW, reason)
                        } else {
                            hide(SideFpsUiRequestSource.AUTO_SHOW)
                        }
                    }

                    override fun hide(sensorId: Int) = hide(SideFpsUiRequestSource.AUTO_SHOW)
                    override fun hide(sensorId: Int) {
                        Log.d(TAG, "ISidefpsController#hide invoked $sensorId")
                        hide(SideFpsUiRequestSource.AUTO_SHOW)
                    }
                }
            )
            listenForAlternateBouncerVisibility()
@@ -247,9 +252,9 @@ constructor(
    /** Hides the fps overlay if shown. */
    fun hide(request: SideFpsUiRequestSource) {
        SideFpsControllerRefactor.assertInLegacyMode()
        mainExecutor.execute {
            Log.d(TAG, "hide(request=${request.name}): removing request")
            requests.remove(request)
        mainExecutor.execute {
            if (requests.isEmpty()) {
                traceSection("SideFpsController#hide(${request.name})") {
                    Log.d(