libsensors_iio: Don't segfault when constructor fails when device absent

Currently too much work is been done in the constructor.
If a device is not there in the kernel, the constructor will fail
to correctly initialize, and will leave a bunch of uninitialized strings
that when used will cause segfaults.

So now the classes have an isValid() method to be used after construction.
If false, the object should be destroyed.

Added extra checks to locate failed initialization.

Change-Id: I3f767f9dc0b0f19b66d034a683444baed771a5db
3 files changed
tree: df17201276fe098c050392d500933656732a1e9c
  1. libsensors/
  2. libsensors_iio/
  3. mlsdk/
  4. Android.mk