Loading system/service/common/android/bluetooth/scan_filter.cc +4 −13 Original line number Diff line number Diff line Loading @@ -41,28 +41,19 @@ status_t ScanFilter::writeToParcel(Parcel* parcel) const { // TODO(jpawlowski) make type casting nicer // uuid won't really keep ownership, it's just for type casting std::unique_ptr<UUID> uuid; UUID tmp; std::optional<UUID> uuid; if (service_uuid_) { tmp = *service_uuid_; uuid.reset(&tmp); } else { uuid.reset(nullptr); uuid = *service_uuid_; } status = parcel->writeNullableParcelable(uuid); uuid.release(); if (status != OK) return status; uuid.reset(); if (service_uuid_mask_) { tmp = *service_uuid_mask_; uuid.reset(&tmp); } else { uuid.reset(nullptr); uuid = *service_uuid_mask_; } status = parcel->writeNullableParcelable(uuid); uuid.release(); return status; } Loading Loading
system/service/common/android/bluetooth/scan_filter.cc +4 −13 Original line number Diff line number Diff line Loading @@ -41,28 +41,19 @@ status_t ScanFilter::writeToParcel(Parcel* parcel) const { // TODO(jpawlowski) make type casting nicer // uuid won't really keep ownership, it's just for type casting std::unique_ptr<UUID> uuid; UUID tmp; std::optional<UUID> uuid; if (service_uuid_) { tmp = *service_uuid_; uuid.reset(&tmp); } else { uuid.reset(nullptr); uuid = *service_uuid_; } status = parcel->writeNullableParcelable(uuid); uuid.release(); if (status != OK) return status; uuid.reset(); if (service_uuid_mask_) { tmp = *service_uuid_mask_; uuid.reset(&tmp); } else { uuid.reset(nullptr); uuid = *service_uuid_mask_; } status = parcel->writeNullableParcelable(uuid); uuid.release(); return status; } Loading