Native Activity

Summary

Enumerations

Anonymous Enum 108{
  AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
  AWINDOW_FLAG_DIM_BEHIND = 0x00000002,
  AWINDOW_FLAG_BLUR_BEHIND = 0x00000004,
  AWINDOW_FLAG_NOT_FOCUSABLE = 0x00000008,
  AWINDOW_FLAG_NOT_TOUCHABLE = 0x00000010,
  AWINDOW_FLAG_NOT_TOUCH_MODAL = 0x00000020,
  AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040,
  AWINDOW_FLAG_KEEP_SCREEN_ON = 0x00000080,
  AWINDOW_FLAG_LAYOUT_IN_SCREEN = 0x00000100,
  AWINDOW_FLAG_LAYOUT_NO_LIMITS = 0x00000200,
  AWINDOW_FLAG_FULLSCREEN = 0x00000400,
  AWINDOW_FLAG_FORCE_NOT_FULLSCREEN = 0x00000800,
  AWINDOW_FLAG_DITHER = 0x00001000,
  AWINDOW_FLAG_SECURE = 0x00002000,
  AWINDOW_FLAG_SCALED = 0x00004000,
  AWINDOW_FLAG_IGNORE_CHEEK_PRESSES = 0x00008000,
  AWINDOW_FLAG_LAYOUT_INSET_DECOR = 0x00010000,
  AWINDOW_FLAG_ALT_FOCUSABLE_IM = 0x00020000,
  AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000,
  AWINDOW_FLAG_SHOW_WHEN_LOCKED = 0x00080000,
  AWINDOW_FLAG_SHOW_WALLPAPER = 0x00100000,
  AWINDOW_FLAG_TURN_SCREEN_ON = 0x00200000,
  AWINDOW_FLAG_DISMISS_KEYGUARD = 0x00400000
}
enum
Window flags, as per the Java API at android.view.WindowManager.LayoutParams.
Anonymous Enum 52{
  ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT = 0x0001,
  ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED = 0x0002
}
enum
Flags for ANativeActivity_showSoftInput; see the Java InputMethodManager API for documentation.
Anonymous Enum 53{
  ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY = 0x0001,
  ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS = 0x0002
}
enum
Flags for ANativeActivity_hideSoftInput; see the Java InputMethodManager API for documentation.
ADisplayLuts_Dimension{
  ADISPLAYLUTS_ONE_DIMENSION = 1,
  ADISPLAYLUTS_THREE_DIMENSION = 3
}
enum
The dimension of the lut.
ADisplayLuts_SamplingKey{
  ADISPLAYLUTS_SAMPLINGKEY_RGB = 0,
  ADISPLAYLUTS_SAMPLINGKEY_MAX_RGB = 1,
  ADISPLAYLUTS_SAMPLINGKEY_CIE_Y = 2
}
enum
The sampling key used by the lut.
ASurfaceTransactionTransparency{
  ASURFACE_TRANSACTION_TRANSPARENCY_TRANSPARENT = 0,
  ASURFACE_TRANSACTION_TRANSPARENCY_TRANSLUCENT = 1,
  ASURFACE_TRANSACTION_TRANSPARENCY_OPAQUE = 2
}
enum
ASurfaceTransactionVisibility{
  ASURFACE_TRANSACTION_VISIBILITY_HIDE = 0,
  ASURFACE_TRANSACTION_VISIBILITY_SHOW = 1
}
enum

Typedefs

ADisplayLuts typedef
struct ADisplayLuts
Used to get and set display luts.
ADisplayLutsEntry typedef
Used to get and set display luts entry.
ADisplayLuts_Dimension typedef
ADisplayLuts_SamplingKey typedef
AInputReceiver typedef
The InputReceiver that holds the reference to the registered input channel.
AInputReceiverCallbacks typedef
struct AInputReceiverCallbacks
AInputReceiver_onKeyEvent)(void *_Null_unspecified context, AInputEvent *_Nonnull keyEvent) typedef
bool(*
The AInputReceiver_onKeyEvent callback is invoked when the registered input channel receives a key event.
AInputReceiver_onMotionEvent)(void *_Null_unspecified context, AInputEvent *_Nonnull motionEvent) typedef
bool(*
The AInputReceiver_onMotionEvent callback is invoked when the registered input channel receives a motion event.
AInputTransferToken typedef
AInputTransferToken can be used to request focus on or to transfer touch gesture to and from an embedded SurfaceControl.
ANativeActivity typedef
This structure defines the native side of an android.app.NativeActivity.
ANativeActivityCallbacks typedef
These are the callbacks the framework makes into a native application.
ANativeActivity_createFunc(ANativeActivity *activity, void *savedState, size_t savedStateSize) typedef
void
This is the function that must be in the native code to instantiate the application's native activity.
ARect typedef
struct ARect
Rectangular window area.
ASurfaceControl typedef
struct ASurfaceControl
The SurfaceControl API can be used to provide a hierarchy of surfaces for composition to the system compositor.
ASurfaceTransaction typedef
ASurfaceTransaction is a collection of updates to the surface tree that must be applied atomically.
ASurfaceTransactionStats typedef
An opaque handle returned during a callback that can be used to query general stats and stats for surfaces which were either removed or for which buffers were updated after this transaction was applied.
ASurfaceTransaction_OnBufferRelease)(void *_Null_unspecified context, int release_fence_fd) typedef
void(*
The ASurfaceTransaction_OnBufferRelease callback is invoked when a buffer that was passed in ASurfaceTransaction_setBuffer is ready to be reused.
ASurfaceTransaction_OnCommit)(void *_Null_unspecified context, ASurfaceTransactionStats *_Nonnull stats) typedef
void(*
The ASurfaceTransaction_OnCommit callback is invoked when transaction is applied and the updates are ready to be presented.
ASurfaceTransaction_OnComplete)(void *_Null_unspecified context, ASurfaceTransactionStats *_Nonnull stats) typedef
void(*
Since the transactions are applied asynchronously, the ASurfaceTransaction_OnComplete callback can be used to be notified when a frame including the updates in a transaction was presented.

Variables

ANativeActivity_onCreate
The name of the function that NativeInstance looks for when launching its native code.

Functions

ADisplayLutsEntry_createEntry(float *_Nonnull buffer, int32_t length, ADisplayLuts_Dimension dimension, ADisplayLuts_SamplingKey key)
ADisplayLutsEntry *_Nonnull
Creates a ADisplayLutsEntry entry.
ADisplayLutsEntry_destroy(ADisplayLutsEntry *_Nullable entry)
void
Destroys the ADisplayLutsEntry instance.
ADisplayLutsEntry_getBuffer(const ADisplayLutsEntry *_Nonnull entry)
const float *_Nonnull
Gets the lut buffer of the entry.
ADisplayLutsEntry_getDimension(const ADisplayLutsEntry *_Nonnull entry)
Gets the dimension of the entry.
ADisplayLutsEntry_getSamplingKey(const ADisplayLutsEntry *_Nonnull entry)
Gets the sampling key used by the entry.
ADisplayLutsEntry_getSize(const ADisplayLutsEntry *_Nonnull entry)
int32_t
Gets the size for each dimension of the entry.
ADisplayLuts_create()
ADisplayLuts *_Nonnull
Creates a ADisplayLuts instance.
ADisplayLuts_destroy(ADisplayLuts *_Nullable luts)
void
Deletes the ADisplayLuts instance.
ADisplayLuts_setEntries(ADisplayLuts *_Nonnull luts, ADisplayLutsEntry *_Nullable *_Nullable entries, int32_t numEntries)
void
Sets Luts in order to be applied.
AInputReceiverCallbacks_create(void *_Nullable context)
AInputReceiverCallbacks *_Nonnull
Creates a AInputReceiverCallbacks object that is used when registering for an AInputReceiver.
AInputReceiverCallbacks_release(AInputReceiverCallbacks *_Nullable callbacks)
void
Releases the AInputReceiverCallbacks.
AInputReceiverCallbacks_setKeyEventCallback(AInputReceiverCallbacks *_Nonnull callbacks, AInputReceiver_onKeyEvent _Nonnull onKeyEvent)
void
Sets a AInputReceiver_onKeyEvent callback for an AInputReceiverCallbacks.
AInputReceiverCallbacks_setMotionEventCallback(AInputReceiverCallbacks *_Nonnull callbacks, AInputReceiver_onMotionEvent _Nonnull onMotionEvent)
void
Sets a AInputReceiver_onMotionEvent callback for an AInputReceiverCallbacks.
AInputReceiver_createBatchedInputReceiver(AChoreographer *_Nonnull aChoreographer, const AInputTransferToken *_Nonnull hostInputTransferToken, const ASurfaceControl *_Nonnull aSurfaceControl, AInputReceiverCallbacks *_Nonnull aInputReceiverCallbacks)
AInputReceiver *_Nonnull
Registers an input receiver for an ASurfaceControl that will receive batched input event.
AInputReceiver_createUnbatchedInputReceiver(ALooper *_Nonnull aLooper, const AInputTransferToken *_Nonnull hostInputTransferToken, const ASurfaceControl *_Nonnull aSurfaceControl, AInputReceiverCallbacks *_Nonnull aInputReceiverCallbacks)
AInputReceiver *_Nonnull
Registers an input receiver for an ASurfaceControl that will receive every input event.
AInputReceiver_getInputTransferToken(AInputReceiver *_Nonnull aInputReceiver)
const AInputTransferToken *_Nonnull
Returns the AInputTransferToken that can be used to transfer touch gesture to or from other windows.
AInputReceiver_release(AInputReceiver *_Nullable aInputReceiver)
void
Unregisters the input channel and deletes the AInputReceiver.
AInputTransferToken_fromJava(JNIEnv *_Nonnull env, jobject _Nonnull inputTransferTokenObj)
Return the AInputTransferToken wrapped by a Java InputTransferToken object.
AInputTransferToken_release(AInputTransferToken *_Nullable aInputTransferToken)
void
Removes a reference that was previously acquired in native.
AInputTransferToken_toJava(JNIEnv *_Nonnull env, const AInputTransferToken *_Nonnull aInputTransferToken)
jobject _Nonnull
Return the Java InputTransferToken object that wraps AInputTransferToken.
ANativeActivity_finish(ANativeActivity *activity)
void
Finish the given activity.
ANativeActivity_hideSoftInput(ANativeActivity *activity, uint32_t flags)
void
Hide the IME while in the given activity.
ANativeActivity_setWindowFlags(ANativeActivity *activity, uint32_t addFlags, uint32_t removeFlags)
void
Change the window flags of the given activity.
ANativeActivity_setWindowFormat(ANativeActivity *activity, int32_t format)
void
Change the window format of the given activity.
ANativeActivity_showSoftInput(ANativeActivity *activity, uint32_t flags)
void
Show the IME while in the given activity.
ANativeWindow_fromSurface(JNIEnv *env, jobject surface)
Return the ANativeWindow associated with a Java Surface object, for interacting with it through native code.
ANativeWindow_toSurface(JNIEnv *env, ANativeWindow *window)
jobject
Return a Java Surface object derived from the ANativeWindow, for interacting with it through Java code.
ASurfaceControl_acquire(ASurfaceControl *_Nonnull surface_control)
void
Acquires a reference on the given ASurfaceControl object.
ASurfaceControl_create(ASurfaceControl *_Nonnull parent, const char *_Nonnull debug_name)
See ASurfaceControl_createFromWindow.
ASurfaceControl_createFromWindow(ANativeWindow *_Nonnull parent, const char *_Nonnull debug_name)
Creates an ASurfaceControl with either ANativeWindow or an ASurfaceControl as its parent.
ASurfaceControl_fromJava(JNIEnv *_Nonnull env, jobject _Nonnull surfaceControlObj)
ASurfaceControl *_Nonnull
Return the ASurfaceControl wrapped by a Java SurfaceControl object.
ASurfaceControl_release(ASurfaceControl *_Nonnull surface_control)
void
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.
ASurfaceTransactionStats_getASurfaceControls(ASurfaceTransactionStats *_Nonnull surface_transaction_stats, ASurfaceControl *_Nullable *_Nullable *_Nonnull outASurfaceControls, size_t *_Nonnull outASurfaceControlsSize)
void
outASurfaceControls returns an array of ASurfaceControl pointers that were updated during the transaction.
ASurfaceTransactionStats_getAcquireTime(ASurfaceTransactionStats *_Nonnull surface_transaction_stats, ASurfaceControl *_Nonnull surface_control)
int64_t
Deprecated. This may return SIGNAL_PENDING because the stats can arrive before the acquire fence has signaled, depending on internal timing differences. Therefore the caller should use the acquire fence passed in to setBuffer and query the signal time.
Returns the timestamp of when the CURRENT buffer was acquired.
ASurfaceTransactionStats_getLatchTime(ASurfaceTransactionStats *_Nonnull surface_transaction_stats)
int64_t
Returns the timestamp of when the frame was latched by the framework.
ASurfaceTransactionStats_getPresentFenceFd(ASurfaceTransactionStats *_Nonnull surface_transaction_stats)
int
Returns a sync fence that signals when the transaction has been presented.
ASurfaceTransactionStats_getPreviousReleaseFenceFd(ASurfaceTransactionStats *_Nonnull surface_transaction_stats, ASurfaceControl *_Nonnull surface_control)
int
The returns the fence used to signal the release of the PREVIOUS buffer set on this surface.
ASurfaceTransactionStats_releaseASurfaceControls(ASurfaceControl *_Nonnull *_Nonnull surface_controls)
void
Releases the array of ASurfaceControls that were returned by ASurfaceTransactionStats_getASurfaceControls().
ASurfaceTransaction_apply(ASurfaceTransaction *_Nonnull transaction)
void
Applies the updates accumulated in transaction.
ASurfaceTransaction_clearFrameRate(ASurfaceTransaction *_Nonnull transaction, ASurfaceControl *_Nonnull surface_control)
void
Clears the frame rate which is set for surface_control.
ASurfaceTransaction_create()
The caller takes ownership of the transaction and must release it using ASurfaceTransaction_delete() below.
ASurfaceTransaction_delete(ASurfaceTransaction *_Nullable transaction)
void
Destroys the transaction object.
ASurfaceTransaction_fromJava(JNIEnv *_Nonnull env, jobject _Nonnull transactionObj)
Return the ASurfaceTransaction wrapped by a Java Transaction object.
ASurfaceTransaction_reparent(ASurfaceTransaction *_Nonnull transaction, ASurfaceControl *_Nonnull surface_control, ASurfaceControl *_Nullable new_parent)
void
Reparents the surface_control from its old parent to the new_parent surface control.
ASurfaceTransaction_setBuffer(ASurfaceTransaction *_Nonnull transaction, ASurfaceControl *_Nonnull surface_control, AHardwareBuffer *_Nonnull buffer, int acquire_fence_fd)
void
Updates the AHardwareBuffer displayed for surface_control.
ASurfaceTransaction_setBufferAlpha(ASurfaceTransaction *_Nonnull transaction, ASurfaceControl *_Nonnull surface_control, float alpha)
void
Sets the alpha for the buffer.
ASurfaceTransaction_setBufferDataSpace(ASurfaceTransaction *_Nonnull transaction, ASurfaceControl *_Nonnull surface_control, enum ADataSpace data_space)