code:
/*
 *
 *  Copyright (c) 2013, The Linux Foundation. All rights reserved.
 *  Not a Contribution, Apache license notifications and license are retained
 *  for attribution purposes only.
 *
 * Copyright (C) 2012 The Android Open Source Project
 * Copyright (C) 2018 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif
int property_get(const char *key, char *value, const char *default_value);
#ifdef __cplusplus
}
#endif

#include "osi/include/osi.h"

typedef struct {
    const char *product_device;
    const char *product_model;
} device_t;

static const device_t devices[] = {
};

static inline const char *BtmGetDefaultName()
{
    char product_device[92];
    property_get("ro.product.device", product_device, "");

    for (unsigned int i = 0; i < ARRAY_SIZE(devices); i++) {
        device_t device = devices[i];

        if (strcmp(device.product_device, product_device) == 0) {
            return device.product_model;
        }
    }

    // Fallback to ro.product.model
    return "";
}

#define BTM_DEF_LOCAL_NAME BtmGetDefaultName()
// Disables read remote device feature
#define MAX_ACL_CONNECTIONS   16
#define MAX_L2CAP_CHANNELS    32
#define BLE_VND_INCLUDED   TRUE
#define GATT_MAX_PHY_CHANNEL  10

#define AVDT_NUM_SEPS 35

#endif


code:
<!--
    Input:
        manifest.xml
-->
<!--
    Autogenerated skeleton compatibility matrix.
    Use with caution. Modify it to suit your needs.
    All HALs are set to optional.
    Many entries other than HALs are zero-filled and
    require human attention.
-->
<compatibility-matrix version="1.0" type="device">
    <hal format="hidl" optional="false">
        <name>android.frameworks.displayservice</name>
        <version>1.0</version>
        <interface>
            <name>IDisplayService</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.frameworks.schedulerservice</name>
        <version>1.0</version>
        <interface>
            <name>ISchedulingPolicyService</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.frameworks.sensorservice</name>
        <version>1.0</version>
        <interface>
            <name>ISensorManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.hidl.manager</name>
        <version>1.2</version>
        <interface>
            <name>IServiceManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.hidl.memory</name>
        <version>1.0</version>
        <interface>
            <name>IMapper</name>
            <instance>ashmem</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.hidl.token</name>
        <version>1.0</version>
        <interface>
            <name>ITokenManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.system.net.netd</name>
        <version>1.1</version>
        <interface>
            <name>INetd</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="false">
        <name>android.system.wifi.keystore</name>
        <version>1.0</version>
        <interface>
            <name>IKeystore</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="true">
        <name>vendor.qti.hardware.qccsyshal</name>
        <version>1.0</version>
        <interface>
            <name>IQccsyshal</name>
            <instance>qccsyshal</instance>
        </interface>
    </hal>
</compatibility-matrix>

license: unknown


code:
[AID_VENDOR_QTI_DIAG]
value:2901

[AID_VENDOR_QDSS]
value:2902

[AID_VENDOR_RFS]
value:2903

[AID_VENDOR_RFS_SHARED]
value:2904

[AID_VENDOR_ADPL_ODL]
value:2905

[AID_VENDOR_QRTR]
value:2906

[AID_VENDOR_THERMAL]
value:2907

[AID_VENDOR_FASTRPC]
value:2908

[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND NET_ADMIN

[vendor/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT

[vendor/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE

[vendor/bin/imsdatadaemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE

[vendor/bin/ims_rtp_daemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE

[vendor/bin/imsrcsd]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM

[vendor/bin/cnd]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN

[vendor/bin/slim_daemon]
mode: 0755
user:  AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE

[vendor/bin/loc_launcher]
mode: 0755
user:  AID_GPS
group: AID_GPS
caps: SETUID SETGID

[vendor/bin/xtwifi-client]
mode: 0755
user:  AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM

[vendor/bin/sensors.qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE

[vendor/firmware_mnt/image/*]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0

[persist/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0


code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<config>
    <component-override package="com.android.bluetooth" >
        <component class=".avrcpcontroller.AvrcpControllerService" enabled="true" />
        <component class=".hid.HidDeviceService" enabled="true" />
        <component class=".sap.SapService" enabled="true" />
    </component-override>
</config>


code:
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
#       copyright notice, this list of conditions and the following
#       disclaimer in the documentation and/or other materials provided
#       with the distribution.
#     * Neither the name of The Linux Foundation nor the names of its
#       contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

key 115   VOLUME_UP
key 114   VOLUME_DOWN
key 102   HOME
key 528   FOCUS
key 766   CAMERA


code:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.

     Not a Contribution.

     Copyright 2015 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<MediaCodecs>
    <Encoders>
        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="45-90" />
            <Limit name="measured-frame-rate-720x480" range="80-90" />
            <Limit name="measured-frame-rate-1280x720" range="32-37" />
            <Limit name="measured-frame-rate-1920x1080" range="40-40" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-320x240" range="226-226" />
            <Limit name="measured-frame-rate-720x480" range="121-121" />
            <Limit name="measured-frame-rate-1280x720" range="49-49" />
            <Limit name="measured-frame-rate-1920x1080" range="16-45" />
            <Limit name="measured-frame-rate-3840x2160" range="13-26" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" update="true">
            <Limit name="measured-frame-rate-176x144" range="65-130" />
            <Limit name="measured-frame-rate-352x288" range="261-261" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
            <Limit name="measured-frame-rate-176x144" range="72-135" />
            <Limit name="measured-frame-rate-352x288" range="263-263" />
            <Limit name="measured-frame-rate-640x480" range="144-144" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x180" range="312-312" />
            <Limit name="measured-frame-rate-640x360" range="175-174" />
            <Limit name="measured-frame-rate-1280x720" range="30-40" />
            <Limit name="measured-frame-rate-1920x1080" range="20-25" />
        </MediaCodec>
        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="185-185" />
            <Limit name="measured-frame-rate-720x480" range="87-87" />
            <Limit name="measured-frame-rate-1280x720" range="45-45" />
            <Limit name="measured-frame-rate-1920x1080" range="28-28" />
        </MediaCodec>
        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="295-310" />
            <Limit name="measured-frame-rate-720x480" range="25-50" />
            <Limit name="measured-frame-rate-1280x720" range="22-44" />
            <Limit name="measured-frame-rate-1920x1080" range="16-30" />
        </MediaCodec>
        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
            <Limit name="measured-frame-rate-176x144" range="350-365" />
        </MediaCodec>
        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
            <Limit name="measured-frame-rate-176x144" range="190-290" />
        </MediaCodec>
        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
            <Limit name="measured-frame-rate-176x144" range="385-385" />
        </MediaCodec>
        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
            <Limit name="measured-frame-rate-176x144" range="350-360" />
        </MediaCodec>
        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-320x240" range="13-21" />
        </MediaCodec>
        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x180" range="100-120" />
            <Limit name="measured-frame-rate-640x360" range="45-50" />
            <Limit name="measured-frame-rate-1280x720" range="30-35" />
            <Limit name="measured-frame-rate-1920x1080" range="20-30" />
        </MediaCodec>
        <MediaCodec name="OMX.google.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x180" range="140-180" />
            <Limit name="measured-frame-rate-640x360" range="45-60" />
            <Limit name="measured-frame-rate-1280x720" range="12-15" />
       </MediaCodec>
       <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x180" range="87-175" />
            <Limit name="measured-frame-rate-640x360" range="49-98" />
            <Limit name="measured-frame-rate-1280x720" range="17-34" />
            <Limit name="measured-frame-rate-1920x1080" range="7-15" />
        </MediaCodec>
    </Encoders>
    <Decoders>
        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="555-566" />
            <Limit name="measured-frame-rate-720x480" range="239-239" />
            <Limit name="measured-frame-rate-1280x720" range="197-197" />
            <Limit name="measured-frame-rate-1920x1088" range="88-88" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="650-655" />
            <Limit name="measured-frame-rate-640x360" range="395-398" />
            <Limit name="measured-frame-rate-720x480" range="300-304" />
            <Limit name="measured-frame-rate-1280x720" range="241-241" />
            <Limit name="measured-frame-rate-1920x1088" range="90-100" />
            <Limit name="measured-frame-rate-3840x2160" range="30-40" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" update="true">
            <Limit name="measured-frame-rate-176x144" range="890-898" />
            <Limit name="measured-frame-rate-352x288" range="840-850" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" update="true">
            <Limit name="measured-frame-rate-176x144" range="850-875" />
            <Limit name="measured-frame-rate-480x360" range="766-794" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x180" range="680-696" />
            <Limit name="measured-frame-rate-640x360" range="400-415" />
            <Limit name="measured-frame-rate-1280x720" range="350-358" />
            <Limit name="measured-frame-rate-1920x1080" range="199-199" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x180" range="500-524" />
            <Limit name="measured-frame-rate-640x360" range="360-366" />
            <Limit name="measured-frame-rate-1280x720" range="190-210" />
            <Limit name="measured-frame-rate-1920x1080" range="170-190" />
            <Limit name="measured-frame-rate-3840x2160" range="48-48" />
        </MediaCodec>
        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="320-350" />
            <Limit name="measured-frame-rate-720x480" range="100-130" />
            <Limit name="measured-frame-rate-1280x720" range="50-58" />
            <Limit name="measured-frame-rate-1920x1080" range="20-30" />
        </MediaCodec>
        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="233-236" />
            <Limit name="measured-frame-rate-720x480" range="24-48"/>
            <Limit name="measured-frame-rate-1280x720" range="13-19" />
            <Limit name="measured-frame-rate-1920x1080" range="5-10" />
        </MediaCodec>
        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="458-458" />
            <Limit name="measured-frame-rate-640x360" range="210-215" />
            <Limit name="measured-frame-rate-720x480" range="120-125" />
            <Limit name="measured-frame-rate-1280x720" range="70-85" />
            <Limit name="measured-frame-rate-1920x1080" range="45-48" />
        </MediaCodec>
        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="250-258" />
            <Limit name="measured-frame-rate-640x360" range="110-114" />
            <Limit name="measured-frame-rate-720x480" range="24-48" />
            <Limit name="measured-frame-rate-1280x720" range="50-55" />
            <Limit name="measured-frame-rate-1920x1080" range="8-16" />
        </MediaCodec>
        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
            <Limit name="measured-frame-rate-176x144" range="650-710" />
            <Limit name="measured-frame-rate-352x288" range="370-481" />
        </MediaCodec>
        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
             <Limit name="measured-frame-rate-176x144" range="650-710"/>
             <Limit name="measured-frame-rate-352x288" range="370-481" />
        </MediaCodec>
        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x240" range="480-490" />
            <Limit name="measured-frame-rate-640x360" range="199-201" />
            <Limit name="measured-frame-rate-1280x720" range="45-55" />
            <Limit name="measured-frame-rate-1920x1080" range="18-22" />
        </MediaCodec>
        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
            <Limit name="measured-frame-rate-320x180" range="480-490" />
            <Limit name="measured-frame-rate-640x360" range="199-201" />
            <Limit name="measured-frame-rate-1280x720" range="22-45" />
            <Limit name="measured-frame-rate-1920x1080" range="11-22" />
        </MediaCodec>
        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x240" range="580-604" />
            <Limit name="measured-frame-rate-640x360" range="180-185" />
            <Limit name="measured-frame-rate-1280x720" range="88-92" />
            <Limit name="measured-frame-rate-1920x1080" range="47-52" />
        </MediaCodec>
        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x180" range="290-294" />
            <Limit name="measured-frame-rate-320x240" range="48-96" />
            <Limit name="measured-frame-rate-640x360" range="130-134" />
            <Limit name="measured-frame-rate-1280x720" range="65-70" />
            <Limit name="measured-frame-rate-1920x1080" range="40-45" />
        </MediaCodec>
        <MediaCodec name="OMX.google.mpeg4.decoder" update="true">
            <Type name="video/mp4v-es">
                <Limit name="measured-frame-rate-176x144" range="380-400" />
            </Type>
         </MediaCodec>
         <MediaCodec name="c2.android.mpeg4.decoder" update="true">
            <Type name="video/mp4v-es">
                <Limit name="measured-frame-rate-176x144" range="700-715" />
            </Type>
         </MediaCodec>
    </Decoders>
</MediaCodecs>


code:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2012-2019 The Linux Foundation. All rights reserved.
     Not a contribution.

     Copyright (C) 2012-2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!--
<!DOCTYPE MediaCodecs [
<!ELEMENT Include EMPTY>
<!ATTLIST Include href CDATA #REQUIRED>
<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
<!ELEMENT Decoders (MediaCodec|Include)*>
<!ELEMENT Encoders (MediaCodec|Include)*>
<!ELEMENT MediaCodec (Type|Quirk|Include)*>
<!ATTLIST MediaCodec name CDATA #REQUIRED>
<!ATTLIST MediaCodec type CDATA>
<!ELEMENT Type EMPTY>
<!ATTLIST Type name CDATA #REQUIRED>
<!ELEMENT Quirk EMPTY>
<!ATTLIST Quirk name CDATA #REQUIRED>
]>

There's a simple and a complex syntax to declare the availability of a
media codec:

A codec that properly follows the OpenMax spec and therefore doesn't have any
quirks and that only supports a single content type can be declared like so:

    <MediaCodec name="OMX.foo.bar" type="something/interesting" />

If a codec has quirks OR supports multiple content types, the following syntax
can be used:

    <MediaCodec name="OMX.foo.bar" >
        <Type name="something/interesting" />
        <Type name="something/else" />
        ...
        <Quirk name="requires-allocate-on-input-ports" />
        <Quirk name="requires-allocate-on-output-ports" />
        <Quirk name="output-buffers-are-unreadable" />
    </MediaCodec>

Only the three quirks included above are recognized at this point:

"requires-allocate-on-input-ports"
    must be advertised if the component does not properly support specification
    of input buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"requires-allocate-on-output-ports"
    must be advertised if the component does not properly support specification
    of output buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"output-buffers-are-unreadable"
    must be advertised if the emitted output buffers of a decoder component
    are not readable, i.e. use a custom format even though abusing one of
    the official OMX colorspace constants.
    Clients of such decoders will not be able to access the decoded data,
    naturally making the component much less useful. The only use for
    a component with this quirk is to render the output to the screen.
    Audio decoders MUST NOT advertise this quirk.
    Video decoders that advertise this quirk must be accompanied by a
    corresponding color space converter for thumbnail extraction,
    matching surfaceflinger support that can render the custom format to
    a texture and possibly other code, so just DON'T USE THIS QUIRK.

-->

<!--
  Non secure decoder capabilities for sdm660
   __________ _________________________________________
  | Codec    | W       H       fps     Mbps    MB/s    |
  |__________|_________________________________________|
  | hevc     | 3840    2160    30      100     972000  |
  | h264     | 3840    2160    30      100     972000  |
  | h263     |  864     480    30        2      48600  |
  | mpeg4    | 1920    1088    60       60     489600  |
  | mpeg2    | 1920    1088    30       40     244800  |
  | vc1      | 1920    1088    60       60     489600  |
  | vp8      | 3840    2160    30      100     972000  |
  | vp9      | 3840    2160    30      100     972000  |
  | divx3    |  720     480    30        2      40500  |
  | div4/5/6 | 1920    1088    30       10     244800  |
  |__________|_________________________________________|

  sdm660 secure decoder capabilities
   ______________________________________________________
 | Codec    | W       H       fps     Mbps    MB/s    |
 |__________|_________________________________________|
 | h264     | 3840    2160    30      35      972000 |
 | hevc     | 3840    2160    30      35      972000 |
 | VP9      | 3840    2160    30      35      979200  |
 | vc1      | 1920    1088    30      20      489600  |
 | mpeg2    | 1920    1088    30      20      244800  |
 |__________|_________________________________________|
-->

<!--
  Encoder capabilities for sdm660
   ____________________________________________________
  | Codec    | W       H       fps     Mbps    MB/s    |
  |__________|_________________________________________|
  | hevc     | 3840    2160    30      100     972000  |
  | h264     | 3840    2160    30      100     972000  |
  | h263     |  864     480    30        2      48600  |
  | mpeg4    | 1920    1088    30       40     244800  |
  | vp8      | 1920    1088    30       40     244800  |
  |____________________________________________________|
-->

<MediaCodecs>
    <Include href="media_codecs_google_audio.xml" />
    <Include href="media_codecs_vendor_audio.xml" />
    <Include href="media_codecs_google_telephony.xml" />
    <Settings>
        <Setting name="max-video-encoder-input-buffers" value="11" />
    </Settings>
    <Encoders>
        <!-- Video Hardware  -->
        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Quirk name="requires-loaded-to-idle-after-allocation" />
            <Limit name="size" min="176x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Limit name="concurrent-instances" max="16" />
            <Feature name="intra-refresh" />
            <Limit name="performance-point-3840x2160" value="24" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Quirk name="requires-loaded-to-idle-after-allocation" />
            <Limit name="size" min="96x96" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Limit name="concurrent-instances" max="16" />
            <Feature name="intra-refresh" />
            <Feature name="can-swap-width-height" />
            <Limit name="performance-point-3840x2160" value="24" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Quirk name="requires-loaded-to-idle-after-allocation" />
            <Limit name="size" min="96x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-40000000" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Quirk name="requires-loaded-to-idle-after-allocation" />
            <Limit name="size" min="96x64" max="864x480" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="48600" />
            <Limit name="bitrate" range="1-2000000" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-720x480" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Quirk name="requires-loaded-to-idle-after-allocation" />
            <Limit name="size" min="96x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-40000000" />
            <Limit name="concurrent-instances" max="16" />
            <Feature name="intra-refresh" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
    </Encoders>
    <Decoders>
        <!-- Video Hardware  -->
        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Feature name="can-swap-width-height" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-35000000" />
            <Feature name="adaptive-playback" />
            <Feature name="secure-playback" required="true" />
            <Limit name="concurrent-instances" max="6" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-40000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-20000000" />
            <Feature name="adaptive-playback" />
            <Feature name="secure-playback" required="true" />
            <Limit name="concurrent-instances" max="6" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="489600" />
            <Limit name="bitrate" range="1-60000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="60" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="864x480" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="48600" />
            <Limit name="bitrate" range="1-2000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-720x480" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vc1" type="video/x-ms-wmv" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="489600" />
            <Limit name="bitrate" range="1-60000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vc1.secure" type="video/x-ms-wmv" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="489600" />
            <Limit name="bitrate" range="1-20000000" />
            <Feature name="adaptive-playback" />
            <Feature name="secure-playback" required="true" />
            <Limit name="concurrent-instances" max="7" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.divx" type="video/divx" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-10000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.divx311" type="video/divx311" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="720x480" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="40500" />
            <Limit name="bitrate" range="1-2000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-720x480" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.divx4" type="video/divx4" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="1920x1088" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="244800" />
            <Limit name="bitrate" range="1-10000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-1920x1088" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="979200" />
            <Limit name="bitrate" range="1-35000000" />
            <Limit name="frame-rate" range="1-30" />
            <Feature name="adaptive-playback" />
            <Feature name="secure-playback" required="true" />
            <Limit name="concurrent-instances" max="6" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-100000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="64x64" max="3840x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="1" max="972000" />
            <Limit name="bitrate" range="1-35000000" />
            <Feature name="adaptive-playback" />
            <Feature name="secure-playback" required="true" />
            <Limit name="concurrent-instances" max="6" />
            <Limit name="performance-point-3840x2160" value="30" />
        </MediaCodec>
    </Decoders>
    <Include href="media_codecs_google_video.xml" />
</MediaCodecs>


code:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2015-2020 The Linux Foundation. All rights reserved.
     Not a contribution.
     Copyright (C) 2012 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<Included>
    <Decoders>
        <MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/>
        <!-- SimpleOMXComponet based software decoder-->
    </Decoders>
</Included>


code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!DOCTYPE MediaSettings [
<!ELEMENT MediaSettings (CamcorderProfiles,
                         EncoderOutputFileFormat+,
                         VideoEncoderCap+,
                         AudioEncoderCap+,
                         VideoDecoderCap,
                         AudioDecoderCap)>
<!ELEMENT CamcorderProfiles (EncoderProfile+, ImageEncoding+, ImageDecoding, Camera)>
<!ELEMENT EncoderProfile (Video, Audio)>
<!ATTLIST EncoderProfile quality (high|low) #REQUIRED>
<!ATTLIST EncoderProfile fileFormat (mp4|3gp) #REQUIRED>
<!ATTLIST EncoderProfile duration (30|60) #REQUIRED>
<!ATTLIST EncoderProfile cameraId (0|1|2|3|4|5) #REQUIRED>
<!ELEMENT Video EMPTY>
<!ATTLIST Video codec (h264|h263|m4v) #REQUIRED>
<!ATTLIST Video bitRate CDATA #REQUIRED>
<!ATTLIST Video width CDATA #REQUIRED>
<!ATTLIST Video height CDATA #REQUIRED>
<!ATTLIST Video frameRate CDATA #REQUIRED>
<!ELEMENT Audio EMPTY>
<!ATTLIST Audio codec (amrnb|amrwb|aac) #REQUIRED>
<!ATTLIST Audio bitRate CDATA #REQUIRED>
<!ATTLIST Audio sampleRate CDATA #REQUIRED>
<!ATTLIST Audio channels (1|2) #REQUIRED>
<!ELEMENT ImageEncoding EMPTY>
<!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
<!ELEMENT ImageDecoding EMPTY>
<!ATTLIST ImageDecoding memCap CDATA #REQUIRED>
<!ELEMENT Camera EMPTY>
<!ELEMENT EncoderOutputFileFormat EMPTY>
<!ATTLIST EncoderOutputFileFormat name (mp4|3gp) #REQUIRED>
<!ELEMENT VideoEncoderCap EMPTY>
<!ATTLIST VideoEncoderCap name (h264|h263|m4v|wmv) #REQUIRED>
<!ATTLIST VideoEncoderCap enabled (true|false) #REQUIRED>
<!ATTLIST VideoEncoderCap minBitRate CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap maxBitRate CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap minFrameWidth CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap maxFrameWidth CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap minFrameHeight CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap maxFrameHeight CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap minFrameRate CDATA #REQUIRED>
<!ATTLIST VideoEncoderCap maxFrameRate CDATA #REQUIRED>
<!ELEMENT AudioEncoderCap EMPTY>
<!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma) #REQUIRED>
<!ATTLIST AudioEncoderCap enabled (true|false) #REQUIRED>
<!ATTLIST AudioEncoderCap minBitRate CDATA #REQUIRED>
<!ATTLIST AudioEncoderCap maxBitRate CDATA #REQUIRED>
<!ATTLIST AudioEncoderCap minSampleRate CDATA #REQUIRED>
<!ATTLIST AudioEncoderCap maxSampleRate CDATA #REQUIRED>
<!ATTLIST AudioEncoderCap minChannels (1|2) #REQUIRED>
<!ATTLIST AudioEncoderCap maxChannels (1|2) #REQUIRED>
<!ELEMENT VideoDecoderCap EMPTY>
<!ATTLIST VideoDecoderCap name (wmv) #REQUIRED>
<!ATTLIST VideoDecoderCap enabled (true|false) #REQUIRED>
<!ELEMENT AudioDecoderCap EMPTY>
<!ATTLIST AudioDecoderCap name (wma) #REQUIRED>
<!ATTLIST AudioDecoderCap enabled (true|false) #REQUIRED>
]>
<!--
     This file is used to declare the multimedia profiles and capabilities
     on an android-powered device.
-->
<MediaSettings>
    <!-- Each camcorder profile defines a set of predefined configuration parameters -->
    <CamcorderProfiles cameraId="0">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="4kdci" fileFormat="mp4" duration="30">
      	    <Video codec="h264"
            	   bitRate="42000000"
            	   width="4096"
            	   height="2160"
            	   frameRate="24" />

            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="2160p" fileFormat="mp4" duration="30">
            <Video codec="h264"
            	   bitRate="42000000"
            	   width="3840"
            	   height="2160"
            	   frameRate="30" />

            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
    	</EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>

    <CamcorderProfiles cameraId="1">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
      	    <Video codec="h264"
                   bitRate="20000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />

      	    <Audio codec="aac"
             	   bitRate="156000"
             	   sampleRate="48000"
             	   channels="2" />
        </EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>
    <CamcorderProfiles cameraId="2">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>

    <CamcorderProfiles cameraId="3">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>
    <CamcorderProfiles cameraId="4">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="17000000"
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>

    <CamcorderProfiles cameraId="5">

        <EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
            <Video codec="h264"
                   bitRate="128000"
                   width="320"
                   height="240"
                   frameRate="30" />
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="192000"
                   width="176"
                   height="144"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="amrnb"
                   bitRate="12200"
                   sampleRate="8000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="1200000"
                   width="352"
                   height="288"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="6000000"
                   width="720"
                   height="480"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   bitRate="12000000"
                   width="1280"
                   height="720"
                   frameRate="30" />
            <!-- audio setting is ignored -->
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <ImageEncoding quality="95" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

    </CamcorderProfiles>

    <EncoderOutputFileFormat name="3gp" />
    <EncoderOutputFileFormat name="mp4" />

    <!--
         If a codec is not enabled, it is invisible to the applications
         In other words, the applications won't be able to use the codec
         or query the capabilities of the codec at all if it is disabled
    -->
    <VideoEncoderCap name="h264" enabled="true"
        minBitRate="64000" maxBitRate="42000000"
        minFrameWidth="176" maxFrameWidth="4096"
        minFrameHeight="144" maxFrameHeight="2160"
        minFrameRate="15" maxFrameRate="30" />

    <VideoEncoderCap name="h263" enabled="true"
        minBitRate="64000" maxBitRate="2000000"
        minFrameWidth="176" maxFrameWidth="800"
        minFrameHeight="144" maxFrameHeight="480"
        minFrameRate="15" maxFrameRate="30" />

    <VideoEncoderCap name="m4v" enabled="true"
        minBitRate="64000" maxBitRate="40000000"
        minFrameWidth="176" maxFrameWidth="1920"
        minFrameHeight="144" maxFrameHeight="1080"
        minFrameRate="15" maxFrameRate="30" />

    <AudioEncoderCap name="aac" enabled="true"
        minBitRate="758" maxBitRate="288000"
        minSampleRate="8000" maxSampleRate="48000"
        minChannels="1" maxChannels="6" />

    <AudioEncoderCap name="heaac" enabled="true"
        minBitRate="8000" maxBitRate="64000"
        minSampleRate="16000" maxSampleRate="48000"
        minChannels="1" maxChannels="2" />

    <AudioEncoderCap name="aaceld" enabled="true"
        minBitRate="16000" maxBitRate="192000"
        minSampleRate="16000" maxSampleRate="48000"
        minChannels="1" maxChannels="2" />

    <AudioEncoderCap name="amrwb" enabled="true"
        minBitRate="6600" maxBitRate="23050"
        minSampleRate="16000" maxSampleRate="16000"
        minChannels="1" maxChannels="1" />

    <AudioEncoderCap name="amrnb" enabled="true"
        minBitRate="5525" maxBitRate="12200"
        minSampleRate="8000" maxSampleRate="8000"
        minChannels="1" maxChannels="1" />

    <!--
        FIXME:
        We do not check decoder capabilities at present
        At present, we only check whether windows media is visible
        for TEST applications. For other applications, we do
        not perform any checks at all.
    -->
    <VideoDecoderCap name="wmv" enabled="false"/>
    <AudioDecoderCap name="wma" enabled="false"/>
</MediaSettings>


code:
PRIO=1,1,0,0,0,0,0,0
#arch_timer, arm-pmu, arch_mem_timer, glink-smem-rpm, mpm irqs
IGNORED_IRQ=19,22,39,200,203
#WLAN irqs
BLACKLIST_IRQ=446,455,456


code:
###################### Start of libnfc-common.conf #######################

###############################################################################
# Application options
APPL_TRACE_LEVEL=0xFF
PROTOCOL_TRACE_LEVEL=0xFFFFFFFF

NFC_DEBUG_ENABLED=0x01

###############################################################################
# File used for NFA storage
NFA_STORAGE="/data/nfc"

###############################################################################
# Force UICC to only listen to the following technology(s).
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F
UICC_LISTEN_TECH_MASK=0x07

###############################################################################
# Configure the default Destination Gate used by HCI (the default is 4, which
# is the ETSI loopback gate.
NFA_HCI_DEFAULT_DEST_GATE=0xF0

###############################################################################
# Forcing HOST to listen for a selected protocol
# 0x00 : Disable Host Listen
# 0x01 : Enable Host to Listen (A)  for ISO-DEP tech A
# 0x02 : Enable Host to Listen (B)  for ISO-DEP tech B
# 0x04 : Enable Host to Listen (F)  for T3T Tag Type Protocol tech F
# 0x07 : Enable Host to Listen (ABF)for ISO-DEP tech AB & T3T Tag Type Protocol tech F
HOST_LISTEN_TECH_MASK=0x07

###############################################################################
# Enabling/Disabling Forward functionality
# Disable           0x00
# Enable            0x01
NXP_FWD_FUNCTIONALITY_ENABLE=0x01

###############################################################################
# AID for Empty Select command
# If specified, this AID will be substituted when an Empty SELECT command is
# detected.  The first byte is the length of the AID.  Maximum length is 16.
AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00}

###############################################################################
# When screen is turned off, specify the desired power state of the controller.
# 0: power-off-sleep state; DEFAULT
# 1: full-power state
# 2: screen-off card-emulation (CE4/CE3/CE1 modes are used)
SCREEN_OFF_POWER_STATE=1

###############################################################################
# Firmware patch format, Only 1 and 5 should be set
#   0 -> NFC Default
#   1 -> EMVCO Default
#   3 -> EMVCO Polling, DISC_IDLE = POWER_OFF, DISC DEACTIVATE =  Removal process
#   5 -> EMVCO Cert Polling, DISC_IDLE = Removal process  , DISC DEACTIVATE =   POWER_OFF
#   7 -> EMVCO Polling, DISC_IDLE = POWER_OFF, DISC DEACTIVATE =  POWER_OFF
NFA_CONFIG_FORMAT=1

###############################################################################
# Default poll duration (in ms)
#  The defualt is 500ms if not set (see nfc_target.h)
#NFA_DM_DISC_DURATION_POLL=333

###############################################################################
# Force tag polling for the following technology(s).
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B |
#            NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 |
#            NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO |
#            NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE.
#
# Notable bits:
# NFA_TECHNOLOGY_MASK_A             0x01    /* NFC Technology A             */
# NFA_TECHNOLOGY_MASK_B             0x02    /* NFC Technology B             */
# NFA_TECHNOLOGY_MASK_F             0x04    /* NFC Technology F             */
# NFA_TECHNOLOGY_MASK_ISO15693	    0x08    /* Proprietary Technology       */
# NFA_TECHNOLOGY_MASK_KOVIO	    0x20    /* Proprietary Technology       */
# NFA_TECHNOLOGY_MASK_A_ACTIVE      0x40    /* NFC Technology A active mode */
# NFA_TECHNOLOGY_MASK_F_ACTIVE      0x80    /* NFC Technology F active mode */
POLLING_TECH_MASK=0xEF

###############################################################################
# Force P2P to only listen for the following technology(s).
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F |
#            NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE
#
# Notable bits:
# NFA_TECHNOLOGY_MASK_A	            0x01    /* NFC Technology A             */
# NFA_TECHNOLOGY_MASK_F	            0x04    /* NFC Technology F             */
# NFA_TECHNOLOGY_MASK_A_ACTIVE      0x40    /* NFC Technology A active mode */
# NFA_TECHNOLOGY_MASK_F_ACTIVE      0x80    /* NFC Technology F active mode */
P2P_LISTEN_TECH_MASK=0xC5

PRESERVE_STORAGE=0x01

###############################################################################
# Deactivate notification wait time out in seconds used in ETSI Reader mode
# 0 - Infinite wait
NFA_DM_DISC_NTF_TIMEOUT=0

###############################################################################
# AID_MATCHING constants
# AID_MATCHING_EXACT_ONLY 0x00
# AID_MATCHING_EXACT_OR_PREFIX 0x01
# AID_MATCHING_PREFIX_ONLY 0x02
AID_MATCHING_MODE=0x01

###############################################################################


code:
[priority] # This profile is reserved for perflock requests
99


code:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2017, The Linux Foundation. All rights reserved.

  ~ Not a Contribution.
-->

<!--
  ~ Copyright (C) 2016 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<!--
This XML file declares which signature|privileged permissions should be
granted to privileged applications on QTI devices.
It allows additional grants on top of privapp-permissions-platform.xml
-->

<permissions>
    <privapp-permissions package="com.qualcomm.qcrilmsgtunnel">
        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
    </privapp-permissions>

    <privapp-permissions package="org.codeaurora.ims">
        <permission name="android.permission.READ_PRECISE_PHONE_STATE"/>
        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
        <permission name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME"/>
    </privapp-permissions>
</permissions>


code:
libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libfastcvopt.so
liblistenjni.so
liblistensoundmodel2.so
libOpenCL.so
libnpu.so
libhta_controller.so
libhta_hexagon_runtime.so
unnhal-acc-hta.so
libprotobuf-cpp-full.so
libprotobuf-cpp-lite.so


code:
#Debug messages with priority >= ANDROID_LOG_WARN
QMI_CCI_DEBUG_LEVEL=5
QMI_CSI_DEBUG_LEVEL=5


code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<!--
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *     * Neither the name of The Linux Foundation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-->

<config>
    <!-- These are telephony components that need to freely run in the background -->
    <allow-in-power-save package="com.qualcomm.atfwd" />
    <allow-in-power-save package="com.qualcomm.qti.telephonyservice" />
    <allow-in-power-save package="com.qulacomm.qcrilmsgtunnel" />
    <allow-in-power-save package="com.qualcomm.qti.ims" />
    <allow-in-power-save package="com.qualcomm.qti.radioconfiginterface" />
    <!-- These telephony applications need access to non-[System]SDK APIs -->
    <hidden-api-whitelisted-app package="com.qualcomm.uimremoteserver" />
    <hidden-api-whitelisted-app package="com.qualcomm.uimremoteclient" />
    <hidden-api-whitelisted-app package="com.qualcomm.atfwd" />
    <hidden-api-whitelisted-app package="com.qti.qualcomm.datastatusnotification" />
    <hidden-api-whitelisted-app package="com.qti.qualcomm.deviceinfo" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.modemtestmode" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.networksetting" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.qtisystemservice" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.telephonyservice" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.radioconfiginterface" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.radioconfigtest" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.roamingsettings" />
    <hidden-api-whitelisted-app package="org.codeaurora.ims" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.ims" />
    <hidden-api-whitelisted-app package="com.qti.xdivert" />
    <hidden-api-whitelisted-app package="com.qualcomm.qcrilmsgtunnel" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.ltedirect" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.app" />
    <hidden-api-whitelisted-app package="com.qualcomm.embms" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.embmstuneaway" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.uimlpatest" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.lpa" />
    <hidden-api-whitelisted-app package="com.qualcomm.qti.uim" />
</config>


code:
# Copyright (c) 2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc
#
# Not a contribution.
#
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

mmap: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
munmap: 1
getuid: 1
writev: 1
prctl: arg0 == PR_SET_VMA || arg0 == PR_GET_DUMPABLE
mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
openat: 1
futex: 1
close: 1
read: 1
newfstatat: 1
fstat: 1
#ioctl: arg1 == BINDER_WRITE_READ || arg1 == BINDER_SET_MAX_THREADS || arg1 == BINDER_VERSION
ioctl: 1
mremap: 1
readlinkat: 1
pread64: 1
fstatfs: 1
rt_sigprocmask: 1
faccessat: 1
sendto: 1
rt_sigaction: 1
socket: arg0 == AF_UNIX || arg0 == AF_QIPCRTR
recvfrom: 1
getsockname: 1
getdents64: 1
fcntl: 1
nanosleep: 1
getrandom: 1
clone: 1
pipe2: 1
exit_group: 1
write: 1
exit: 1
getpid: 1
sigaltstack: 1
getrlimit: 1
restart_syscall: 1
setsockopt: 1
sched_getscheduler: 1
rt_sigreturn: 1
execve: 1
madvise: 1
set_tid_address: 1
connect: 1
ppoll: 1
clock_gettime: 1


code:
#Copyright (c) 2020 Qualcomm Technologies, Inc.
#All Rights Reserved.
#Confidential and Proprietary - Qualcomm Technologies, Inc

#Not a contribution.

#Copyright (C) 2018 The Android Open Source Project

#"Licensed under the Apache License, Version 2.0 (the \"License\");"
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at

#http://www.apache.org/licenses/LICENSE-2.0

#Unless required by applicable law or agreed to in writing, software
#"distributed under the License is distributed on an \"AS IS\" BASIS,"
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.

mmap: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
munmap: 1
mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
#prctl: arg0 == PR_SET_VMA || arg0 == PR_SET_NO_NEW_PRIVS || arg0 == PR_GET_DUMPABLE || arg0 == PR_SET_SECCOMP || arg0 == 0x37 /* PR_??? */
prctl: 1
read: 1
openat: 1
close: 1
shutdown: 1
kill: 1
futex: 1
fstat: 1
gettimeofday: 1
readlinkat: 1
newfstatat: 1
mremap: 1
pread64: 1
fstatfs: 1
rt_sigaction: 1
faccessat: 1
socket: arg0 == AF_UNIX || arg0 == AF_QIPCRTR
writev: 1
connect: 1
rt_sigprocmask: 1
fcntl: 1
sendto: 1
getrandom: 1
lseek: 1
exit_group: 1
rt_tgsigqueueinfo: 1
write: 1
exit: 1
getpid: 1
sigaltstack: 1
recvmsg: 1
dup: 1
getrlimit: 1
restart_syscall: 1
clone: 1
gettid: 1
sched_getscheduler: 1
ioctl: 1
execve: 1
getuid: 1
madvise: 1
set_tid_address: 1
nanosleep: 1
rt_sigreturn: 1
rt_sigsuspend: 1
setpriority: 1
geteuid: 1
getgid: 1
getegid: 1
getgroups: 1
pipe2: 1
setitimer: 1
pselect6: 1
getsockname: 1
recvfrom: 1
ppoll: 1
socketpair: 1
setsockopt: 1
getsockopt: 1
sendmsg: 1
bind: 1
timer_create: 1
timer_settime: 1
timer_delete: 1
clock_gettime: 1
sched_getaffinity: 1
#crash dump policy addition
socket: 1
process_vm_readv: 1
tgkill: 1


code:
# device specific syscalls
# extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy
pselect6: 1
eventfd2: 1
sendto: 1
recvfrom: 1
_llseek: 1
sysinfo: 1
getcwd: 1
getdents64: 1
inotify_init1: 1
inotify_add_watch: 1


code:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := Doze
LOCAL_CERTIFICATE := platform
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_PRIVILEGED_MODULE := true

LOCAL_USE_AAPT2 := true

LOCAL_STATIC_ANDROID_LIBRARIES := \
    androidx.core_core \
    androidx.preference_preference

LOCAL_RESOURCE_DIR := \
    $(LOCAL_PATH)/res \
    $(TOP)/packages/resources/devicesettings/res

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include frameworks/base/packages/SettingsLib/common.mk

include $(BUILD_PACKAGE)


code:
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015-2016 The CyanogenMod Project
                   2017 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.lineageos.settings.doze"
    android:sharedUserId="android.uid.system"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <protected-broadcast android:name="com.android.systemui.doze.pulse" />

    <application
        android:label="@string/device_settings_app_name"
        android:persistent="true">

        <receiver android:name=".BootCompletedReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>

        <service
            android:name=".DozeService"
            android:permission="DozeService"
            android:exported="true">
        </service>

        <activity
            android:name=".DozeSettingsActivity"
            android:exported="false"
            android:label="@string/ambient_display_title"
            android:theme="@style/Theme.SubSettingsBase">
            <intent-filter>
                <action android:name="org.lineageos.settings.device.DOZE_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>
</manifest>


code:
-keep class org.lineageos.settings.doze.* {
  *;
}


code:
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="24dp"
    android:width="24dp"
    android:tint="?android:attr/colorControlNormal"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path android:fillColor="#000" android:pathData="M7,1A2,2 0 0,0 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1H7M7,4H17V20H7V4M9,6V10H10.5V7.5H13V6H9M13.5,14V16.5H11V18H15V14H13.5Z" />
</vector>


code:
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License"
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="@string/ambient_display_title">

    <com.android.settingslib.widget.TopIntroPreference
        android:key="doze_top_intro"
        android:title="@string/ambient_display_enable_summary"/>

    <com.android.settingslib.widget.MainSwitchPreference
        android:defaultValue="false"
        android:key="doze_enable"
        android:title="@string/ambient_display_enable_title" />

    <SwitchPreference
        android:icon="@drawable/ic_doze_wake"
        android:key="wake_on_gesture"
        android:defaultValue="false"
        android:title="@string/wake_on_gesture_title"
        android:summary="@string/wake_on_gesture_summary" />

    <PreferenceCategory
        android:key="tilt_sensor"
        android:title="@string/tilt_sensor_title">

        <SwitchPreference
            android:icon="@drawable/ic_doze_pickup"
            android:defaultValue="false"
            android:key="gesture_pick_up"
            android:summary="@string/pick_up_gesture_summary"
            android:title="@string/pick_up_gesture_title" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="proximity_sensor"
        android:title="@string/proximity_sensor_title">

        <SwitchPreference
            android:icon="@drawable/ic_doze_hand"
            android:defaultValue="false"
            android:key="gesture_hand_wave"
            android:summary="@string/hand_wave_gesture_summary"
            android:title="@string/hand_wave_gesture_title" />

        <SwitchPreference
            android:icon="@drawable/ic_doze_pocket"
            android:defaultValue="false"
            android:key="gesture_pocket"
            android:summary="@string/pocket_gesture_summary"
            android:title="@string/pocket_gesture_title" />

    </PreferenceCategory>

</PreferenceScreen>


code:
/*
 * Copyright (C) 2015 The CyanogenMod Project
 *               2017 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.lineageos.settings.doze;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootCompletedReceiver extends BroadcastReceiver {

    private static final boolean DEBUG = false;
    private static final String TAG = "Doze";

    @Override
    public void onReceive(final Context context, Intent intent) {
        if (Utils.isDozeEnabled(context) && Utils.sensorsEnabled(context)) {
            if (DEBUG) Log.d(TAG, "Starting service");
            Utils.startService(context);
        }
    }

}