libbinder: detect features supported by the driver

The binder driver exposes the features it supports as individual files
under /dev/binderfs/features/*. This patch adds a method to determine
whether a feature is enabled or not and avoid unnecessary calls to the
driver. In this case, we can skip logging any "oneway spam detection"
failures seen during open_driver() if the ioctl is not supported.

Bug: 191910201
Tested: toggling driver features manually
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Ie8e7315cc1ba8baa9cb03bab1fb3bd7507765c99
2 files changed