Remove dependency on libandroid

The main purpose of this change is to avoid having to pull in libandroid
for the sake of using the sensor manager from the audioserver process
(native). The way this is achieved is by using lower-level APIs, namely
those offered by libsensor.

As a result, we were able to use sensor handles in SensorPoseProvider,
rather than ASensor* objects, which is simpler and removes the need to
enumerate all the sensor for the sake of finding the one with the
correct handle.

Test: Manually enable head tracking and observe the logs to verify that
      the expected pose updates are received.
Bug: 198795859
Change-Id: Ic69c322d6ea9297309a4856b3047c841831e04d7
diff --git a/services/audiopolicy/service/SpatializerPoseController.h b/services/audiopolicy/service/SpatializerPoseController.h
index 12898aa..c579622 100644
--- a/services/audiopolicy/service/SpatializerPoseController.h
+++ b/services/audiopolicy/service/SpatializerPoseController.h
@@ -42,6 +42,8 @@
  */
 class SpatializerPoseController : private media::SensorPoseProvider::Listener {
   public:
+    static constexpr int32_t INVALID_SENSOR = media::SensorPoseProvider::INVALID_HANDLE;
+
     /**
      * Listener interface for getting pose and mode updates.
      * Methods will always be invoked from a designated thread.
@@ -68,15 +70,15 @@
 
     /**
      * Set the sensor that is to be used for head-tracking.
-     * nullptr can be used to disable head-tracking.
+     * INVALID_SENSOR can be used to disable head-tracking.
      */
-    void setHeadSensor(const ASensor* sensor);
+    void setHeadSensor(int32_t sensor);
 
     /**
      * Set the sensor that is to be used for screen-tracking.
-     * nullptr can be used to disable screen-tracking.
+     * INVALID_SENSOR can be used to disable screen-tracking.
      */
-    void setScreenSensor(const ASensor* sensor);
+    void setScreenSensor(int32_t sensor);
 
     /** Sets the desired head-tracking mode. */
     void setDesiredMode(media::HeadTrackingMode mode);