1 /* 2 * Copyright (C) 2021 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 #pragma once 17 18 #include <aidl/android/hardware/drm/BnDrmFactory.h> 19 #include <aidl/android/hardware/drm/IDrmFactory.h> 20 #include <aidl/android/hardware/drm/IDrmPlugin.h> 21 #include <aidl/android/hardware/drm/ICryptoPlugin.h> 22 23 #include <string> 24 #include <vector> 25 26 #include "ClearKeyTypes.h" 27 28 namespace aidl { 29 namespace android { 30 namespace hardware { 31 namespace drm { 32 namespace clearkey { 33 34 struct DrmFactory : public BnDrmFactory { DrmFactoryDrmFactory35 DrmFactory() {} ~DrmFactoryDrmFactory36 virtual ~DrmFactory() {} 37 38 ::ndk::ScopedAStatus createDrmPlugin( 39 const ::aidl::android::hardware::drm::Uuid& in_uuid, 40 const std::string& in_appPackageName, 41 std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin>* _aidl_return) override; 42 43 ::ndk::ScopedAStatus createCryptoPlugin( 44 const ::aidl::android::hardware::drm::Uuid& in_uuid, 45 const std::vector<uint8_t>& in_initData, 46 std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin>* _aidl_return) override; 47 48 ::ndk::ScopedAStatus getSupportedCryptoSchemes( 49 ::aidl::android::hardware::drm::CryptoSchemes* _aidl_return) override; 50 51 binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; 52 53 54 private: 55 CLEARKEY_DISALLOW_COPY_AND_ASSIGN(DrmFactory); 56 }; 57 58 } // namespace clearkey 59 } // namespace drm 60 } // namespace hardware 61 } // namespace android 62 } // namespace aidl 63