189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project/*
289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project**
389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** Copyright 2008, The Android Open Source Project
489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project**
589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");
689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** you may not use this file except in compliance with the License.
789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** You may obtain a copy of the License at
889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project**
989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project**     http://www.apache.org/licenses/LICENSE-2.0
1089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project**
1189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** Unless required by applicable law or agreed to in writing, software
1289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** distributed under the License is distributed on an "AS IS" BASIS,
1389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** See the License for the specific language governing permissions and
1589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project** limitations under the License.
1689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project*/
1789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
1833df529414c248972587d97cbb2e3309e0a7eeffGlenn Kasten#define LOG_TAG "mediaserver"
19b4d307481960b6b348fae4b4e8edefd003c3d36cGlenn Kasten//#define LOG_NDEBUG 0
2033df529414c248972587d97cbb2e3309e0a7eeffGlenn Kasten
217562408b2261d38415453378b6188f74fda99d88Mathias Agopian#include <binder/IPCThreadState.h>
227562408b2261d38415453378b6188f74fda99d88Mathias Agopian#include <binder/ProcessState.h>
237562408b2261d38415453378b6188f74fda99d88Mathias Agopian#include <binder/IServiceManager.h>
2489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project#include <utils/Log.h>
25feb2179f15bde8241814c8c35f8dace13a923ee7Glenn Kasten#include "RegisterExtensions.h"
2689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
27b4d307481960b6b348fae4b4e8edefd003c3d36cGlenn Kasten// from LOCAL_C_INCLUDES
28e924b6729bd9c0ef3f043e1f150a1923ecc94999Marco Nelissen#include "IcuUtils.h"
29b4d307481960b6b348fae4b4e8edefd003c3d36cGlenn Kasten#include "MediaPlayerService.h"
3067e7f543c7f1c4fe4ee1989ceb0aebe44a63b49eRonghua Wu#include "ResourceManagerService.h"
3189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
3289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Projectusing namespace android;
3389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
34dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissenint main(int argc __unused, char **argv __unused)
3589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project{
36879d503a5d4460a4265279985c63af954afe4a2cGlenn Kasten    signal(SIGPIPE, SIG_IGN);
37dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen
38dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    sp<ProcessState> proc(ProcessState::self());
39dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    sp<IServiceManager> sm(defaultServiceManager());
40dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    ALOGI("ServiceManager: %p", sm.get());
41e924b6729bd9c0ef3f043e1f150a1923ecc94999Marco Nelissen    InitializeIcuOrDie();
42dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    MediaPlayerService::instantiate();
43dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    ResourceManagerService::instantiate();
44dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    registerExtensions();
45dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    ProcessState::self()->startThreadPool();
46dcb346b7dc5b88c3e85db8a70bbd6a2fee8192b9Marco Nelissen    IPCThreadState::self()->joinThreadPool();
4789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project}
48