blob: aa89180c23ebfc3df47a1feb15d9862a999d61b3 [file] [log] [blame]
Phil Burk2355edb2016-12-26 13:54:02 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Phil Burk5ed503c2017-02-01 09:38:15 -080017#define LOG_TAG "AAudioService"
Phil Burk2355edb2016-12-26 13:54:02 -080018//#define LOG_NDEBUG 0
19#include <utils/Log.h>
20
21#include <stdint.h>
22#include <math.h>
23
24#include <utils/RefBase.h>
25#include <binder/TextOutput.h>
26
27#include <binder/IInterface.h>
28#include <binder/IBinder.h>
29#include <binder/ProcessState.h>
30#include <binder/IServiceManager.h>
31#include <binder/IPCThreadState.h>
32
33#include <cutils/ashmem.h>
34#include <sys/mman.h>
35
Phil Burk5ed503c2017-02-01 09:38:15 -080036#include "AAudioServiceDefinitions.h"
37#include "IAAudioService.h"
38#include "AAudioService.h"
Phil Burk2355edb2016-12-26 13:54:02 -080039
40using namespace android;
Phil Burk5ed503c2017-02-01 09:38:15 -080041using namespace aaudio;
Phil Burk2355edb2016-12-26 13:54:02 -080042
43/**
Phil Burk5ed503c2017-02-01 09:38:15 -080044 * This is used to test the AAudioService as a standalone application.
45 * It is not used when the AAudioService is integrated with AudioFlinger.
Phil Burk2355edb2016-12-26 13:54:02 -080046 */
47int main(int argc, char **argv) {
Phil Burk5ed503c2017-02-01 09:38:15 -080048 printf("Test AAudioService %s\n", argv[1]);
49 ALOGD("This is the AAudioService");
Phil Burk2355edb2016-12-26 13:54:02 -080050
Phil Burk5ed503c2017-02-01 09:38:15 -080051 defaultServiceManager()->addService(String16("AAudioService"), new AAudioService());
Phil Burk2355edb2016-12-26 13:54:02 -080052 android::ProcessState::self()->startThreadPool();
Phil Burk5ed503c2017-02-01 09:38:15 -080053 printf("AAudioService service is now ready\n");
Phil Burk2355edb2016-12-26 13:54:02 -080054 IPCThreadState::self()->joinThreadPool();
Phil Burk5ed503c2017-02-01 09:38:15 -080055 printf("AAudioService service thread joined\n");
Phil Burk2355edb2016-12-26 13:54:02 -080056
57 return 0;
58}