1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include "include/keystore/KeyAttestationPackageInfo.h"
- #include <binder/Parcel.h>
- namespace android {
- namespace security {
- namespace keymaster {
- KeyAttestationPackageInfo::KeyAttestationPackageInfo() = default;
- KeyAttestationPackageInfo::KeyAttestationPackageInfo(const String16& packageName,
- int64_t versionCode,
- SharedSignaturesVector signatures)
- : packageName_(new String16(packageName)), versionCode_(versionCode), signatures_(signatures) {}
- status_t KeyAttestationPackageInfo::writeToParcel(Parcel* parcel) const {
- auto rc = parcel->writeString16(packageName_);
- if (rc != NO_ERROR) return rc;
- rc = parcel->writeInt64(versionCode_);
- if (rc != NO_ERROR) return rc;
- return parcel->writeParcelableVector(signatures_);
- }
- status_t KeyAttestationPackageInfo::readFromParcel(const Parcel* parcel) {
- auto rc = parcel->readString16(&packageName_);
- if (rc != NO_ERROR) return rc;
- rc = parcel->readInt64(&versionCode_);
- if (rc != NO_ERROR) return rc;
- std::unique_ptr<SignaturesVector> temp_vector;
- rc = parcel->readParcelableVector(&temp_vector);
- if (rc != NO_ERROR) return rc;
- signatures_.reset(temp_vector.release());
- return NO_ERROR;
- }
- }
- }
- }
|