Files
Nik Tishakov b024a32e8e [android] Add sys/system_properties.h to the Android module (#93743)
`__system_property_get` and `PROP_VALUE_MAX` from
`<sys/system_properties.h>` aren't visible through `import Android`.
swift-testing includes the header in its C shim
(`_TestingInternals/include/Includes.h`), and swift-foundation would
need to do the same to read the device time zone
(swiftlang/swift-foundation#2354, where @jmschonfeld asked whether this
belongs in the `Android` module).

This adds the header to `SwiftAndroidNDK.h` and an
`android_apis.system_properties` submodule, like `sys_xattr` in #74742,
and a typecheck test for Android.

Testing: with the Android SDK from swift-6.4.1-RELEASE, the code in the
new test fails to build with "cannot find 'PROP_VALUE_MAX' in scope".
With these two files replaced in the SDK, it builds for aarch64, x86_64
and armv7 without warnings. I didn't run the lit test itself, which
needs an Android build of the compiler.
2026-11-05 19:26:12 +05:30

9 lines
327 B
Swift

// RUN: %target-swift-frontend -typecheck %s -verify
// REQUIRES: OS=linux-android || OS=linux-androideabi
import Android
// The system property API from `sys/system_properties.h` is part of the module.
let _: Int32 = PROP_VALUE_MAX
let _: (UnsafePointer<CChar>, UnsafeMutablePointer<CChar>) -> Int32 = __system_property_get