Let missing DeviceProductInfo pass through AIDL
On the way between SurfaceFlinger and DisplayManager, there are two
conversions done between the old and new StaticDisplayInfo types.
Neither of these conversions were checking that the incoming optional
DeviceProductInfo did indeed have a value before reading it.
Dereferencing an empty optional is undefined behavior. In practice,
the converters read zeroes, causing the output to have info fields
with present-but-invalid content.
On devices that do not provide DeviceProductInfo, DisplayManager got
a model year of 0, making DisplayTest#testGetDeviceProductInfo fail.
Fixes: 291101831
Fixes: 283031260
Fixes: 286718808
Test: cts DisplayTest#testGetDeviceProductInfo
Change-Id: I118a1ce6459697ce471cdec75d156adad479c654
2 files changed