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

Commit 19ff81f9 authored by Nagendra Prasad Nagarle Basavaraju's avatar Nagendra Prasad Nagarle Basavaraju
Browse files

Fix power consumption problem in cast scene

Issue found at,
When user ends the cast but does not operate the phone anymore,
only the interface onDisplayRemoved will be called back and interface onDisplayChanged will not be called back. But there is no processing of onDisplayRemoved in
com.android.internal.telphony.DeviceStateMonitor#mDisplayListener.

Therefore, in DeviceStateMonitor, the on-off status check of the
screen will not be triggered and modem will continue to report the network status based on the previously setUnsolResponseFilter(filter is 127), eventuallyleading to power consumption problem.

Bug: 348570675
Test: Device test and atest
Flag: EXEMPT bugfix
Change-Id: Id3d62f5c55ddda0772ff0c3e0e841dc6fbb975f7
parent fcd8e2d9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -217,7 +217,13 @@ public class DeviceStateMonitor extends Handler {
                public void onDisplayAdded(int displayId) { }

                @Override
                public void onDisplayRemoved(int displayId) { }
                public void onDisplayRemoved(int displayId) {
                    /* adapter for virtual display removed */
                    boolean screenOn = isScreenOn();
                    Message msg = obtainMessage(EVENT_SCREEN_STATE_CHANGED);
                    msg.arg1 = screenOn ? 1 : 0;
                    sendMessage(msg);
                }

                @Override
                public void onDisplayChanged(int displayId) {