Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee71fdf3 authored by Jooyung Han's avatar Jooyung Han
Browse files

Use std::optional for nullable

AIDL now use std::optional to represent nullable types for efficiency
instead of std::unique_ptr which might cause additional heap allocation.

Bug: 1447732670
Test: m
Merged-In: I9045bc6fc2eb06839203af6db94a80de9b83ad1f
Change-Id: I9045bc6fc2eb06839203af6db94a80de9b83ad1f
(cherry picked from commit 0c230cf92f4efbacbd8a20ab7b0b7c6c5f5e92b6)

Exempt-From-Owner-Approval: CP from master
parent cb52a18f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ status_t AudioAttributes::writeToParcel(Parcel *parcel) const
        parcel->writeInt32(0);
    } else {
        parcel->writeInt32(1);
        parcel->writeUtf8AsUtf16(mAttributes.tags);
        parcel->writeUtf8AsUtf16(std::string(mAttributes.tags));
    }
    parcel->writeInt32(static_cast<int32_t>(mStreamType));
    parcel->writeUint32(static_cast<uint32_t>(mGroupId));
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include <string>
#include <map>
#include <memory>
#include <optional>
#include <utility>
#include <unordered_map>
#include <unordered_set>