1 /* 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 20 #include <aidl/android/media/IResourceManagerService.h> 21 #include <media/MediaResourcePolicy.h> 22 #include <utils/Log.h> 23 24 namespace android { 25 26 using aidl::android::media::IResourceManagerService; 27 //static kPolicySupportsMultipleSecureCodecs()28const char* MediaResourcePolicy::kPolicySupportsMultipleSecureCodecs() { 29 return IResourceManagerService::kPolicySupportsMultipleSecureCodecs; 30 } 31 //static kPolicySupportsSecureWithNonSecureCodec()32const char* MediaResourcePolicy::kPolicySupportsSecureWithNonSecureCodec() { 33 return IResourceManagerService::kPolicySupportsSecureWithNonSecureCodec; 34 } 35 MediaResourcePolicy(const std::string & type,const std::string & value)36MediaResourcePolicy::MediaResourcePolicy( 37 const std::string& type, const std::string& value) { 38 this->type = type; 39 this->value = value; 40 } 41 toString(const MediaResourcePolicyParcel & policy)42String8 toString(const MediaResourcePolicyParcel &policy) { 43 String8 str; 44 str.appendFormat("%s:%s", policy.type.c_str(), policy.value.c_str()); 45 return str; 46 } 47 48 }; // namespace android 49