hardware: qcom: sm7250: display: fix -Wreturn-stack-address

The return value of CompManager::StringDisplayList returns a pointer to
a local variable, whose lifetime ends at the end of that method. Fix
this by returning a std::string that will be copied (unless NRVO'd), and
pulling out the c_str() only when necessary.

Bug: 139945549
Bug: 145792036
Bug: 147680215
Test: build pass

Reference: f3834b95b0eb0055f162c680205c6539d3187f65

Change-Id: I77101dcb281665fc98d3b762b23e4631d1698b87
Signed-off-by: Roger Liao <rogerliao@google.com>
2 files changed