[Galaxy S 4 Mini Q&A, Help & Troubleshooting] guglicap:
Hello,

a while ago, I started having an issue with my s4 mini (serranolte).

Basically, the screen turns itself on very often. For example, I press the power button to turn it off and after a second or so it turns itself on, stays on for ~10 seconds, turns off due to screen timeout, turns on by itself and so on.

I tried both with Lineage OS 14.1 and crDroid v4.4 (android 8.1) and the issue persists.

Here's a copy of the logcat taken while this happens:

07-15 12:49:42.350 531 634 I PowerManagerService: Going to sleep due to power button (uid 1000)...
07-15 12:49:42.377 531 558 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
07-15 12:49:42.378 531 558 D vndksupport: Loading /vendor/lib/hw/gralloc.msm8960.so from current namespace instead of sphal namespace.
07-15 12:49:42.384 531 558 W Adreno-EGL: <qeglDrvAPI_eglQueryContext:4373>: EGL_BAD_ATTRIBUTE
07-15 12:49:42.827 531 558 I DisplayPowerController: Blocking screen off
07-15 12:49:42.827 531 558 I DisplayPowerController: Unblocked screen off after 0 ms
07-15 12:49:42.827 531 558 D Sensors : activate: acc_enable=0, mag_enable=0
07-15 12:49:42.827 531 558 D Sensors : activate: handle=0, enabled=0
07-15 12:49:42.843 531 558 D Sensors : activate: acc_enable=0, mag_enable=0
07-15 12:49:42.843 531 558 D Sensors : activate: handle=4, enabled=0
07-15 12:49:42.843 531 558 D Sensors : LightSensor enable = 0
07-15 12:49:42.843 531 558 D Sensors : LightSensor enableSensor = 0
07-15 12:49:42.857 531 556 I DisplayManagerService: Display device changed state: "Built-in Screen", OFF
07-15 12:49:42.858 241 241 D SurfaceFlinger: Set power mode=0, type=0 flinger=0xb364e000
07-15 12:49:42.861 241 241 D qdhwcomposer: hwc_setPowerMode: Setting mode 0 on display: 0
07-15 12:49:42.871 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:42.871 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:42.879 531 634 I InputReader: Reconfiguring input devices. changes=0x00000004
07-15 12:49:42.918 531 634 I PowerManagerService: Waking up from dozing (uid=1000 reason=android.policy:KEY)...
07-15 12:49:42.922 531 558 I DisplayPowerController: Blocking screen on until initial contents have been drawn.
07-15 12:49:42.923 531 558 D Sensors : setDelay: acc_delay=66667000, mag_delay=200000000
07-15 12:49:42.923 531 558 D Sensors : setDelay: handle=4, delay=250000000
07-15 12:49:42.923 531 558 D Sensors : LightSensor setDelay = 250000000
07-15 12:49:42.923 531 558 D Sensors : LightSensor setSensorDelay = 250000000
07-15 12:49:42.923 531 558 D Sensors : activate: acc_enable=0, mag_enable=0
07-15 12:49:42.923 531 558 D Sensors : activate: handle=4, enabled=1
07-15 12:49:42.923 531 558 D Sensors : LightSensor enable = 1
07-15 12:49:42.923 531 558 D Sensors : LightSensor enableSensor = 1
07-15 12:49:42.927 289 289 D audio_hw_primary: adev_set_parameters: enter: screen_state=off
07-15 12:49:42.942 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:42.942 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:42.964 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:42.979 1148 1148 I chatty : uid=10030(com.android.systemui) identical 2 lines
07-15 12:49:42.979 1148 1148 D StatusBar: disable<e i a s b H R c s q >
07-15 12:49:43.019 531 615 D Sensors : LightSensor readEvents x = 37.000000, raw = 37
07-15 12:49:43.020 531 558 D Sensors : activate: acc_enable=0, mag_enable=0
07-15 12:49:43.020 531 558 D Sensors : activate: handle=4, enabled=0
07-15 12:49:43.020 531 558 D Sensors : LightSensor enable = 0
07-15 12:49:43.020 531 558 D Sensors : LightSensor enableSensor = 0
07-15 12:49:43.021 531 558 D Sensors : setDelay: acc_delay=66667000, mag_delay=200000000
07-15 12:49:43.021 531 558 D Sensors : setDelay: handle=4, delay=1000000000
07-15 12:49:43.021 531 558 D Sensors : LightSensor setDelay = 1000000000
07-15 12:49:43.021 531 558 D Sensors : LightSensor setSensorDelay = 1000000000
07-15 12:49:43.021 531 558 D Sensors : activate: acc_enable=0, mag_enable=0
07-15 12:49:43.021 531 558 D Sensors : activate: handle=4, enabled=1
07-15 12:49:43.021 531 558 D Sensors : LightSensor enable = 1
07-15 12:49:43.022 531 558 D Sensors : LightSensor enableSensor = 1
07-15 12:49:43.120 531 615 D Sensors : LightSensor readEvents x = 39.000000, raw = 39
07-15 12:49:43.335 241 241 D qdhwcomposer: hwc_setPowerMode: Done setting mode 0 on display 0
07-15 12:49:43.344 531 1105 D SurfaceControl: Excessive delay in setPowerMode()
07-15 12:49:43.345 531 556 I DisplayManagerService: Display device changed state: "Built-in Screen", ON
07-15 12:49:43.363 531 634 I InputReader: Reconfiguring input devices. changes=0x00000004
07-15 12:49:43.368 241 241 D SurfaceFlinger: Set power mode=2, type=0 flinger=0xb364e000
07-15 12:49:43.368 241 241 D qdhwcomposer: hwc_setPowerMode: Setting mode 2 on display: 0
07-15 12:49:43.981 531 556 W WindowManager: Timeout waiting for drawn: undrawn=[Window{afd67f u0 StatusBar}]
07-15 12:49:43.983 531 549 D Sensors : setDelay: acc_delay=66667000, mag_delay=200000000
07-15 12:49:43.983 531 549 D Sensors : setDelay: handle=0, delay=66667000
07-15 12:49:43.984 531 549 D Sensors : activate: acc_enable=1, mag_enable=0
07-15 12:49:43.984 531 549 D Sensors : activate: handle=0, enabled=1
07-15 12:49:44.054 241 241 D qdhwcomposer: hwc_setPowerMode: Done setting mode 2 on display 0
07-15 12:49:44.055 531 558 I DisplayPowerController: Unblocked screen on after 1133 ms
07-15 12:49:44.063 531 1105 D SurfaceControl: Excessive delay in setPowerMode()
07-15 12:49:44.079 531 558 W PowerManagerService: Screen on took 1160 ms
07-15 12:49:44.081 1148 1148 I Choreographer: Skipped 63 frames! The application may be doing too much work on its main thread.
07-15 12:49:44.120 531 615 D Sensors : LightSensor readEvents x = 35.000000, raw = 35
07-15 12:49:44.132 289 389 D audio_hw_primary: adev_set_parameters: enter: screen_state=on

Hoping someone can help :)

Ask me if you need to know anything else, I really hope this isn't an hardware issue...

Thanks, have a nice day