wv hidl: upgrade Drm/Crypto factories to v1.3

Bug: 139134043
Test: MediaDrmTest
Change-Id: I94d1cc8a323c144805d74d5568944dd48ae80e60
This commit is contained in:
Robert Shih
2019-12-02 16:20:13 -08:00
parent 2443fe807a
commit 8fce3e316b
25 changed files with 180 additions and 41 deletions

View File

@@ -12,7 +12,7 @@
namespace wvdrm {
namespace hardware {
namespace drm {
namespace V1_2 {
namespace V1_3 {
namespace widevine {
extern "C" {
@@ -27,7 +27,7 @@ ICryptoFactory* createCryptoFactory() {
} // extern "C"
} // namespace widevine
} // namespace V1_2
} // namespace V1_3
} // namespace drm
} // namespace hardware
} // namespace wvdrm

View File

@@ -19,9 +19,11 @@
namespace wvdrm {
namespace hardware {
namespace drm {
namespace V1_2 {
namespace V1_3 {
namespace widevine {
using wvdrm::hardware::drm::V1_2::widevine::WVCryptoPlugin;
Return<bool> WVCryptoFactory::isCryptoSchemeSupported(
const hidl_array<uint8_t, 16>& uuid) {
return isWidevineUUID(uuid.data());
@@ -52,7 +54,7 @@ Return<void> WVCryptoFactory::createPlugin(
}
} // namespace widevine
} // namespace V1_2
} // namespace V1_3
} // namespace drm
} // namespace hardware
} // namespace wvdrm

View File

@@ -22,9 +22,11 @@
namespace wvdrm {
namespace hardware {
namespace drm {
namespace V1_2 {
namespace V1_3 {
namespace widevine {
using wvdrm::hardware::drm::V1_2::widevine::WVDrmPlugin;
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
Return<bool> WVDrmFactory::isCryptoSchemeSupported(
@@ -67,7 +69,7 @@ Return<void> WVDrmFactory::createPlugin(
const auto& self = android::hardware::IPCThreadState::self();
const char* sid = self->getCallingSid();
sid = sid ? (strstr(sid, "mediadrmserver") ? sid : "app") : "nullptr";
ALOGI("[%s] calling %s", sid, __PRETTY_FUNCTION__);
ALOGI("[%s][%s] calling %s", sid, appPackageName.c_str(), __PRETTY_FUNCTION__);
sp<IDrmPlugin> plugin;
if (!isCryptoSchemeSupported(uuid.data())) {
@@ -112,9 +114,17 @@ int32_t WVDrmFactory::firstApiLevel() {
return firstApiLevel;
}
Return<void> WVDrmFactory::getSupportedCryptoSchemes(getSupportedCryptoSchemes_cb _hidl_cb) {
std::vector<hidl_array<uint8_t, 16>> schemes;
for (const auto &scheme : wvdrm::getSupportedCryptoSchemes()) {
schemes.push_back(scheme);
}
_hidl_cb(schemes);
return Void();
}
} // namespace widevine
} // namespace V1_2
} // namespace V1_3
} // namespace drm
} // namespace hardware
} // namespace wvdrm

View File

@@ -17,6 +17,7 @@ service vendor.drm-widevine-hal-1-2 /vendor/bin/hw/android.hardware.drm@1.2-serv
interface android.hardware.drm@1.2::ICryptoFactory widevine
interface android.hardware.drm@1.2::IDrmFactory widevine
interface android.hidl.base@1.0::IBase widevine
disabled
class hal
user media
group media mediadrm drmrpc system

View File

@@ -0,0 +1,28 @@
on property:init.svc.mediadrm=running
mkdir /data/vendor/mediadrm 0770 media mediadrm
start vendor.move_data_sh
service vendor.move_data_sh /system/bin/move_widevine_data.sh
class late_start
user media
group media mediadrm system
disabled
oneshot
service vendor.drm-widevine-hal-1-3 /vendor/bin/hw/android.hardware.drm@1.3-service-lazy.widevine
interface android.hardware.drm@1.0::ICryptoFactory widevine
interface android.hardware.drm@1.0::IDrmFactory widevine
interface android.hardware.drm@1.1::ICryptoFactory widevine
interface android.hardware.drm@1.1::IDrmFactory widevine
interface android.hardware.drm@1.2::ICryptoFactory widevine
interface android.hardware.drm@1.2::IDrmFactory widevine
interface android.hardware.drm@1.3::ICryptoFactory widevine
interface android.hardware.drm@1.3::IDrmFactory widevine
interface android.hidl.base@1.0::IBase widevine
oneshot
disabled
class hal
user media
group media mediadrm drmrpc system
ioprio rt 4
writepid /dev/cpuset/foreground/tasks

View File

@@ -0,0 +1,26 @@
on property:init.svc.mediadrm=running
mkdir /data/vendor/mediadrm 0770 media mediadrm
start vendor.move_data_sh
service vendor.move_data_sh /system/bin/move_widevine_data.sh
class late_start
user media
group media mediadrm system
disabled
oneshot
service vendor.drm-widevine-hal-1-3 /vendor/bin/hw/android.hardware.drm@1.3-service.widevine
interface android.hardware.drm@1.0::ICryptoFactory widevine
interface android.hardware.drm@1.0::IDrmFactory widevine
interface android.hardware.drm@1.1::ICryptoFactory widevine
interface android.hardware.drm@1.1::IDrmFactory widevine
interface android.hardware.drm@1.2::ICryptoFactory widevine
interface android.hardware.drm@1.2::IDrmFactory widevine
interface android.hardware.drm@1.3::ICryptoFactory widevine
interface android.hardware.drm@1.3::IDrmFactory widevine
interface android.hidl.base@1.0::IBase widevine
class hal
user media
group media mediadrm drmrpc system
ioprio rt 4
writepid /dev/cpuset/foreground/tasks

View File

@@ -22,8 +22,8 @@
#include "WVCryptoFactory.h"
#include "WVDrmFactory.h"
using wvdrm::hardware::drm::V1_2::widevine::WVCryptoFactory;
using wvdrm::hardware::drm::V1_2::widevine::WVDrmFactory;
using wvdrm::hardware::drm::V1_3::widevine::WVCryptoFactory;
using wvdrm::hardware::drm::V1_3::widevine::WVDrmFactory;
int main(int /* argc */, char** /* argv */) {
sp<IDrmFactory> drmFactory = new WVDrmFactory;

View File

@@ -23,8 +23,8 @@
#include "WVCryptoFactory.h"
#include "WVDrmFactory.h"
using wvdrm::hardware::drm::V1_2::widevine::WVCryptoFactory;
using wvdrm::hardware::drm::V1_2::widevine::WVDrmFactory;
using wvdrm::hardware::drm::V1_3::widevine::WVCryptoFactory;
using wvdrm::hardware::drm::V1_3::widevine::WVDrmFactory;
using android::hardware::LazyServiceRegistrar;
int main(int /* argc */, char** /* argv */) {