<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.lemenzo.files.tests">

  <uses-sdk android:minSdkVersion="30" android:targetSdkVersion="30"/>

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

    <application android:label="LemenzoFiles Tests">
        <uses-library android:name="android.test.runner" />

        <activity android:name="com.lemenzo.files.SettingsActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.provider.action.DOCUMENT_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="content"
                      android:host="com.lemenzo.files.demoprovider"
                      android:mimeType="*/*" />
            </intent-filter>
        </activity>

        <!--Needed for demo'ing and functional testing the open in provider feature in inspector -->
        <activity android:name="com.lemenzo.files.TestProviderActivity"
          android:exported="true">
          <intent-filter>
            <action android:name="android.provider.action.DOCUMENT_SETTINGS" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="content"
                android:host="com.lemenzo.files.inspectorprovider"
                android:mimeType="*/*" />
          </intent-filter>
        </activity>

        <activity android:name="com.lemenzo.files.AuthenticationActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="com.lemenzo.files.test.action.AUTHENTICATE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>


        <provider
            android:name="com.lemenzo.files.StubProvider"
            android:authorities="com.lemenzo.files.stubprovider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
       </provider>

       <!-- Provider that demostrates some features, like display of INFO and ERROR messages. -->
       <provider
            android:name="com.lemenzo.files.DemoProvider"
            android:label="Demo Provider"
            android:authorities="com.lemenzo.files.demoprovider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
           <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
       </provider>

       <!-- Provider for testing archives. -->
       <provider
            android:name="com.lemenzo.files.archives.ResourcesProvider"
            android:authorities="com.lemenzo.files.archives.resourcesprovider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
      </provider>

      <!-- Provider for testing inspector -->
      <provider
          android:name="com.lemenzo.files.InspectorProvider"
          android:authorities="com.lemenzo.files.inspectorprovider"
          android:exported="true"
          android:grantUriPermissions="true"
          android:permission="android.permission.MANAGE_DOCUMENTS"
          android:enabled="true">
        <intent-filter>
          <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
        </intent-filter>
      </provider>

       <!-- Provider with support for paging. -->
       <provider
            android:name="com.lemenzo.files.PagingProvider"
            android:authorities="com.lemenzo.files.pagingprovider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
       </provider>

        <!-- Provider that has broken behavior -->
        <provider
            android:name="com.lemenzo.files.BrokenProvider"
            android:authorities="com.lemenzo.files.broken"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>

        <provider
            android:name="com.lemenzo.files.BrokenSettingsEnabledProvider"
            android:authorities="com.lemenzo.files.brokensettingsenabled"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>

        <!-- To avoid resource ID conflicts, we've removed androidx.startup class from the test jar
             using jarjar. We need to remove this provider as well otherwise the test will crash
             because it can't find the androidx.startup class. -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            tools:node="remove" />

        <service android:name="com.lemenzo.files.services.TestNotificationService"
                 android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
                 android:exported="true"
                 android:process="com.lemenzo.files">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>

    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.lemenzo.files"
        android:label="Tests for LemenzoFiles" />

</manifest>
