Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 477db440 authored by Peng Xu's avatar Peng Xu
Browse files

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
parent cb350666
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -381,8 +381,13 @@ typedef ASensorRef const* ASensorList;
 *     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 @@ __attribute__ ((deprecated)) ASensorManager* ASensorManager_getInstance();
 *
 */
ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName);
#endif

/**
 * Returns the list of available sensors.