blob: afa971d9de9617c5bd37395a4adba90c23901725 [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"
Chong Zhangfdd512a2019-11-22 11:03:14 -080019
20#include <aidl/android/media/IResourceManagerService.h>
Ronghua Wu231c3d12015-03-11 15:10:32 -070021#include <media/MediaResourcePolicy.h>
Chong Zhangfdd512a2019-11-22 11:03:14 -080022#include <utils/Log.h>
Ronghua Wu231c3d12015-03-11 15:10:32 -070023
24namespace android {
25
Chong Zhangfdd512a2019-11-22 11:03:14 -080026using aidl::android::media::IResourceManagerService;
Chong Zhang181e6952019-10-09 13:23:39 -070027//static
Chong Zhangfdd512a2019-11-22 11:03:14 -080028const char* MediaResourcePolicy::kPolicySupportsMultipleSecureCodecs() {
29 return IResourceManagerService::kPolicySupportsMultipleSecureCodecs;
Chong Zhang181e6952019-10-09 13:23:39 -070030}
31//static
Chong Zhangfdd512a2019-11-22 11:03:14 -080032const char* MediaResourcePolicy::kPolicySupportsSecureWithNonSecureCodec() {
33 return IResourceManagerService::kPolicySupportsSecureWithNonSecureCodec;
Ronghua Wu231c3d12015-03-11 15:10:32 -070034}
35
Chong Zhang181e6952019-10-09 13:23:39 -070036MediaResourcePolicy::MediaResourcePolicy(
37 const std::string& type, const std::string& value) {
38 this->type = type;
39 this->value = value;
Ronghua Wu231c3d12015-03-11 15:10:32 -070040}
41
Chong Zhang181e6952019-10-09 13:23:39 -070042String8 toString(const MediaResourcePolicyParcel &policy) {
Ronghua Wu231c3d12015-03-11 15:10:32 -070043 String8 str;
Chong Zhang181e6952019-10-09 13:23:39 -070044 str.appendFormat("%s:%s", policy.type.c_str(), policy.value.c_str());
Ronghua Wu231c3d12015-03-11 15:10:32 -070045 return str;
46}
47
48}; // namespace android