-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] How to use thermal API? #1271
Comments
that stuff is new in API level 30, so you'll need an Android 11 developer preview/beta and NDK r21c. i'll get the docs improved to at least include the availability. (danalbert: we should get that into the NDK API review process until/unless we get tool support for automating it.) |
v21.0.6113669. not suppose to have it; v21.2.6472646 has it
Thermal is Android R feature, so minSdkVersion must be for "Android R":
you could try to follow this one for the example
I am trying with the formal AGP 4.0.0 version, so far, I could not build with this formal version + formal release of NDK (21.2.6472646). if I get something, I will update you. |
Actually both of your NDK versions does not have new things for Android R, so use the available versions of: |
Thank you guys for the quick answers. It is quite unfortunate that it depends on Android 11, because the same feature exist on the JAVA side since Android 10 (https://source.android.com/devices/architecture/hidl/thermal-mitigation#thermal-api). I just hoped I do not have to write my own wrappers for it. |
r21d is the first stable release that will include the API, FYI. |
yeah, NDK API sometimes behind Java API by one generation: getThermalHeadroom() is not part of Android R's NDK Thermal API yet, if you need that one, you would need your wrapper. |
I would like to use the thermal API (https://developer.android.com/ndk/reference/group/thermal) in my native application, but there is no such header in my NDK bundle (v21.0.6113669).
To reproduce the issue you can instert the line
#include <android/thermal.h>
into themain.cpp
of this sample: https://github.com/android/ndk-samples/tree/master/native-activityCompiler error:
I did not find the header, when I tried to search for it in the ndk's directory (search command:
find ./ndk-bundle -name 'thermal.h'
). There is athermal.h
under the linux directory, but it is not what I need for android builds. I also tried with the latest NDK (v21.2.6472646), but the result was the same. What am I doing wrong?The text was updated successfully, but these errors were encountered: