diff --git a/cgbinder.pxd b/cgbinder.pxd index 85a03f9..7e9e579 100644 --- a/cgbinder.pxd +++ b/cgbinder.pxd @@ -38,6 +38,12 @@ cdef extern from "gbinder/gbinder_types.h": ctypedef struct GBinderWriter: pass + ctypedef enum GBINDER_STABILITY_LEVEL: + GBINDER_STABILITY_UNDECLARED = 0 + GBINDER_STABILITY_VENDOR = 0x03 + GBINDER_STABILITY_SYSTEM = 0x0c + GBINDER_STABILITY_VINTF = 0x3f + ctypedef GBinderLocalReply* (*GBinderLocalTransactFunc)(GBinderLocalObject* obj, GBinderRemoteRequest* req, unsigned int code, unsigned int flags, int* status, void* user_data) from libc.stdint cimport int64_t, uint64_t @@ -119,6 +125,7 @@ cdef extern from "gbinder/gbinder_local_object.h": void gbinder_local_object_drop(GBinderLocalObject* obj) GBinderLocalReply* gbinder_local_object_new_reply(GBinderLocalObject* obj) + void gbinder_local_object_set_stability(GBinderLocalObject* obj, GBINDER_STABILITY_LEVEL stability) cdef extern from "gbinder/gbinder_local_reply.h": GBinderLocalReply* gbinder_local_reply_ref(GBinderLocalReply* reply) diff --git a/debian/control b/debian/control index b951a4a..375b4f0 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 9), python3-all-dev (>= 3.2), python3-setuptools, cython3, - libgbinder-dev (>= 1.1.20), + libgbinder-dev (>= 1.1.40), libglibutil-dev, libglib2.0-dev, pkgconf, diff --git a/gbinder.pyx b/gbinder.pyx index 86f59a9..961b21f 100644 --- a/gbinder.pyx +++ b/gbinder.pyx @@ -8,6 +8,12 @@ def ensure_binary(s): return s.encode() raise TypeError("not expecting type '%s'" % type(s)) +# Stability levels for local objects (since libgbinder 1.1.40) +STABILITY_UNDECLARED = 0x00 +STABILITY_VENDOR = 0x03 +STABILITY_SYSTEM = 0x0c +STABILITY_VINTF = 0x3f + cdef class Bridge: cdef cgbinder.GBinderBridge* _bridge @@ -518,6 +524,10 @@ cdef class LocalObject: reply.set_c_reply(c_reply) return reply + def set_stability(self, stability): + if self._object is not NULL: + cgbinder.gbinder_local_object_set_stability(self._object, stability) + cdef cgbinder.GBinderLocalReply* local_transact_callback(cgbinder.GBinderLocalObject* obj, cgbinder.GBinderRemoteRequest* c_req, unsigned int code, unsigned int flags, int* status, void* user_data) noexcept with gil: req = RemoteRequest() req.set_c_req(c_req)