Use ToVector Everywhere
(This is a merge of http://go/wvgerrit/14390) Expands usage of the ToVector() helper that kqyang@ wrote across the entire DRM Plugin. Bug: 20037441 Change-Id: I55112245af6fdf21ea3d3db87b1564af2f54929d
This commit is contained in:
@@ -118,9 +118,7 @@ status_t WVDrmPlugin::openSession(Vector<uint8_t>& sessionId) {
|
||||
|
||||
if (success) {
|
||||
// Marshal Session ID
|
||||
sessionId.clear();
|
||||
sessionId.appendArray(reinterpret_cast<const uint8_t*>(cdmSessionId.data()),
|
||||
cdmSessionId.size());
|
||||
sessionId = ToVector(cdmSessionId);
|
||||
|
||||
return android::OK;
|
||||
} else {
|
||||
@@ -233,9 +231,7 @@ status_t WVDrmPlugin::getKeyRequest(
|
||||
defaultUrl.clear();
|
||||
defaultUrl.setTo(cdmDefaultUrl.data(), cdmDefaultUrl.size());
|
||||
|
||||
request.clear();
|
||||
request.appendArray(reinterpret_cast<const uint8_t*>(keyRequest.data()),
|
||||
keyRequest.size());
|
||||
request = ToVector(keyRequest);
|
||||
}
|
||||
|
||||
if (keyType == kKeyType_Release) {
|
||||
@@ -271,9 +267,7 @@ status_t WVDrmPlugin::provideKeyResponse(
|
||||
CdmResponseType res = mCDM->AddKey(cdmSessionId, cdmResponse, &cdmKeySetId);
|
||||
|
||||
if (isRequest && isCdmResponseTypeSuccess(res)) {
|
||||
keySetId.clear();
|
||||
keySetId.appendArray(reinterpret_cast<const uint8_t*>(cdmKeySetId.data()),
|
||||
cdmKeySetId.size());
|
||||
keySetId = ToVector(cdmKeySetId);
|
||||
}
|
||||
|
||||
if (isRelease) {
|
||||
@@ -357,11 +351,7 @@ status_t WVDrmPlugin::getProvisionRequest(const String8& cert_type,
|
||||
&cdmDefaultUrl);
|
||||
|
||||
if (isCdmResponseTypeSuccess(res)) {
|
||||
request.clear();
|
||||
request.appendArray(reinterpret_cast<const uint8_t*>(
|
||||
cdmProvisionRequest.data()),
|
||||
cdmProvisionRequest.size());
|
||||
|
||||
request = ToVector(cdmProvisionRequest);
|
||||
defaultUrl.clear();
|
||||
defaultUrl.setTo(cdmDefaultUrl.data(), cdmDefaultUrl.size());
|
||||
}
|
||||
@@ -386,15 +376,8 @@ status_t WVDrmPlugin::provideProvisionResponse(
|
||||
&cdmCertificate,
|
||||
&cdmWrappedKey);
|
||||
if (isCdmResponseTypeSuccess(res)) {
|
||||
certificate.clear();
|
||||
certificate.appendArray(
|
||||
reinterpret_cast<const uint8_t*>(cdmCertificate.data()),
|
||||
cdmCertificate.size());
|
||||
|
||||
wrapped_key.clear();
|
||||
wrapped_key.appendArray(
|
||||
reinterpret_cast<const uint8_t*>(cdmWrappedKey.data()),
|
||||
cdmWrappedKey.size());
|
||||
certificate = ToVector(cdmCertificate);
|
||||
wrapped_key = ToVector(cdmWrappedKey);
|
||||
}
|
||||
|
||||
return mapCdmResponseType(res);
|
||||
@@ -436,11 +419,7 @@ status_t WVDrmPlugin::getSecureStops(List<Vector<uint8_t> >& secureStops) {
|
||||
++iter) {
|
||||
const string& cdmStop = *iter;
|
||||
|
||||
Vector<uint8_t> stop;
|
||||
stop.appendArray(reinterpret_cast<const uint8_t*>(cdmStop.data()),
|
||||
cdmStop.size());
|
||||
|
||||
secureStops.push_back(stop);
|
||||
secureStops.push_back(ToVector(cdmStop));
|
||||
}
|
||||
}
|
||||
return mapCdmResponseType(res);
|
||||
|
||||
Reference in New Issue
Block a user