161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti/* Copyright (C) 2007 The Android Open Source Project
261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
361e21a4fe27118141afc13323807f83b733cf426Uday Kishore PasupuletiCopyright (c) 2012-2013, The Linux Foundation. All rights reserved.
461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
561e21a4fe27118141afc13323807f83b733cf426Uday Kishore PasupuletiNot a Contribution, Apache license notifications and license are retained
661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuletifor attribution purposes only.
761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* Licensed under the Apache License, Version 2.0 (the "License");
961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* you may not use this file except in compliance with the License.
1061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* You may obtain a copy of the License at
1161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti*
1261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* http://www.apache.org/licenses/LICENSE-2.0
1361e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti*
1461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* Unless required by applicable law or agreed to in writing, software
1561e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* distributed under the License is distributed on an "AS IS" BASIS,
1661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* See the License for the specific language governing permissions and
1861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti* limitations under the License.
1961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti*/
2061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
2161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#define LOG_TAG "AudioDaemonMain"
2261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#define LOG_NDEBUG 0
2361e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#define LOG_NDDEBUG 0
2461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
2561e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <cutils/properties.h>
2661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
2761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <binder/IPCThreadState.h>
2861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <binder/ProcessState.h>
2961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <binder/IServiceManager.h>
3061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
3161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <utils/Log.h>
3261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include <utils/threads.h>
3361e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
3461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#if defined(HAVE_PTHREADS)
3561e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti# include <pthread.h>
3661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti# include <sys/resource.h>
3761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#endif
3861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
3961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#include "AudioDaemon.h"
4061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
4161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuletiusing namespace android;
4261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
4361e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti// ---------------------------------------------------------------------------
4461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
4561e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuletiint main(int argc, char** argv)
4661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti{
4761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#if defined(HAVE_PTHREADS)
4861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_AUDIO);
4961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti#endif
5061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
5161e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
5261e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    ALOGV("Audio daemon starting sequence..");
5361e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    sp<ProcessState> proc(ProcessState::self());
5461e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    ProcessState::self()->startThreadPool();
5561e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
5661e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    sp<AudioDaemon> audioService = new AudioDaemon();
5761e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    IPCThreadState::self()->joinThreadPool();
5861e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti
5961e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti    return 0;
6061e21a4fe27118141afc13323807f83b733cf426Uday Kishore Pasupuleti}
61