Change DPI with Nougat (rooted) - LG G5 Questions & Answers

Hi,
Android 7.0 on LG G5 has three preset dpi-settings (640 (standard) and the new 544 and 720).
Unfortunately LG removed the "smallest width" option in the development settings (in this setting it would be possible to set an even lower dpi, I am using this on a Nexus 5).
Is it possible to set a lower dpi without Xposed? Editing the build.prop does not work. Even if I set the device to 544 dpi, the build.prop still says 640.
Thank you!
Best regards,
Timm

@t!mmhe Have you changed it with adb?
Plug your phone and open cmd then type:
"adb shell wm density *DPI && adb reboot"
*your number

Related

[Q & A] Using VIM to know terminal height via adb shell

Hi,
I have I assume is a very specific question. Cyanogenmod 7.2 has vim (and nano) installed, but when i use vim, the full size of my terminal is unused, and the cursor position and what is displayed become asynchronous. I have tried setting TERM=linux and TERM=xterm (I'm using OS X terminal which emulates an xterm), but neither get me a working vim. vi, which is part of busybox works fine. nano also fails to use the height of my terminal window, and additionally the enter key is broken.
Does anyone know of any fixes, config to get a working vim using android?
Thanks in advance for any info!
Findin' ma size...
To answer my own question for the benefit of others:
So, it seems at least Cyanogemnod7.2 Bash does not correctly receive the size of the terminal window from its host (use "stty -a" to check):
Code:
[16:44 localhost]-1 /
-> stty -a
speed 38400 baud;stty: standard input: No such file or directory...
And therefore Vim is unable to correctly set its columns and lines. The solution is simple, you have to force the terminal session to reread the window dimensions:
Code:
[16:45 localhost]-1 /
-> resize
[16:45 localhost]-1 /
-> stty -a
speed 38400 baud; rows 63; columns 107; line = 2;
I add "resize" to the bottom of my .bashrc file to do this automatically. Note if you are in Vim and resize your window, you need to force rereading the new dimensions, the vim command ":!resize" will do this.

!!SOLVED!! [Q] stuck in tablet mode: auto-rotation off = landscape

Something strange has started happening, if I turn off auto rotation my XZU sticks in landscape mode.
If I turn on auto rotate then phone will do what I expect and operate in portrait and landscape mode. However, if I am lying down in bed I want the non auto mode to make phone stick to portrait mode.
I suspect the problem is related to having used Xposed framework and App Settings to override DPI and make Google Maps easier to read the car. However, disabling that module and Xposed doesn't fix the problem.
My c6802 xzu is running 4.4.4, unlocked bootloader, rooted with dual recovery.
I'd go poking at build.props but I don't know what to look for, and I've searched but most results about people wanting auto rotate control apps.
Thanks for reading and more thanks for any help.
Paul
you can force orientation of specific apps with app settings xposed module. Try that?
For example the youtube app does not respond to lock orientation setting so it will enter landscape mode if you rotate the phone so I forced the app to stay in portrait mode with the xposed module
Yes, I know I can force specific apps into specific orientations but I actually want everything to auto rotate when that setting is enabled.
e.g. I browse the web in portrait most of the time, but some websites only really work in landscape.
I just want my Xperia Z Ultra to behave like it always used to.. I.e. fixed portrait, or auto.
FIXED!
FIXED!
a few blank lines added for easy reading
Code:
$ adb shell
[email protected]:/ $ su -
[email protected]:/ #
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
SQLite version 3.7.6.3-Titanium
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from system;
1|volume_music|11
2|volume_ring|5
... snip loads and loads...
3990|volume_voice_earpiece|2
3996|volume_music_headset|8
3997|volume_music_bt_a2dp|8
4007|media_button_receiver|com.amazon.mp3/com.amazon.mp3.playback.service.HeadsetControlsReceiver
sqlite> select * from system where name='accelerometer_rotation';
3970|accelerometer_rotation|1
sqlite> select * from system where name='user_rotation';
3638|user_rotation|3
sqlite> update system set value=0 where name='user_rotation';
sqlite> select * from system where name='user_rotation';
3638|user_rotation|0
sqlite> ^D
no need for a reboot, turned on auto-rotate and voila, device no longer thinks its a tablet.
note that the only sqlite3 binary I could find was one in the Titanium Backup Root app:
[email protected]:/ # find / -name sqlite3
/data/data/com.keramidas.TitaniumBackup/files/sqlite3
with thanks to Jakub Czaplicki for his post to StackExchange:
http://android.stackexchange.com/qu...fault-screen-orientation-in-android-specified

build.prop permission settings for 6.0

I managed to get myself stuck in a boot loop by editing build.prop on my android 6.0 Nexus 7 tablet. I added the linero.sf.hwrotation=0 at the end of the file and saved it and then when I rebooted, it made no difference. I then changed the permissions on the build.prop file to 666 then now after the Google logo it gets stuck on a blank screen.
My device is rooted and I have twrp. So I'm thinking hopefully I can boot into recovery mode then could I somehow reset the permissions? Can someone kindly guide me through what I need to do? What should the permissions be? Why was that line not working in the first place? Should I remove that hwrotation line?
Thanks
The permission should be 0744
jwoegerbauer said:
The permission should be 0744
Click to expand...
Click to collapse
Thank you. I booted into TWRP recovery mode and used the file manager to chmod the build.prop file to 0744 and rebooted it. Now it seems to be working.
Any ideas why my hwrotation setting is being ignored? only thing I can think of is that maybe it isn't supported on android 6.0? because most of the guides that are about that seem to refer to android 4.
ahmed123 said:
Any ideas why my hwrotation setting is being ignored? only thing I can think of is that maybe it isn't supported on android 6.0? because most of the guides that are about that seem to refer to android 4.
Click to expand...
Click to collapse
Try to make it persistent.
Example
Code:
# possible values: 0 = Landscape, 90 = Portrait, 180 = Reverse Landscape, 270 = Reverse Portrait
persist.ro.sf.hwrotation=180
jwoegerbauer said:
Try to make it persistent.
Example
Code:
# possible values: 0 = Landscape, 90 = Portrait, 180 = Reverse Landscape, 270 = Reverse Portrait
persist.ro.sf.hwrotation=180
Click to expand...
Click to collapse
Just tried that, still no difference. The boot google logo and android animation is still in portrait for some reason. When android starts up then you can see it flip to landscape which is the user setting part that I applied.

[Fixed] Why i cant change resolution size & density Minimal ADB and Fastboot

hello to all,
as a test and for learnng i tried to change resolution and Minimal ADB and Fastboot density on an old (not rooted) LG G3 Mini. No problems, everything is okay.
Now i wanted to try the same on my new not rooted OPPO A94 5G, and it failed:
When i try to change the current original resoltuion (1080x2400) with the command:
adb shell wm size 1080x1440
i getting this error message:
Code:
Exception occurred while executing 'size':
java.lang.SecurityException: Must hold permission android.permission.WRITE_SECURE_SETTINGS
at com.android.server.wm.WindowManagerService.setForcedDisplaySize(WindowManagerService.java:5719)
at com.android.server.wm.WindowManagerShellCommand.runDisplaySize(WindowManagerShellCommand.java:165)
at com.android.server.wm.WindowManagerShellCommand.onCommand(WindowManagerShellCommand.java:71)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.wm.WindowManagerService.onShellCommand(WindowManagerService.java:1274)
at android.os.Binder.shellCommand(Binder.java:936)
at android.os.Binder.onTransact(Binder.java:820)
at android.view.IWindowManager$Stub.onTransact(IWindowManager.java:2872)
at com.android.server.wm.WindowManagerService.onTransact(WindowManagerService.java:1525)
at com.android.server.wm.OppoWindowManagerService.onTransact(OppoWindowManagerService.java:185)
at android.os.Binder.execTransactInternal(Binder.java:1166)
at android.os.Binder.execTransact(Binder.java:1130)
Click to expand...
Click to collapse
Same happens on the try to change with "adb shell wm density".
Does that mean its not possible to change the resolution & density on this device? Or are there any other steps necessaryto get it?
strange, nobody here could say anything to that.
In the meantime i found the reason for this permission problem in an other forum´s helpful posting.
To fix it, enable ""Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" in the developer options of the phone.
After that the size command works fine.

Development High Resolution Mod for Xperia 1 IV

Hey everyone,
before the official Android 12 release from Sony it was possible to force the display to render at full 4K resolution via "wm size" command.
With the release of Android 12 this behaviour changed and it´s no longer possible to force 4K resolution that way.
I looked into quite a few ways go get full 4K rendering back and discovered that even for supported apps, where the kernel switches to timings for 4k resolution, the actual rendering for the displayed content is upscaled 2k.
That means there unfortunately is no way, that I was able to find, to force full 4k rendering on the device as of now.
The best I could do, is to force the default 4k mode where kernel panel timings are at 4k, but content is upscaled 2k for regular usage. The result is the following: Every app, except the ones you add to game optimizer app, will be rendered like apps that sony enabled 4k resolution for.
That´s the best I can do at the moment.
This mod might impact battery life, smoothness and other things, as more resources are needed.
However I didn´t have any problems during my usage.
The difference is not huge, but it´s visible if you look for it. For example the fonts at the bottom of Google Fotos app, like Fotos, Search etc are way more crisp.
You can check in logcat if high-resolution config is used via:
Code:
adb logcat | grep "high resolution"
While having this mod flashed, the following line means high-resolution mode (panel running at 4k, content is upscaled 2k at 120fps) is enabled:
Code:
11-11 18:56:49.801 1475 1758 D SDM : HWCDisplay::SetActiveConfigWithConstraints: Setting to a high resolution config: 1
While having this mod flashed, the following line means high-resolution mode (panel running at 4k, content is upscaled 2k at 60fps) is enabled:
Code:
11-11 18:56:56.725 1475 1761 D SDM : HWCDisplay::SetActiveConfigWithConstraints: Setting to a high resolution config: 0
Changelog:
update with dtbo.img for firmware 64.1.A.0.869
Requirements:
- Sony Xperia 1 IV running on A13, with at unlocked bootloader
- fastboot method does not require root
- method via kernel managers does require root
- backup your current dtbo.img or make sure you have a copy of the same (EXKM can backup dtbo.img, or you can grab it from xperifirm)
Installation:
1. Download one of the attached dtbo.imgs
Please note: This mod is made for Android 13 firmware, it will not work on Android 12 firmware
2. Do either 2a or 2b!
2.a Boot to fastboot and flash via:
Code:
fastboot flash dtbo filenameofdtbo.img
2.b Flash filenameofdtbo.img via EXKM or any app that allows flashing dtbo.img
3. reboot
this one is mine too
this as well
Anyone tried this yet, if so what was the impact on the battery?
sillygooes said:
Anyone tried this yet, if so what was the impact on the battery?
Click to expand...
Click to collapse
Please refrain from asking questions which can be answered with your own common sense lmao
Mijan94 said:
Please refrain from asking questions which can be answered with your own common sense lmao
Click to expand...
Click to collapse
Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)
OhayouBaka said:
Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)
Click to expand...
Click to collapse
Yes, boot animation can get scrambled up indeed.
It depends on changes done to future firmware updates. Can't foresee the future, but it's unlikely there are much changes.
It's easy to either backup dtbo.img before flashing the modded one or simply reflash Stock extracted from Xperiafirm/unsin tool though.
No Bootloader unlock needed. Still.
service call SurfaceFlinger 1035 i32 x
(x=0,1,2,3)
1. 1096x2560x60x397132cmd
2. 1644x3840x120x397108cmd
3. 1644x3840x60x397108cmd
4. 1096x2560x120x397132cmd
Google changed the behavior for native Resolution switches in the Android Settings. Just like Samsung has it since YEARS. Thanks for the alternative tho
Also note that some apps do not work with an unlocked bootloader, for security standards requires a locked bootloader.
All throughout the internetz, people have had issues with apps like banking/finance apps, Google proprietary finance apps like Wallet or Google pay, or apps store like Google play.
OhayouBaka said:
Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)
Click to expand...
Click to collapse
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
su
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
Was about to do a Module. Thanks for sharing the Details!
OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
Thanks for this also I just found out you can add the script to fkm so you can easily switch between all resolution
Edit: Actually I think you can only run 2 res at a time 4k @120/60 or 1080 @120/60
Miustone said:
No Bootloader unlock needed. Still.
service call SurfaceFlinger 1035 i32 x
(x=0,1,2,3)
1. 1096x2560x60x397132cmd
2. 1644x3840x120x397108cmd
3. 1644x3840x60x397108cmd
4. 1096x2560x120x397132cmd
Google changed the behavior for native Resolution switches in the Android Settings. Just like Samsung has it since YEARS. Thanks for the alternative tho
Click to expand...
Click to collapse
OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
raven213 said:
Thanks for this also I just found out you can add the script to fkm so you can easily switch between all resolution
Edit: Actually I think you can only run 2 res at a time 4k @120/60 or 1080 @120/60
Click to expand...
Click to collapse
nice, thanks for the information. Much appreciated!
Wasn´t aware of this command or this way to set the ID.
One thing I noticed. This way basically breaks refresh rate switching though. E.G. if a different FPS is set for any app via game enhancer that will break for some reason.
I use this little trick to set 60hz mode for video apps for example as colours and gamma are way better on 60fps, and it´s unnecessary to drive the phone at 120hz during 60fps videos.
Had a small hope this would circumvent the upscaled 2k content despite running 4k panel mode, but it´s still the same.
Is it available on xperia1iii?
1219545479 said:
Is it available on xperia1iii?
Click to expand...
Click to collapse
Check Sony xda TG I think someone created a zip file for the III
First thanks for this mod. But 4k 120hz is sooooo hot although my room's temp is 9°C .... Fxxk 8gen1 that's why I want to buy s23ultra
1219545479 said:
Is it available on xperia1iii?
Click to expand...
Click to collapse
Yeah see here.... 2nd post by me.....
High Resolution & High Refresh Guide for Xperia 1 III
Welcome! Short and painless for You No Root needed Download the Android Platform Tools from Google Extract the Folder Containing adb & fastboot open a Terminal in the extracted Folder run one by one: adb shell service call SurfaceFlinger 1035...
forum.xda-developers.com
updated for firmware 64.1.A.0.869
It's so awesome that this mod exists and I don't even have the phone! Thank you for this mod. I really do hope more people discover this, as I'm sure many Xperia 1 users would want it.

Categories

Resources