How init.rc setprop works

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How init.rc setprop works

Jump to solution
2,286 Views
mrigendra_chaub
Contributor III

I have android 8 from nxp and using it on sabresd board.
I am trying to change dpi settings through setprop settings
So I have put this iside init.${hardware}.rc on boot event

# Set the density to 160dpi, default 128dpi is not good
# Set the density to 128 dpi for 480x800, 7 inch.
setprop ro.sf.lcd_density 128

The device works fine and if I do this

wm density
Physical density:128

Now I put this dpi setting in kernel command line

androidboot.sf.lcd_density=128

but I do not see device to be in 128 dpi setting. Also

wm density
Physical density:160

Now this baffles me.Who gave 160dpi settings?

1. How putting setprop in init.$hardware.rc affects the display but not in kernel command line.

2. Who really processes setprop.
I tried putting prints like this

on boot
exec /system/bin/echo "Trigger test E"

I saw nothing, so does that mean boot event never happened?

0 Kudos
1 Solution
1,842 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

you can try running a service in the init.rc that is a script from a kernel command to change the density. I do not know if I made me understand.

It can be as below:

service script /system/bin/script.sh

    user root

    oneshot

And the script.sh will contain the commands to modify the screen density.

You will only need to place the scrip in the specified path.

Hope this can help you.

Best Regards,

Diego.

View solution in original post

1 Reply
1,843 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

you can try running a service in the init.rc that is a script from a kernel command to change the density. I do not know if I made me understand.

It can be as below:

service script /system/bin/script.sh

    user root

    oneshot

And the script.sh will contain the commands to modify the screen density.

You will only need to place the scrip in the specified path.

Hope this can help you.

Best Regards,

Diego.