Add arguments to Widevine lshal debug hook.

Add options to dump Widevine Cdm properties,
Widevine Cdm metrics, or both.

The valid arguments are Cdm Metrics (m|M) or Cdm Properties (p|P).
If no arguments are provided, both Cdm properties and
Cdm metrics will be displayed.

Test: adb shell lshal debug [drm service] [m/p]
  adb shell lshal debug android.hardware.drm@1.3::IDrmFactory/widevine

Bug: 154027349
Change-Id: I95c10dd7d4274226936295c73be4eb1612c2ef6a
This commit is contained in:
Edwin Wong
2020-06-30 17:47:55 -07:00
parent 37b8b51a22
commit 5b8d21164d
7 changed files with 569 additions and 15 deletions

View File

@@ -24,21 +24,18 @@ struct WVDrmFactory : public IDrmFactory {
WVDrmFactory() {}
virtual ~WVDrmFactory() {}
Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
override;
Return<bool> isCryptoSchemeSupported(
const hidl_array<uint8_t, 16>& uuid) override;
Return<bool> isCryptoSchemeSupported_1_2(const hidl_array<uint8_t, 16>& uuid,
const hidl_string& mimeType,
SecurityLevel level)
override;
SecurityLevel level) override;
Return<bool> isContentTypeSupported(const hidl_string &mimeType)
override;
Return<bool> isContentTypeSupported(const hidl_string& mimeType) override;
Return<void> createPlugin(
const hidl_array<uint8_t, 16>& uuid,
const hidl_string& appPackageName,
createPlugin_cb _hidl_cb) override;
Return<void> createPlugin(const hidl_array<uint8_t, 16>& uuid,
const hidl_string& appPackageName,
createPlugin_cb _hidl_cb) override;
Return<void> getSupportedCryptoSchemes(
getSupportedCryptoSchemes_cb _hidl_cb) override;
@@ -54,6 +51,7 @@ struct WVDrmFactory : public IDrmFactory {
static bool isBlankAppPackageNameAllowed();
static int32_t firstApiLevel();
static std::string stringToHex(const std::string& input);
static void printCdmMetrics(FILE* out);
static void printCdmProperties(FILE* out);
friend class WVDrmFactoryTestPeer;
@@ -67,4 +65,4 @@ extern "C" IDrmFactory* HIDL_FETCH_IDrmFactory(const char* name);
} // namespace hardware
} // namespace wvdrm
#endif // WV_DRM_FACTORY_H_
#endif // WV_DRM_FACTORY_H_