diff options
| author | 2021-01-28 14:48:59 -0800 | |
|---|---|---|
| committer | 2021-02-11 17:59:24 +0000 | |
| commit | db5778ee162ab5bb8ed94233835ee933dc40b38a (patch) | |
| tree | 76f44c8b6e42bef32ee367b650883ebff7c58b05 | |
| parent | f07a9853fee568112c54cc024d32533e183d8fc8 (diff) | |
Add ASurfaceControl_acquire api
hwui needs this api to hold a reference to a surface control object passed from java layer.
Bug: 173671170
Test: manual
Change-Id: I1ca9cbe5caad4bdb8594b421e5444d7bdb7b71a8
| -rw-r--r-- | include/android/surface_control.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/android/surface_control.h b/include/android/surface_control.h index 98fd875968..b836581226 100644 --- a/include/android/surface_control.h +++ b/include/android/surface_control.h @@ -67,9 +67,21 @@ ASurfaceControl* ASurfaceControl_create(ASurfaceControl* parent, const char* deb __INTRODUCED_IN(29); /** - * Releases the \a surface_control object. After releasing the ASurfaceControl the caller no longer - * has ownership of the AsurfaceControl. The surface and it's children may remain on display as long - * as their parent remains on display. + * Acquires a reference on the given ASurfaceControl object. This prevents the object + * from being deleted until the reference is removed. + * + * To release the reference, use the ASurfaceControl_release function. + * + * Available since API level 31. + */ +void ASurfaceControl_acquire(ASurfaceControl* surface_control) __INTRODUCED_IN(31); + +/** + * Removes a reference that was previously acquired with one of the following functions: + * ASurfaceControl_createFromWindow + * ASurfaceControl_create + * ANativeWindow_acquire + * The surface and its children may remain on display as long as their parent remains on display. * * Available since API level 29. */ |