[Nexus 7 Q&A, Help & Troubleshooting] nubbins01:
Hi all. Hoping I might be able to get some assistance with an issue. I originally posted something in similar in the relevant ROM thread, but I thought here might be a more appropriate place.

Running:

Nexus 7 (2012 original)

AndDiSa's 7.1.2 Grouper OTA-Package (Build 20190309)

GApps ARM 7.1 Pico 20190312

I'm not 100% sure if it's from this ROM or something else more fundamental to Android, but I'm having an issue where the screen repeatedly is locking itself despite being in use. It will also light the screen up when already locked, even if there are no incoming notifications. This is a tablet that hasn't been used for years, that I recently found amongst a bunch of stuff and decided to resuscitate.

This random locking and screen waking suggested an errant input somewhere, however I have not experienced the same issue just sitting in TWRP, where the screen will stay on until it hits the screen off time reliably. The issue occurs in Android Safe Mode, with on body detection disabled, double tap to wake disabled, Daydream disabled, No Smart Lock and only a swipe pin to unlock. I pulled the back off the tablet and checked the contacts for the power button, no obvious damage or corrosion.

I thought perhaps maybe there might be an application causing the issue, but the issue occurs even when only default Android pico GApps are installed. The issue appears to occur randomly - I might go hours without an issue, then at other times the issue will occur constantly for several minutes. Doesn't seem to change depending on what application I'm using - I'll have the same thing happening when I tested video (Youtube app and in a browser full screen, and also in apps that will sleep if inactive, all have been overriden)

I also suspected perhaps an accelerometer issue, but using a simple Sensor Multitool app in the Play Store, I didn't see any unexpected inputs from the accelerometer or the magnetic sensor (having said that, I'm not sure exactly what I'm looking for. Output correlated to input, however).. I am not using any kind of case, and running a magnet around the tablet affects nothing but the touchscreen.

In addition to locking while being used, the screen will also occasionally wake itself when not being touched at all, even if ambient display on notifications (and even the wifi!) are turned off. I took a logcat from when one of these wakes happened (tablet was sitting there, I wasn't touching it, and watched the log), but I don't really know what I'm looking for. Doesn't seem to be anything that obviously indicates a problem though.

----------

03-15 22:09:03.686 534 1640 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:09:34.850 534 5782 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:10:03.676 534 739 E wifi : wifi_get_supported_feature_set returned error = 0xffffffa1

03-15 22:10:03.688 534 1639 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:10:03.694 534 563 E BatteryStatsService: no controller energy info supplied

03-15 22:10:03.694 534 563 E BatteryStatsService: no controller energy info supplied

03-15 22:10:03.694 534 563 E BatteryStatsService: no controller energy info supplied

03-15 22:10:03.694 534 563 E BatteryStatsService: power: Missing API

03-15 22:11:03.704 534 1636 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:11:13.382 534 1638 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:11:13.435 534 678 I PowerManagerService: Waking up from sleep (uid 1000)...

03-15 22:11:13.435 534 678 I powerHAL::common: dealing with POWER_HINT_INTERACTION -> boosting CPU for 100ms

03-15 22:11:13.436 534 569 I DisplayPowerController: Blocking screen on until initial contents have been drawn.

03-15 22:11:13.436 534 569 V KeyguardServiceDelegate: onScreenTurnedOn(showListener = com.android.server.policy.PhoneWindowManager$2@1db1058)

03-15 22:11:13.440 534 534 V KeyguardServiceDelegate: onStartedWakingUp()

03-15 22:11:13.443 534 1634 V KeyguardServiceDelegate: **** SHOWN CALLED ****

03-15 22:11:13.468 776 776 W FingerprintManager: isFingerprintHardwareDetected(): Service not connected!

03-15 22:11:13.654 534 569 D LuxLevels: bright hysteresis constant= 0.1, threshold=33.0, lux=30.0

03-15 22:11:13.654 534 569 D LuxLevels: dark hysteresis constant= 0.2, threshold=24.0, lux=30.0

03-15 22:11:13.712 534 760 D PowerManagerService-JNI: Excessive delay in autosuspend_disable() while turning screen on: 262ms

03-15 22:11:13.712 534 760 I powerHAL::common: common_power_open_set_interactive ...

03-15 22:11:13.712 534 760 I powerHAL::common: Setting scaling_governor to intelliactive

03-15 22:11:13.712 534 760 I powerHAL::common: Setting low power cluster 1

03-15 22:11:13.713 534 760 I powerHAL::common: pInfo available ...

03-15 22:11:13.713 534 760 I powerHAL::common: Screen is off going to be switched on, setting aggressive values for intelliactive governor and boost wake up

03-15 22:11:13.713 534 760 I powerHAL::common: dealing with wake up -> boosting CPU for 5s

03-15 22:11:13.713 178 178 D SurfaceFlinger: Set power mode=2, type=0 flinger=0x408a8000

03-15 22:11:13.714 178 178 D hwcomposer: hwc_blank: display 0: unblank

03-15 22:11:13.714 178 178 D hwcomposer: hwc_blank_display: display 0: [1 -> 0]

03-15 22:11:13.714 178 178 D hwcomposer: Display 0 is 800 x 1280

03-15 22:11:13.714 178 178 D hwcomposer: dc_blank: display 0, [1 -> 0]

03-15 22:11:13.717 534 567 I DisplayManagerService: Display device changed state: "Built-in Screen", ON

03-15 22:11:13.758 5150 5150 I ScreenEventHandler: Received Broadcast ACTION_SCREEN_ON

03-15 22:11:13.762 5150 5150 I EventWatcherService: Received start id 182: Intent { cmp=com.asksven.betterbatterystats/.services.EventWatcherService }

03-15 22:11:13.771 5150 5150 I SmallWidgetProvider: onReceive method called, action = 'BBS_WIDGET_UPDATE' at 2019-03-15 22:11:13

03-15 22:11:13.797 534 569 I DisplayPowerController: Unblocked screen on after 361 ms

03-15 22:11:13.799 534 569 V KeyguardServiceDelegate: onScreenTurnedOn()

03-15 22:11:13.919 534 3639 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

03-15 22:11:14.303 216 511 E NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UID' not found

03-15 22:11:14.719 534 909 I powerHAL::common: dealing with POWER_HINT_VSYNC -> boosting CPU for 100ms

^C

----------

Any input or thoughts would be most welcome. I've seen people post about similar things elsewhere on all kinds of Android devices going back as far as KitKat, and I've tried most of those solutions (disabling location services, turning off double tap, turning off wifi, clearing dalvik and cache, removing apps, etc) but no solution as yet.

Ta!