Setting up Native Bridge as part of the ART initialization

First of all, let's take a look at how Native Bridge is loaded in the system. Native Bridge is loaded as part of the initialization of ART. As shown in the following diagram, it includes function calls from ART to the Native Bridge implementation. At the end of this stage, the state of Native Bridge will be set to kOpened.

Loading Native Bridge

When the system is initializing ART, the Runtime::Init function is called. Inside Runtime::Init, a LoadNativeBridge function is invoked to load the Native Bridge shared library. We can see this in the following code snippet:

 bool Runtime::Init(const ...

Get Android System Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.