From 362780b526c089745db24530d624edfa1c286f0c Mon Sep 17 00:00:00 2001 From: Android Partner Docs Date: Mon, 8 Jan 2018 12:53:50 -0800 Subject: Docs: Changes to source.android.com - 181204744 Devsite localized content from translation request b4bd44... by Android Partner Docs - 181204738 Devsite localized content from translation request 6e2e74... by Android Partner Docs - 181204731 Devsite localized content from translation request c6da36... by Android Partner Docs - 181184337 Adding nav for vndk build system support file (includes v... by Heidi von Markham - 181184012 Add details on enabling vndk for a partner codebase. by Heidi von Markham - 181181304 Drop path prefix "platform/" in human readable reference ... by Android Partner Docs - 180959465 Update public documentation around versions of OpenJDK bu... by Android Partner Docs - 180959038 Update home page with Jan 2018 bulletins by Danielle Roberts - 180944987 Update january 2018 bulletin with AOSP links by Danielle Roberts - 180939327 Devsite localized content from translation request 9d7ae6... by Android Partner Docs - 180939213 Devsite localized content from translation request 761984... by Android Partner Docs - 180939203 Devsite localized content from translation request 37ad64... by Android Partner Docs - 180813220 Devsite localized content from translation request 45f650... by Android Partner Docs - 180813011 Devsite localized content from translation request 7a3ee2... by Android Partner Docs - 180813003 Devsite localized content from translation request 52d1dd... by Android Partner Docs - 180721815 Update Jan 2018 bulletin with announcement about CVE-2017... by Danielle Roberts - 180718550 Update to January 2018 bulletin for coordinated disclosure by Danielle Roberts - 180689483 Devsite localized content from translation request 015eda... by Android Partner Docs - 180689471 Devsite localized content from translation request 86e026... by Android Partner Docs - 180688614 Added note about requirement to restart the audioserver by Android Partner Docs - 180681938 Add tags for January Security Release. by Android Partner Docs - 180580440 Publish Dec 2017 Pixel bulletins by Danielle Roberts - 180574446 Clarify OTA updates instructions in FBE docs by Danielle Roberts - 180566242 Update researcher acknowledgement for CVE-2017-13221 by Danielle Roberts - 180562297 January 2018 Pixel and Android Security bulletins by Danielle Roberts - 180562227 Devsite localized content from translation request a4ca37... by Android Partner Docs - 180562222 Devsite localized content from translation request f65459... by Android Partner Docs - 180561535 Devsite localized content from translation request 881cd3... by Android Partner Docs - 180561527 Devsite localized content from translation request 51b684... by Android Partner Docs - 180561524 Devsite localized content from translation request 226f2c... by Android Partner Docs - 180560907 Devsite localized content from translation request 9b462a... by Android Partner Docs - 180560904 Devsite localized content from translation request 1e3945... by Android Partner Docs - 180560895 Devsite localized content from translation request 60fa89... by Android Partner Docs - 180560177 Devsite localized content from translation request 9f6556... by Android Partner Docs - 180560173 Devsite localized content from translation request 37eb85... by Android Partner Docs - 180560169 Devsite localized content from translation request abf551... by Android Partner Docs - 180214623 Devsite localized content from translation request 69a1b1... by Android Partner Docs - 180214622 Devsite localized content from translation request abe464... by Android Partner Docs - 180214009 Devsite localized content from translation request 1c13f2... by Android Partner Docs - 180214006 Devsite localized content from translation request 9237e3... by Android Partner Docs - 180214003 Devsite localized content from translation request 1116f7... by Android Partner Docs - 179974666 Devsite localized content from translation request afb4de... by Android Partner Docs - 179932481 Devsite localized content from translation request 499773... by Android Partner Docs - 179932464 Devsite localized content from translation request 6bcb66... by Android Partner Docs - 179932462 Devsite localized content from translation request 6c13a3... by Android Partner Docs - 179931339 Correct out of place punctuation by Danielle Roberts - 179874281 Add libFuzzer docs to SAC. by Danielle Roberts - 179859323 Exclude compatibility/source from localization by Danielle Roberts - 179836094 Devsite localized content from translation request 3dae55... by Android Partner Docs - 179835757 Devsite localized content from translation request 76210b... by Android Partner Docs - 179835692 Devsite localized content from translation request eab645... by Android Partner Docs - 179835686 Devsite localized content from translation request 23e94d... by Android Partner Docs - 179778362 Devsite localized content from translation request 6406f2... by Android Partner Docs - 179688064 Devsite localized content from translation request 713535... by Android Partner Docs - 179622714 Add information about where to find OTA logs for both A/B... by Christina Nguyen - 179617573 Incorporate CDD source assets in google3 to allow buildin... by Clay Murphy PiperOrigin-RevId: 181204744 Change-Id: If0130be7bf5d5544f5b0ddda0977243b884b9943 --- en/devices/architecture/vndk/enabling.html | 189 +++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 en/devices/architecture/vndk/enabling.html (limited to 'en/devices/architecture/vndk/enabling.html') diff --git a/en/devices/architecture/vndk/enabling.html b/en/devices/architecture/vndk/enabling.html new file mode 100644 index 00000000..a034135e --- /dev/null +++ b/en/devices/architecture/vndk/enabling.html @@ -0,0 +1,189 @@ + + + Enabling the VNDK + + + + + + +

The VNDK requires several changes to a codebase to separate concerns between +vendor and system. Use the following guide to enable VNDK in a vendor/OEM +codebase.

+ +

Build system libraries

+

The build system contains several types of objects including libraries +(shared, static, or header) and binaries:

+ + +
Figure 1. Build system libraries.
+ +
    +
  • core. Used by the system image, on the system image. These +libraries cannot be used by vendor, vendor_available, +vndk, or vndk-sp libraries. +
    +cc_library {
    +    name: "libThatIsCore",
    +    ...
    +}
    +
    +
  • + +
  • vendor-only (or proprietary). Used by the +vendor image, on the vendor image. +
    +cc_library {
    +    name: "libThatIsVendorOnly",
    +    proprietary: true,
    +    # or: vendor: true, # (for things in AOSP)
    +    ...
    +}
    +
    +
  • + +
  • vendor_available. Used by the vendor image, on the vendor +image (may contain duplicates of core). +
    +cc_library {
    +    name: "libThatIsVendorAvailable",
    +    vendor_available: true,
    +    ...
    +}
    +
    +
  • + +
  • vndk. Used by the vendor image, on the system image (a +subset of vendor_available). +
    +cc_library {
    +    name: "libThatIsVndk",
    +    vendor_available: true,
    +    vndk: {
    +        enabled: true,
    +    }
    +    ...
    +}
    +
    +
  • + +
  • vndk-sp. Used by the system image indirectly, on the +system image (subset of core). +
    +cc_library {
    +    name: "libThatIsVndkSp",
    +    vendor_available: true,
    +    vndk: {
    +        enabled: true,
    +        support_system_process: true,
    +    }
    +    ...
    +}
    +
    +
  • + +
  • llndk. Used by both the system and vendor images. +
    +llndk_library {
    +    name: "libThasIsLlndk",
    +}
    +
    +
  • +
+ +

When a lib is marked as vendor_available:true, it is built +twice:

+
    +
  • Once for platform (and thus installed to /system/lib).
  • +
  • Once for vendor (and thus installed to /vendor/lib, +/system/lib/vndk, or /system/lib/vndk-sp).
  • +
+ +

The vendor versions of libs are built with -D__ANDROID_VNDK__. +Private system components that may change significantly in future versions of +Android are disabled with this flag. In addition, different libraries export a +different set of headers (such as liblog). Options specific to a +vendor variant of a target can be specified in an Android.bp file +in:

+
target: { vendor: { … } }
+ +

Enabling VNDK for a codebase

+

To enable the VNDK for a codebase:

+
    +
  1. Determine eligibility by calculating the required sizes of +vendor.img and system.img partitions.
  2. +
  3. Enable BOARD_VNDK_VERSION=current. You can add to +BoardConfig.mk or build components with it directly (i.e. +m -j BOARD_VNDK_VERSION=current MY-LIB).
  4. +
+

After enabling BOARD_VNDK_VERSION=current, the build system +enforces the following dependency and header requirements.

+ +

Managing dependencies

+

A vendor object that depends on a core component +that doesn't exist in the vndk or as a vendor object +must be resolved using one of the following options:

+
    +
  • The dependency can be removed.
  • +
  • If the core component is owned by vendor, it can +be marked as vendor_available or vendor.
  • +
  • A change making the core object part of the vndk may be +upstreamed to Google.
  • +
+

In addition, if a core component has dependencies on a +vendor component, the vendor component must be made +into a core component or the dependency must be +removed in another way (for example, by removing the dependency or by moving the +dependency into a vendor component).

+ +

Managing headers

+

Global header dependencies must be removed to enable the build system to know +whether to build the headers with or without -D__ANDROID_VNDK__. +For example, libutils headers such as utils/StrongPointer.h can +still be accessed using the header library +libutils_headers. +

+ +

Some headers (such as unistd.h) can no longer be transitively +included but can be included locally.

+ +

Finally, the public part of private/android_filesystem_config.h +has been moved to cutils/android_filesystem_config.h. To manage +these headers, do one of the following:

+ +
    +
  • Remove the dependency to +private/android_filesystem_config.h by replacing all +AID_* macros with +getgrnam/getpwnam +calls if possible. For example: + +
      +
    • (uid_t)AID_WIFI becomes +getpwnam("wifi")->pw_uid.
    • +
    • (gid_t)AID_SDCARD_R becomes +getgrnam("sdcard_r")->gr_gid.
    • +
    +For details, refer to +private/android_filesystem_config.h. +
  • +
  • For hard-coded AIS, include +cutils/android_filesystem_config.h.
  • +
+ + + -- cgit v1.2.3