Loading apex/Android.bp +20 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,26 @@ bootclasspath_fragment { // modified by the Soong or platform compat team. hidden_api: { max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"], // The following packages contain classes from other modules on the // bootclasspath. That means that the hidden API flags for this module // has to explicitly list every single class this module provides in // that package to differentiate them from the classes provided by other // modules. That can include private classes that are not part of the // API. split_packages: [ "android.media", ], // The following packages and all their subpackages currently only // contain classes from this bootclasspath_fragment. Listing a package // here won't prevent other bootclasspath modules from adding classes in // any of those packages but it will prevent them from adding those // classes into an API surface, e.g. public, system, etc.. Doing so will // result in a build failure due to inconsistent flags. package_prefixes: [ "android.media.internal", ], }, } Loading drm/libmediadrm/DrmHal.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -286,4 +286,11 @@ status_t DrmHal::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const { return mDrmHalHidl->getLogMessages(logs); } status_t DrmHal::getSupportedSchemes(std::vector<uint8_t> &schemes) const { status_t statusResult; statusResult = mDrmHalAidl->getSupportedSchemes(schemes); if (statusResult == OK) return statusResult; return mDrmHalHidl->getSupportedSchemes(schemes); } } // namespace android drm/libmediadrm/DrmHalAidl.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -1189,6 +1189,25 @@ std::string DrmHalAidl::reportFrameworkMetrics(const std::string& pluginMetrics) return serializedMetrics; } status_t DrmHalAidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const { Mutex::Autolock autoLock(mLock); if (mFactories.empty()) return UNKNOWN_ERROR; for (ssize_t i = mFactories.size() - 1; i >= 0; i--) { CryptoSchemes curSchemes{}; auto err = mFactories[i]->getSupportedCryptoSchemes(&curSchemes); if (!err.isOk()) { continue; } for (auto uuidObj : curSchemes.uuids) { schemes.insert(schemes.end(), uuidObj.uuid.begin(), uuidObj.uuid.end()); } } return OK; } void DrmHalAidl::cleanup() { closeOpenSessions(); Loading drm/libmediadrm/DrmHalHidl.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <aidl/android/media/BnResourceManagerClient.h> #include <android/binder_manager.h> #include <android/hardware/drm/1.2/types.h> #include <android/hardware/drm/1.3/IDrmFactory.h> #include <android/hidl/manager/1.2/IServiceManager.h> #include <hidl/ServiceManagement.h> #include <media/EventMetric.h> Loading Loading @@ -1514,4 +1515,23 @@ status_t DrmHalHidl::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const { return DrmUtils::GetLogMessages<drm::V1_4::IDrmPlugin>(mPlugin, logs); } status_t DrmHalHidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const { Mutex::Autolock autoLock(mLock); for (auto &factory : mFactories) { sp<drm::V1_3::IDrmFactory> factoryV1_3 = drm::V1_3::IDrmFactory::castFrom(factory); if (factoryV1_3 == nullptr) { continue; } factoryV1_3->getSupportedCryptoSchemes( [&](const hardware::hidl_vec<hardware::hidl_array<uint8_t, 16>>& schemes_hidl) { for (const auto &scheme : schemes_hidl) { schemes.insert(schemes.end(), scheme.data(), scheme.data() + scheme.size()); } }); } return OK; } } // namespace android drm/libmediadrm/include/mediadrm/DrmHal.h +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ struct DrmHal : public IDrm { Vector<uint8_t> const &sessionId, const char *playbackId); virtual status_t getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const; virtual status_t getSupportedSchemes(std::vector<uint8_t> &schemes) const; private: sp<IDrm> mDrmHalHidl; Loading Loading
apex/Android.bp +20 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,26 @@ bootclasspath_fragment { // modified by the Soong or platform compat team. hidden_api: { max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"], // The following packages contain classes from other modules on the // bootclasspath. That means that the hidden API flags for this module // has to explicitly list every single class this module provides in // that package to differentiate them from the classes provided by other // modules. That can include private classes that are not part of the // API. split_packages: [ "android.media", ], // The following packages and all their subpackages currently only // contain classes from this bootclasspath_fragment. Listing a package // here won't prevent other bootclasspath modules from adding classes in // any of those packages but it will prevent them from adding those // classes into an API surface, e.g. public, system, etc.. Doing so will // result in a build failure due to inconsistent flags. package_prefixes: [ "android.media.internal", ], }, } Loading
drm/libmediadrm/DrmHal.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -286,4 +286,11 @@ status_t DrmHal::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const { return mDrmHalHidl->getLogMessages(logs); } status_t DrmHal::getSupportedSchemes(std::vector<uint8_t> &schemes) const { status_t statusResult; statusResult = mDrmHalAidl->getSupportedSchemes(schemes); if (statusResult == OK) return statusResult; return mDrmHalHidl->getSupportedSchemes(schemes); } } // namespace android
drm/libmediadrm/DrmHalAidl.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -1189,6 +1189,25 @@ std::string DrmHalAidl::reportFrameworkMetrics(const std::string& pluginMetrics) return serializedMetrics; } status_t DrmHalAidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const { Mutex::Autolock autoLock(mLock); if (mFactories.empty()) return UNKNOWN_ERROR; for (ssize_t i = mFactories.size() - 1; i >= 0; i--) { CryptoSchemes curSchemes{}; auto err = mFactories[i]->getSupportedCryptoSchemes(&curSchemes); if (!err.isOk()) { continue; } for (auto uuidObj : curSchemes.uuids) { schemes.insert(schemes.end(), uuidObj.uuid.begin(), uuidObj.uuid.end()); } } return OK; } void DrmHalAidl::cleanup() { closeOpenSessions(); Loading
drm/libmediadrm/DrmHalHidl.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <aidl/android/media/BnResourceManagerClient.h> #include <android/binder_manager.h> #include <android/hardware/drm/1.2/types.h> #include <android/hardware/drm/1.3/IDrmFactory.h> #include <android/hidl/manager/1.2/IServiceManager.h> #include <hidl/ServiceManagement.h> #include <media/EventMetric.h> Loading Loading @@ -1514,4 +1515,23 @@ status_t DrmHalHidl::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const { return DrmUtils::GetLogMessages<drm::V1_4::IDrmPlugin>(mPlugin, logs); } status_t DrmHalHidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const { Mutex::Autolock autoLock(mLock); for (auto &factory : mFactories) { sp<drm::V1_3::IDrmFactory> factoryV1_3 = drm::V1_3::IDrmFactory::castFrom(factory); if (factoryV1_3 == nullptr) { continue; } factoryV1_3->getSupportedCryptoSchemes( [&](const hardware::hidl_vec<hardware::hidl_array<uint8_t, 16>>& schemes_hidl) { for (const auto &scheme : schemes_hidl) { schemes.insert(schemes.end(), scheme.data(), scheme.data() + scheme.size()); } }); } return OK; } } // namespace android
drm/libmediadrm/include/mediadrm/DrmHal.h +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ struct DrmHal : public IDrm { Vector<uint8_t> const &sessionId, const char *playbackId); virtual status_t getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const; virtual status_t getSupportedSchemes(std::vector<uint8_t> &schemes) const; private: sp<IDrm> mDrmHalHidl; Loading