Skip to content

Updated headers for Android 16.0 - #8

Open
Herrie82 wants to merge 8 commits into
halium-16.0from
herrie/halium-16.0
Open

Updated headers for Android 16.0#8
Herrie82 wants to merge 8 commits into
halium-16.0from
herrie/halium-16.0

Conversation

@Herrie82

Copy link
Copy Markdown

No description provided.

Generated from a halium-13.0 tree with libhybris' own
utils/extract-headers.sh, which detected ANDROID_VERSION_MAJOR 13 correctly.

extract-headers.sh does not emit everything the published sets carry, so three
directories were added on top from their canonical in-tree sources - not the
prebuilts/vndk/v32/x86 copies that a naive search turns up first:

    log/     system/logging/liblog/include/log         12 files
    camera/  frameworks/av/camera/ndk/include/camera    8 files
    media/   frameworks/av/media/ndk/include/media     10 files

All three match the halium-11.0 file names exactly.

libnfc-nxp/ is dropped: those 145 headers are a legacy vendored NFC dump that
does not exist anywhere in an AOSP 13 tree. libhybris' configure probes for
libnfc-nxp/phLibNfc.h and only adds the include path when it is present, so its
absence is handled rather than fatal.

Note that android-headers describes the vendor HAL interface rather than the
system image, so a device whose vendor is older does not need this - Droidian
still build-depends on android-headers-30 for Halium 12 and 13. This is for
trees whose vendor is Android 13.
A file-level comparison against halium-11.0 showed four headers the generated
set was short of, once libnfc-nxp is set aside. Two are real and were simply
not emitted by extract-headers.sh:

    android/log.h                      system/logging/liblog/include/android
    private/android_filesystem_config.h  system/core/libcutils/include/private

android/log.h in particular is included very widely, so its absence would have
surfaced as a confusing failure in the first consumer that needed it rather
than as anything obviously to do with the header set.

The other two are genuinely retired in AOSP 13 rather than missing:

    hardware/keymaster0.h          the keymaster0 HAL is gone from the tree
    private/bionic_string_utils.h  no longer in bionic; the only copies left
                                   are the ones libhybris vendors under
                                   hybris/common/*/bionic, so anything needing
                                   it already has it

android/ now has the same nine files as halium-11.0.
Generated from a halium-14.0 tree with libhybris' utils/extract-headers.sh,
which needed -v 14.0.0 passed explicitly: it reads the platform version from
build/core/version_defaults.mk, and AOSP 14 no longer has that file anywhere
under build/ - the version moved into the release-config machinery.

As with halium-13.0, three directories and two headers that the script does not
emit were added from their canonical in-tree sources:

    log/     system/logging/liblog/include/log         12 files
    camera/  frameworks/av/camera/ndk/include/camera    8 files
    media/   frameworks/av/media/ndk/include/media     10 files
    android/log.h
    private/android_filesystem_config.h

Against halium-13.0 the notable change is that AOSP 14 retired the legacy
HAL 1.0 headers - hardware/lights.h, thermal.h, radio.h, consumerir.h,
fused_location.h, activity_recognition.h, vr.h, local_time_hal.h and
audio_alsaops.h are all gone, along with cutils/threads.h - while gaining the
AIDL equivalents, android/hardware_buffer_aidl.h, android/native_window_aidl.h
and system/audio_aidl_utils.h.

Anything still using a legacy HAL header therefore cannot build against this
set. That is a reason to pick the header version by vendor rather than by GSI:
these describe an Android 14 vendor's interface, and a device whose vendor is
older should keep using the matching older set.
extract-headers.sh copies a directory argument by iterating its entries
with a plain "cp -L", which silently skips any entry that is itself a
directory. system/media/audio/include/system has held audio_effects/ for
as long as it has been extracted, so it has never been in these headers,
even though the audio_effect.h beside it includes from that directory.

Regenerated against the same Android 14 tree with the fixed script
(libhybris "extract-headers: copy header subdirectories, and stop
ignoring cp errors"), which reports 0 cp errors and auto-detects 14.0.0.

Additive on purpose. A full regeneration would drop the NDK camera and
media headers added by 217a38e, which extract-headers.sh does not
produce - so only the 19 files it was missing are added here. Every other
file is byte-identical apart from git-revisions.txt, which is generated.
Extracted from a halium-16.0 tree (lineage-23.2 / android-16.0.0_r4) with
libhybris' utils/extract-headers.sh as updated for Android 16.

Two notes for whoever regenerates these:

- the script cannot autodetect the version on a 16 tree - it looks for
  build/core/version_defaults.mk, and the version now comes from the release
  config - so it was run with an explicit -v 16.0.0.
- system/audio_effects is a directory and the script copies it with a plain
  cp, which skips it. Copied in by hand, same as on halium-14.0.
android-config.h defines away the clang-only nullability qualifiers and
neutralizes __INTRODUCED_IN(), but the pkg-config file only ever emitted -I, so
those defines applied solely to consumers that happened to include it by hand.

That was survivable while the headers came from Android 11, whose
android/hardware_buffer.h has no such annotations. From Android 14 it has 22,
and GCC cannot parse _Nullable/_Nonnull - nyx-modules-hybris fails with a wall
of "expected ';', ',' or ')' before 'buffer'" from inside the header itself.

Force-including it from Cflags makes the defines apply everywhere, which is
what a header set meant to be consumed by GCC needs.
Now that the pc file force-includes android-config.h by absolute path, it gets
pulled into translation units that do not necessarily carry the -I for this
directory - sensorfw fails every compile with

  android-config.h:22:10: fatal error: android-version.h: No such file or directory

A quoted include resolves relative to the including file first, and
android-version.h sits right beside android-config.h, so it is found whether or
not the -I is present.
Android 14 onwards annotates the NDK headers with _Nullable/_Nonnull and
__INTRODUCED_IN(), none of which GCC can parse; the 11.0 set this replaces had
none of them. android-config.h already defines all three away, but nothing
guaranteed it was included first, so nyx-modules-hybris failed with a wall of
errors from inside android/hardware_buffer.h itself.

Force-including android-config.h from the pkg-config Cflags looked like the
systematic fix and is not: CMake's pkg_check_modules splits CFLAGS_OTHER from
INCLUDE_DIRS, and consumers that only use the latter - nyx among them - drop it
silently. It also pulled android-config.h into translation units lacking the -I
for this directory, breaking sensorfw instead.

So have the 24 annotated headers include android-config.h themselves. That
holds regardless of how the consumer discovers the include path. Keeping the
quoted include of android-version.h from the previous commit as well, since it
makes android-config.h usable by absolute path too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant