MCPcopy Index your code
hub / github.com/python/cpython / getprop

Function getprop

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

Source from the content-addressed store, hash-verified

554 system_property_get.argtypes = (c_char_p, c_char_p)
555
556 def getprop(name, default):
557 # https://android.googlesource.com/platform/bionic/+/refs/tags/android-5.0.0_r1/libc/include/sys/system_properties.h#39
558 PROP_VALUE_MAX = 92
559 buffer = create_string_buffer(PROP_VALUE_MAX)
560 length = system_property_get(name.encode("UTF-8"), buffer)
561 if length == 0:
562 # This API doesn’t distinguish between an empty property and
563 # a missing one.
564 return default
565 else:
566 return buffer.value.decode("UTF-8", "backslashreplace")
567
568 release = getprop("ro.build.version.release", release)
569 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…