Ejemplo n.º 1
0
    virtual void onStarted()
    {
        sp<ProcessState> proc = ProcessState::self();
        ALOGV("App process: starting thread pool.\n");
        proc->startThreadPool();

        AndroidRuntime* ar = AndroidRuntime::getRuntime();
        ar->callMain(mClassName, mClass, mArgC, mArgV);

        IPCThreadState::self()->stopProcess();
    }
Ejemplo n.º 2
0
    virtual void onStarted()
    {
        sp<ProcessState> proc = ProcessState::self();
        ALOGV("App process: starting thread pool.\n");
        proc->startThreadPool();

        AndroidRuntime* ar = AndroidRuntime::getRuntime();
#if PLATFORM_SDK_VERSION < 14
        ar->callMain(mClassName, mArgC, mArgV);
#else
        ar->callMain(mClassName, mClass, mArgC, mArgV);
#endif

        IPCThreadState::self()->stopProcess();
    }
Ejemplo n.º 3
0
/******************************************************************************
 * frameworks/base/cmds/system_server/library/system_init.cpp
 * frameworks/base/cmds/system_server/system_main.cpp
 *
 * Execuable name: system_server
 *
 * following modules call system server
./frameworks/base/cmds/system_server/Android.mk:	libsystem_server
./frameworks/base/cmds/system_server/library/Android.mk:LOCAL_MODULE:= libsystem_server
./frameworks/base/cmds/runtime/Android.mk:	libsystem_server \
./frameworks/base/services/jni/Android.mk:    libsystem_server \

 * TODO:
 * The difference between system_server and media_server
 * http://blog.sina.com.cn/s/blog_54b5ea250100ecin.html
 * http://linux.chinaunix.net/bbs/redirect.php?fid=62&tid=1152085&goto=nextnewset
 *
 */
extern "C" status_t system_init()
{
    sp<ProcessState> proc(ProcessState::self());
    // register surface flinger
    SurfaceFlinger::instantiate();

    // start other service
    AudioFlinger::instantiate();
    MediaPlayerService::instantiate();
    AudioPolicyService::instantiate();
    CameraService::instantiate();

    // And now start the Android runtime.  We have to do this bit
    // of nastiness because the Android runtime initialization requires
    // some of the core system services to already be started.
    // All other servers should just start the Android runtime at
    // the beginning of their processes's main(), before calling
    // the init function.
    AndroidRuntime* runtime = AndroidRuntime::getRuntime();
    runtime->callStatic("com/android/server/SystemServer", "init2");
}