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

Commit 77a61e5a authored by Peng Xu's avatar Peng Xu Committed by Dan Albert
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
(cherry picked from commit 477db440)
parent dfdc1559
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -344,8 +344,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.
@@ -356,6 +361,7 @@ __attribute__ ((deprecated)) ASensorManager* ASensorManager_getInstance();
 *
 */
ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName);
#endif

/**
 * Returns the list of available sensors.