<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 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.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.adservices.uiunittest" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <uses-permission android:name="android.permission.ACCESS_ADSERVICES_AD_ID" />
    <uses-permission android:name="android.permission.ACCESS_ADSERVICES_TOPICS" />
    <uses-permission android:name="android.permission.ACCESS_ADSERVICES_CUSTOM_AUDIENCE" />

    <!-- Needed to resolve Intent to ComponentName for measurement verifiedDestination -->
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

    <!-- Needed to schedule MDD jobs to persist across device reboots  -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

    <!-- Permissions required for reading device configs -->
    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG"/>

    <!-- android:debuggable="true is needed. See b/228384531 -->
    <application
        android:debuggable="true"
        android:networkSecurityConfig="@xml/network_security_config">
        <property android:name="android.adservices.AD_SERVICES_CONFIG"
            android:resource="@xml/ad_services_config" />

        <!-- App Manifest Config that does not declare <includes-sdk-library> -->
        <property android:name="android.adservices.AD_SERVICES_CONFIG.sdkTagMissing"
            android:resource="@xml/ad_services_config_missing_sdk_tag" />

        <!-- App Manifest Config that does not include the sdk using Topics -->
        <property android:name="android.adservices.AD_SERVICES_CONFIG.sdkMissing"
            android:resource="@xml/ad_services_config_missing_sdk" />

        <!-- FLEDGE Background Fetch Job -->
        <service android:name=
            "com.android.adservices.service.customaudience.BackgroundFetchJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- FLEDGE Background Key Fetch Job -->
        <service android:name=
            "com.android.adservices.service.adselection.encryption.BackgroundKeyFetchJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- FLEDGE Ad selection debug report sender Job -->
        <service android:name=
            "com.android.adservices.service.adselection.DebugReportSenderJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- FLEDGE Protected Signals periodic encoding job -->
        <service android:name=
            "com.android.adservices.service.signals.PeriodicEncodingJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>

        <!-- FLEDGE Schedule Custom Audience Update Job -->
        <service android:name=
            "com.android.adservices.service.customaudience.ScheduleCustomAudienceUpdateJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>

        <!-- Topics Epoch/Maintenance Service Job. Must be defined here in order to schedule them in
        job scheduler. -->
        <service android:name=
            "com.android.adservices.service.topics.EpochJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <service android:name=
            "com.android.adservices.service.MaintenanceJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- Measurement debug report upload job. -->
        <service android:name="com.android.adservices.service.measurement.reporting.DebugReportingJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- Measurement verbose debug report upload job. -->
        <service android:name="com.android.adservices.service.measurement.reporting.VerboseDebugReportingJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- MDD Service Job. Must be defined here in order to schedule them in Tests. -->
        <service android:name=
            "com.android.adservices.download.MddJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <!-- Cobalt Logging Job -->
        <service
            android:name="com.android.adservices.cobalt.CobaltJobService"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>
        <uses-library android:name="android.ext.adservices" android:required="false" />
    </application>
    <instrumentation
        android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.android.adservices.uiunittest" >
    </instrumentation>
</manifest>
