blob: c463179d495220b746665a20dda947c0c7023f97 [file] [log] [blame]
Ronghua Wu231c3d12015-03-11 15:10:32 -07001/*
2 * Copyright 2015 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_NDEBUG 0
18#define LOG_TAG "MediaResourcePolicy"
19#include <utils/Log.h>
20#include <media/MediaResourcePolicy.h>
Chong Zhang181e6952019-10-09 13:23:39 -070021#include <android/media/IResourceManagerService.h>
Ronghua Wu231c3d12015-03-11 15:10:32 -070022
23namespace android {
24
Chong Zhang181e6952019-10-09 13:23:39 -070025using android::media::IResourceManagerService;
26//static
27const ::std::string& MediaResourcePolicy::kPolicySupportsMultipleSecureCodecs() {
28 return IResourceManagerService::kPolicySupportsMultipleSecureCodecs();
29}
30//static
31const ::std::string& MediaResourcePolicy::kPolicySupportsSecureWithNonSecureCodec() {
32 return IResourceManagerService::kPolicySupportsSecureWithNonSecureCodec();
Ronghua Wu231c3d12015-03-11 15:10:32 -070033}
34
Chong Zhang181e6952019-10-09 13:23:39 -070035MediaResourcePolicy::MediaResourcePolicy(
36 const std::string& type, const std::string& value) {
37 this->type = type;
38 this->value = value;
Ronghua Wu231c3d12015-03-11 15:10:32 -070039}
40
Chong Zhang181e6952019-10-09 13:23:39 -070041String8 toString(const MediaResourcePolicyParcel &policy) {
Ronghua Wu231c3d12015-03-11 15:10:32 -070042 String8 str;
Chong Zhang181e6952019-10-09 13:23:39 -070043 str.appendFormat("%s:%s", policy.type.c_str(), policy.value.c_str());
Ronghua Wu231c3d12015-03-11 15:10:32 -070044 return str;
45}
46
47}; // namespace android