Medialess Android System

502 views
Skip to first unread message

Mauricio Cirelli

unread,
Aug 4, 2014, 1:00:06 PM8/4/14
to android...@googlegroups.com
Dear community,

I am working on a very specific device which does not have a display nor any kind of audio hardware. However, it does have GPS, Bluetooth,  Wifi, 3G, sensors and other peripherals. We would like to use the Android SDK to develop apps for such a device, but we would like to disable multimedia and user-input features.

I would like to know if it is possible to have a working Android build that does not run any multimedia or user-interface related features, such as images, videos, audio or user-input (touch or keyboards). I  have looked into TINY ANDROID (https://wiki.linaro.org/Platform/Android/UseTinyAndroid), but it is  way too tiny.. It does not have zygote or system server, which we need.

Is it a matter of removing mediaservice and surfaceflinger from  init.rc or do I need to do further changes? We do need it to boot fast and start running apps as soon as possible. I believe (please, correct me if I am wrong) that removing such services, boot would complete faster and apps listening to boot complete intent would start faster.

Any help would be much appreciated.

Thank you.

zoli2k

unread,
Aug 5, 2014, 10:25:31 AM8/5/14
to android...@googlegroups.com
Hi,

you could create a service with dummy implementation of the SurfaceFlinger's binder interface (used by the SurfaceComposerClient).
You can disable the media player service, or replace StageFright path with the TestPlayer path in case you still going to have apps that
may use the MediaPlayer API.
You can gain some boot time by modifying the preloaded library list.

Br,

Zoltan

Stuart Small

unread,
Aug 6, 2014, 2:14:10 PM8/6/14
to android...@googlegroups.com
I would try the system property "config.disable_media"

Mauricio Cirelli

unread,
Aug 6, 2014, 6:06:45 PM8/6/14
to android...@googlegroups.com
Dear zoli2k,

Thank you for your interest and time.

This device is not supposed to have any media related feature. It will not have a touch screen display, keyboard or audio hardware. Is that needed to create a dummy binder interface for SurfaceFlinger? I may be wrong, but I was expecting that if I do not need an Android Feature, then I could just remove it from the build. Is that true or such media related services are so tighly coupled to the whole Android Framework?

Thank you!

Mauricio Cirelli

unread,
Aug 6, 2014, 6:21:37 PM8/6/14
to android...@googlegroups.com
I will have a look into that!

Searching for config.disable_media into this group I have found another thread which mentions some other interesting properties in frameworks/base/services/java/
com/android/server/SystemServer.java, a quick grep yields:

        String factoryTestStr = SystemProperties.get("ro.factorytest");
        final boolean headless = "1".equals(SystemProperties.get("ro.config.headless", "0"));
        boolean disableStorage = SystemProperties.getBoolean("config.disable_storage", false);
        boolean disableMedia = SystemProperties.getBoolean("config.disable_media", false);
        boolean disableBluetooth = SystemProperties.getBoolean("config.disable_bluetooth", false);
        boolean disableTelephony = SystemProperties.getBoolean("config.disable_telephony", false);
        boolean disableLocation = SystemProperties.getBoolean("config.disable_location", false);
        boolean disableSystemUI = SystemProperties.getBoolean("config.disable_systemui", false);
        boolean disableNonCoreServices = SystemProperties.getBoolean("config.disable_noncore", false);
        boolean disableNetwork = SystemProperties.getBoolean("config.disable_network", false);
:
Having a look into SystemServer.java, I think disabling media, system UI, NonCoreServices (will it disable ADB, as it would disable USB Manager?)
Also, I think I could remove media, surfaceflinger and bootanim services from init.rc would do the trick.

What do you think?

Thank you for your interest and time in our problem!

Stuart Small

unread,
Aug 7, 2014, 1:31:03 AM8/7/14
to android...@googlegroups.com
If there is no UI I would also put ro.config.headless on the list.

For a few reasons I strongly favor config options over direct changes to AOSP given the choice.  Its worth the grep time to see if there is anything you can do before editing that init.rc. For example you can use "debug.sf.nobootanimation" instead of removing bootanim.  I don't know about anything for surfaceflinger though.  Sorry I can't help out there.
Reply all
Reply to author
Forward
0 new messages