Not able to start my system service added to system_server

Hi,
I have followed the steps mentioned in the link given below to add a system service in Einfochip’s board for Nougat.

But the changes added to SystemServer.java file not reflecting. Checked by keeping some logs.

Please can anyone help me out.

You should remove Dragonboard 820c tag if your issue is not related to this board.

Could you explain a bit more the problem, did you try to add debug message and rebuild/flash android ?

Yes. even i am not getting the logs i added to that file. Its taking the old code only without my changes.
I even tried by giving clean build and flashing the images.
But that file is getting compiled while building. (checked by producing some syntax error).

Checked the services.jar file through dexdump, and found that SystemServer class is part of that jar.
But why the changes i added to that file are not reflecting?

So if your changes are correctly build into an image, you probably do not correctly flash the device. How do you flash your device? I assume this systemservice is part of system.img.

Yes.
I am flashing the images through fastboot. Thats not a problem.

I checked the dmesg logs, SElinux issue as below
audit: type=1400 audit(21.109:3): avc: denied { execute_no_trans } for pid=399 comm=“init” path="/system/bin/mkswap" dev=“sde18” ino=455 scontext=u:r:init:s0

How to resolve this?

Is mkswap related to your service ? If not, I don’t think this is related to your issue, If yes you need to define a sepolicy domain and add correct rights.


https://discuss.96boards.org/t/how-to-use-uart3-for-bluetooth-hci/3346/12

https://source.android.com/security/selinux/validate

Hi Loic
I have resolved all avc:denied issues using audit2allow. SystemServer is not crashing like before.

But still the changes added to the SystemServer are not reflecting. Is it need clean build or what is the issue?
Even i am not getting the logs added to SystemServer.java file. I have checked by building and again flashing new images. Really i am not getting what is the issue

Could you please first try md5sum on the system server jar in both your build output and on the target.

Hi Loic

I am not even getting the logs i have added to SystemServer.java file. What could be the reason?

After build only my service class is not adding into services.jar.
But i can find my service class in services.core_intermediates
Whatever i do changes which go as part of services.jar are not reflecting :frowning:
Even after clean build

Hi Loic

The issue got resolved.
Actually the vendor has kept a prebuilt services.jar. So it was not taking my changes.

Thanks for your response.