<?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.streetwriters.notesnook">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove"/>
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />


    <queries>
            <intent>
                <action android:name="android.intent.action.VIEW" />
                <!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->
                <data android:mimeType="application/pdf" />
            </intent>
            <intent>
                <action android:name="android.intent.action.VIEW" />
                <!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->
                <data android:mimeType="text/*" />
            </intent>
            <intent>
                <action android:name="android.intent.action.VIEW" />
                <!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->
                <data android:mimeType="image/*" />
            </intent>
            <intent>
                <action android:name="android.intent.action.VIEW" />
                <!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->

                <data android:mimeType="video/*" />
            </intent>
            <intent>
                <action android:name="android.intent.action.VIEW" />
                <!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->
                <data android:mimeType="audio/*" />
            </intent>
        </queries>

    <application
        android:name=".MainApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:theme="@style/BootTheme"
        android:largeHeap="true"
        android:supportsRtl="false"
        android:networkSecurityConfig="@xml/network_security_config"
        tools:replace="android:supportsRtl">
    
        <receiver android:exported="false" android:name=".NoteWidget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/note_widget_info" />
        </receiver>

        <activity
            android:name=".MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:resizeableActivity="true"
            android:exported="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter android:label="Notesnook">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="app.notesnook.com"
                    android:scheme="https" />
            </intent-filter>

            <intent-filter android:label="Notesnook">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="com.streetwriters.notesnook" />
            </intent-filter>

        </activity>
        <activity android:exported="false" android:name="com.facebook.react.devsupport.DevSettingsActivity" />
        <activity
            android:name=".ShareActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
            android:label="@string/title_activity_share"
            android:noHistory="true"
            android:screenOrientation="unspecified"
            android:exported="true"
            android:taskAffinity=""
            android:excludeFromRecents="true"
            android:windowSoftInputMode="adjustResize"
            android:theme="@style/AppThemeB">

            <intent-filter android:label="Make Note">
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/*" />
                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
                <data android:mimeType="image/*" />
                <data android:mimeType="application/*" />
            </intent-filter>

            <intent-filter android:label="Make Note">
                <action android:name="android.intent.action.PROCESS_TEXT" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/*" />
            </intent-filter>
        </activity>

        <service
            android:name=".OnClearFromRecentService"
            android:enabled="true"
            android:exported="true"
            android:stopWithTask="false" />
        <service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" />   

        <service android:name="com.streetwriters.notesnook.BootTaskService" android:foregroundServiceType="dataSync" />

        <service
            android:name=".NotesnookTileService"
            android:icon="@drawable/add_note"
            android:label="New note"
            android:exported="true"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE"/>
            </intent-filter>
        </service>

        <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="${applicationId}.provider"
        android:grantUriPermissions="true"
        android:exported="false">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_viewer_provider_paths" />
    </provider> 

        <provider
            android:name="com.vinzscam.reactnativefileviewer.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_viewer_provider_paths" />
        </provider>

       <receiver android:exported="true" android:name=".BootRecieverService">
           <intent-filter>
               <action android:name="android.intent.action.BOOT_COMPLETED" />
               <action android:name="android.intent.action.QUICKBOOT_POWERON" />
           </intent-filter>
      </receiver>


        

    </application>

</manifest>