blob: 39708c2f013df5e6b97e057efe1c4a3a5ff0f5a5 [file] [log] [blame]
Eric Laurent27ef4d82016-10-14 15:46:06 -07001/*
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
17#define LOG_TAG "soundtriggerhal"
18
19#include <hwbinder/IInterface.h>
20#include <hwbinder/IPCThreadState.h>
21#include <hwbinder/ProcessState.h>
Eric Laurent27ef4d82016-10-14 15:46:06 -070022#include <utils/Errors.h>
23#include <utils/Log.h>
24#include <utils/Looper.h>
25#include <utils/StrongPointer.h>
26#include <android/hardware/soundtrigger/2.0/ISoundTriggerHw.h>
27
28using android::hardware::IPCThreadState;
29using android::hardware::ProcessState;
30using android::hardware::soundtrigger::V2_0::ISoundTriggerHw;
31
32int main(int /* argc */, char* /* argv */ []) {
33 android::sp<ISoundTriggerHw> service =
34 ISoundTriggerHw::getService("sound_trigger.primary", true /* getStub */);
35
36 service->registerAsService("sound_trigger.primary");
37
38 ProcessState::self()->setThreadPoolMaxThreadCount(0);
39 ProcessState::self()->startThreadPool();
40 IPCThreadState::self()->joinThreadPool();
41}