MCPcopy Index your code
hub / github.com/RustPython/RustPython / getprop

Function getprop

Lib/platform.py:589–599  ·  view source on GitHub ↗
(name, default)

Source from the content-addressed store, hash-verified

587 system_property_get.argtypes = (c_char_p, c_char_p)
588
589 def getprop(name, default):
590 # https://android.googlesource.com/platform/bionic/+/refs/tags/android-5.0.0_r1/libc/include/sys/system_properties.h#39
591 PROP_VALUE_MAX = 92
592 buffer = create_string_buffer(PROP_VALUE_MAX)
593 length = system_property_get(name.encode("UTF-8"), buffer)
594 if length == 0:
595 # This API doesn’t distinguish between an empty property and
596 # a missing one.
597 return default
598 else:
599 return buffer.value.decode("UTF-8", "backslashreplace")
600
601 release = getprop("ro.build.version.release", release)
602 api_level = int(getprop("ro.build.version.sdk", api_level))

Callers 1

android_verFunction · 0.85

Calls 3

create_string_bufferFunction · 0.90
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected