Question

I've downloaded the Android Source from source.android.com build it and was able to run it successfully on an emulator.

Now I want to add new System Service to Android. I do not have much idea in building and running AOSP considering this is my first time doing so.

I followed this simple article in adding a TestService to AOSP. Added the new codes, modified SystemServer.java accordingly, but make command wasn't a success.

After the modifications I ran

make update-api
to update current.txt After which I ran
make -j4 command
which failed with the following errors.

frameworks/base/services/java/com/android/server/SystemServer.java:268: illegal character: \8220
            ServiceManager.addService(“Test”, new TestService(context));
                                      ^
frameworks/base/services/java/com/android/server/SystemServer.java:268: ';' expected
            ServiceManager.addService(“Test”, new TestService(context));
                                       ^
frameworks/base/services/java/com/android/server/SystemServer.java:268: illegal character: \8221
            ServiceManager.addService(“Test”, new TestService(context));
                                           ^
frameworks/base/services/java/com/android/server/SystemServer.java:268: ';' expected
            ServiceManager.addService(“Test”, new TestService(context));
                                            ^
frameworks/base/services/java/com/android/server/SystemServer.java:268: ';' expected
            ServiceManager.addService(“Test”, new TestService(context));
                                                                      ^

Clearly the errors are on the lines where I added couple of lines to SystemServer.java to register the Service. So how do I deal with compilation errors in the java files that I added/modified? I'm thinking this is something trivial, but don't have enough experience with AOSP get a hold of this. Any thoughts/suggestions appreciated.

Was it helpful?

Solution

As Chris pointed out it was due to "funny" quote which got sneaked in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top