diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2015-04-01 22:39:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-01 22:39:52 +0000 |
commit | da2246b54e3eed9e9366c98688b19f997d869e79 (patch) | |
tree | d771c73b97063bda218171afab8cb2303e1999f5 /services/audiopolicy/enginedefault/src/EngineInstance.cpp | |
parent | 91b7a7b5343c5b6fccd9356449dfd393d0d66f35 (diff) | |
parent | 2110e04cdfbf9ad85ce154ce5f778ee5ccfc95eb (diff) | |
download | frameworks_av-da2246b54e3eed9e9366c98688b19f997d869e79.zip frameworks_av-da2246b54e3eed9e9366c98688b19f997d869e79.tar.gz frameworks_av-da2246b54e3eed9e9366c98688b19f997d869e79.tar.bz2 |
Merge "Split ManagerDefault into manager and engine"
Diffstat (limited to 'services/audiopolicy/enginedefault/src/EngineInstance.cpp')
-rwxr-xr-x | services/audiopolicy/enginedefault/src/EngineInstance.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/services/audiopolicy/enginedefault/src/EngineInstance.cpp b/services/audiopolicy/enginedefault/src/EngineInstance.cpp new file mode 100755 index 0000000..17e9832 --- /dev/null +++ b/services/audiopolicy/enginedefault/src/EngineInstance.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <AudioPolicyManagerInterface.h> +#include "AudioPolicyEngineInstance.h" +#include "Engine.h" + +namespace android +{ +namespace audio_policy +{ + +EngineInstance::EngineInstance() +{ +} + +EngineInstance *EngineInstance::getInstance() +{ + static EngineInstance instance; + return &instance; +} + +EngineInstance::~EngineInstance() +{ +} + +Engine *EngineInstance::getEngine() const +{ + static Engine engine; + return &engine; +} + +template <> +AudioPolicyManagerInterface *EngineInstance::queryInterface() const +{ + return getEngine()->queryInterface<AudioPolicyManagerInterface>(); +} + +} // namespace audio_policy +} // namespace android + |