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

Commit 0e978d80 authored by Chen Bai's avatar Chen Bai
Browse files

stop offload only when current display state is unsupported by offload

"stop offload" was always executed which could be redundant and make
screen brightness flaky. This CL makes "stop offload" only happen when
current display state is not suitable for offload.

Test: Manual
Bug: 325156852
Change-Id: Ic80e7034e9b30a9260833e02b7713c73bb2efbcb
parent a82202a5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -842,7 +842,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                        // We must tell sidekick/displayoffload to stop controlling the display
                        // before we can change its power mode, so do that first.
                        if (isDisplayOffloadEnabled) {
                            if (displayOffloadSession != null) {
                            if (displayOffloadSession != null
                                    && !DisplayOffloadSession.isSupportedOffloadState(state)) {
                                displayOffloadSession.stopOffload();
                            }
                        } else {
@@ -874,8 +875,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                        // have a sidekick/displayoffload available, tell it now that it can take
                        // control.
                        if (isDisplayOffloadEnabled) {
                            if (DisplayOffloadSession.isSupportedOffloadState(state)
                                    && displayOffloadSession != null) {
                            if (displayOffloadSession != null
                                    && DisplayOffloadSession.isSupportedOffloadState(state)) {
                                displayOffloadSession.startOffload();
                            }
                        } else {