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

Commit 3cc27f5c authored by Przemysław Szczepaniak's avatar Przemysław Szczepaniak
Browse files

Set correct API level for NNAPI AIDL service discovery.

Use __ANDROID_API_FUTURE__ until the S version is finalized.

Bug: 183657864
Test: Build & flashed CF, run TFLite benchmark util
Change-Id: I1352aa33866487f955136c6fb8e4d0d279225f13
parent 7a9d6092
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include "Service.h"

#include <AndroidVersionUtil.h>
#include <aidl/android/hardware/neuralnetworks/IDevice.h>
#include <android-base/logging.h>
#include <android/binder_manager.h>
@@ -82,7 +83,7 @@ void getAidlDevices(std::vector<nn::SharedDevice>* devices,

    // Devices with SDK level lower than 31 (Android S) don't have any AIDL drivers available, so
    // there is no need for a workaround supported on lower levels.
    if (__builtin_available(android __ANDROID_API_S__, *)) {
    if (__builtin_available(android __NNAPI_AIDL_MIN_ANDROID_API__, *)) {
        AServiceManager_forEachDeclaredInstance(aidl_hal::IDevice::descriptor,
                                                static_cast<void*>(&names), callback);
    }