Add android version guard to ASensorManager_getInstanceForPackage

This function is added to header file since 2015 but the corresponding
function is not exported through libandroid.map file until O. Thus,
it make sense to gate the usage to ANDROID_O and forward.

ASensorManager_getInstance is deprecated accordingly.

Bug: 63639195
Test: compiles
Change-Id: Ib2fdb635ffca9ec629dd487bd377aaa98afa4359
diff --git a/include/android/sensor.h b/include/android/sensor.h
index 97b4a2a..7f46087 100644
--- a/include/android/sensor.h
+++ b/include/android/sensor.h
@@ -381,8 +381,13 @@
  *     ASensorManager* sensorManager = ASensorManager_getInstance();
  *
  */
+#if __ANDROID_API__ >= __ANDROID_API_O__
 __attribute__ ((deprecated)) ASensorManager* ASensorManager_getInstance();
+#else
+ASensorManager* ASensorManager_getInstance();
+#endif
 
+#if __ANDROID_API__ >= __ANDROID_API_O__
 /*
  * Get a reference to the sensor manager. ASensorManager is a singleton
  * per package as different packages may have access to different sensors.
@@ -393,6 +398,7 @@
  *
  */
 ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName);
+#endif
 
 /**
  * Returns the list of available sensors.