How to modify display on/off behaviour in non-standard ways (e.g. keep it from ever turning off)


Question

Firstly: my phone is rooted, I am not afraid to use the terminal, modify source code and compile everything myself, I can provide logs, command outputs etc etc, I just need someone who knows where to look and what to modify. I will happily add any necessary info you need to help me.



I have recently replaced a broken display on my OnePlus One running LineageOS 15.1 (Android 8). Allegedly it's an original replacement part, but it is buggy. It often (read: most of the time) won't turn on when I press the power button, double-tap the touchscreen or any notification or call comes in. The system does unlock and the touchscreen does work, as I can hear the unlocking sound and interact with buttons whose locations on screen I remember. But the display doesn't light up - only sometimes, randomly. I can't figure out when it does or doesn't. As long as the display doesn't turn off, it will keep working indefinitely. And whenever I shut down and cold reboot the phone, it also immediately works. Since I'm unwilling to do the whole replacement procedure again including spending another 50 bucks on a part that might not even work (the seller conveniently refuses to accept returns after you use parts in DIY repairs), here's my actual question which is actually multiple questions, in order of my preference if I could choose a solution:



Does anyone know if there's different ways the phone tells the display to turn on? How do they differ between bootup and screen unlocking, since the former way reliably works? Can I somehow force my system to ALWAYS use that method, so that I can once again rely on a working display whenever I need it?



Failing that, does anyone know how to stop the display from turning off altogether, except on system shutdown? I'm currently using an app called "Screen On" that keeps the screen running, dimmed down. But the magnetic flip cover still turns it off, also it means I can't ever lock my screen with the power button because that would also turn it off. I would like my screen to go to Daydream when it normally would turn off.



I would like to be able to use Daydream on battery at all, but the settings menu only offers "when docked" and "when power cable is connected". Using dumpsys I found that there's a variable called "mDreamsEnabledOnBatteryConfig" and I would like to set it to "true" or "1", but 'dumpsys power set mDreams....' simply does nothing (yes, I am root). I also can't find the config file that I would need to edit.



Please refrain from suggesting I buy a new phone or send it in for professional repair.


Answer

Using a app called privset you can change the dream settings to work on battery also, search for dream. Additionally, check out tasker, you can hijack the power button to daydream


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes