This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Battery Service

Hi,

I would like to know on how to remove the battery and wallpaper service from the android source for non-phone devices.

Thanks,

Swami

  • Hi Swami,

    I think you are the one who asked this question at droidcon'2011. Sorry I was not present on second day

    Anyways, open below file and comment battery service initialization.

    :<android-src>/frameworks/base/services/java/com/android/server/SystemServer.java

    http://processors.wiki.ti.com/index.php/Android_gingerbread_memory_analysis_for_non-phone_device

    BR,

    satish

  • Hi Satish,

    Thanks for the reply. Yes I asked you this at Droidcon 2011. I will try this out. I'd also like to know if this is the best way to eliminate battery out of a non-phone device that is driven by external power. For example I altered makefiles to remove phone, browser and other features that I dont need, in such cases all this will not go into the build. What you have suggest will work for me, but I was wondering if there were other ways. Thanks for your time.

    Regards,

    Swami.

  • Hi Swami,

    Such like other configuration, there is not file exist from which we can configure all services for the build.

    However one can always go through indivial make file and remove unwanted code.. but it will go in lot of build errors and dependency loop...

    What ever way I have suggested is simplest one...You can always go through source code and find out other ways...:)

    BR,

    satish

  • Hi Satish,

    I was busy with some other task over the last two weeks and now I am back with work on Android.

    I tried what you suggested, I commented out "if (wallpaper != null) wallpaperF.systemReady();" from SystemServer.java and this resulted in a black background on the emulator. So looks like it is working as expected, I have one observation here - clicking on menu I get option to change the Wallpaper and I still can set a Wallpaper. Are there more code changes need to be done so that I dont see the options under menu? 

    Similarly I commented out the battery init from SystemServer.java "if(batteryF != null) batteryF.systemReady();" after this I still see the battery icon on the status bar. This I could make invisible from the file StatusBarPolicy.java . Is this the correct approach? 

    Thanks,

    Swami

  • Hi Swami,

    1. I need to check about wallpaper issue, ideally you should not be able to set the wallpaper, as service it self will not  be running..

    2. For battery issue, you are on track.

    -

    satish