Skip to content

Android 14 - compact resource entries #3366

Closed
@iBotPeaches

Description

@iBotPeaches

Steps

  • Docs
  • Sample
  • Patch

aosp-mirror/platform_frameworks_base@368cd19



    enum {
        // If set, this is a complex entry, holding a set of name/value
        // mappings.  It is followed by an array of ResTable_map structures.
        FLAG_COMPLEX = 0x0001,
        // If set, this resource has been declared public, so libraries
        // are allowed to reference it.
        FLAG_PUBLIC = 0x0002,
        // If set, this is a weak resource and may be overriden by strong
        // resources of the same name/type. This is only useful during
        // linking with other resource tables.
        FLAG_WEAK = 0x0004,
        // If set, this is a compact entry with data type and value directly
        // encoded in the this entry, see ResTable_entry::compact
        FLAG_COMPACT = 0x0008,
    };
    /* A compact entry is indicated by FLAG_COMPACT, with flags at the same
     * offset as a normal entry. This is only for simple data values where
     *
     * - size for entry or value can be inferred (both being 8 bytes).
     * - key index is encoded in 16-bit
     * - dataType is encoded as the higher 8-bit of flags
     * - data is encoded directly in this entry
     */
    struct Compact {
        uint16_t key;
        uint16_t flags;
        uint32_t data;
    } compact;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions