Avoid accessing failed HIDL Return contents

It's invalid to attempt to read the contents of a HIDL Return object
that has isOk() return false. This leads to a crash, so instead map
isOk() == false to DEAD_OBJECT in places where the return status is
used, and avoid otherwise avoid referencing the contents of the Return.

To facilitate testing, also add some additional informational logs for
cases when the sensor handles have changed after HAL restart.

Bug: 133497927
Test: use customized 2.0 HAL that crashes in activate call, confirm the
      HAL crash doesn't trigger system server crash due to invalid use
      of Return object
Change-Id: Ic094999ef20d90b538f757e34167155e83711b3d
2 files changed