jcxmej
jcxmej

Reputation: 51

Creating system service in android

I tried implementing a custom HAL, API and system service with this link https://github.com/nayobix/add-new-hardware-hal-android-5-lollipop (Also checked few others)

I followed every instruction and code and made the system.img.

I am using Android 5.1.1 source to build the system image.

But the device doesnt boot up when I checked the logcat in Android Studio. I found the system service is not loading.

08-09 11:32:27.123 160-160/? I/DEBUG: Abort message: 'art/runtime/jni_internal.cc:769] JNI FatalError called: Native registration unable to find class 'com/android/server/ZigbeeService'; aborting...'
08-09 11:32:27.123 160-160/? I/DEBUG:     #09 pc 000174bd  /system/lib/libandroid_servers.so (JNI_OnLoad+172)
08-09 11:32:27.336 20208-20208/? E/Zygote: Exit zygote because system server (20435) has terminated

Also while compiling, I got some warning like.

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Upvotes: 1

Views: 1404

Answers (2)

jcxmej
jcxmej

Reputation: 51

Solved it. Had to start from scratch, rebuilding and compiling the entire source.

The github was little incorrect. Actually I had to create another folder to put the service java class file. Which is why android couldnt find it (as per the debug message).

Happens when you follow someone elses work blindly. Thanks for the help guys.

Upvotes: 1

Larry Schiefer
Larry Schiefer

Reputation: 15775

The code in that project is for 5.0.1 (Lollipop), where you are building for 5.1.1 (also Lollipop, but different). Be sure that the core framework, HAL, etc. files were just patched with the changes from this repo into your AOSP rather than copied over. If you simply copied over the files from this repo, you likely wiped out something which was added to system server or other framework components in between 5.0.1 and 5.1.1. You will most likely need to manually examine and patch the files.

Upvotes: 0

Related Questions