<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="org.moire.ultrasonic"
          android:installLocation="auto">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true"/>

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/Theme.AppCompat"
        android:name=".app.UApp"
        android:label="@string/common.appname"
        android:usesCleartextTraffic="true">
        <activity
            android:name=".activity.MainActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="UltraSonic"
            android:launchMode="standard">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.SelectArtistActivity"
            android:configChanges="orientation|keyboardHidden"
            android:launchMode="standard"/>
        <activity
            android:name=".activity.SelectAlbumActivity"
            android:configChanges="orientation|keyboardHidden"/>
        <activity
            android:name=".activity.SearchActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/search.label"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.SelectPlaylistActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/playlist.label"
            android:launchMode="standard"/>
        <activity
            android:name=".activity.PodcastsActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/podcasts.label"
            android:launchMode="standard"/>
        <activity
            android:name=".activity.BookmarkActivity"
            android:configChanges="orientation|keyboardHidden"/>
        <activity
            android:name=".activity.ShareActivity"
            android:configChanges="orientation|keyboardHidden"/>
        <activity
            android:name=".activity.ChatActivity"
            android:configChanges="orientation|keyboardHidden"/>
        <activity
            android:name=".activity.DownloadActivity"
            android:configChanges="keyboardHidden"
            android:launchMode="singleTask"
            android:exported="true" />
        <activity
            android:name=".activity.SettingsActivity"
            android:configChanges="orientation|keyboardHidden"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.HelpActivity"
            android:configChanges="orientation|keyboardHidden"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.LyricsActivity"
            android:configChanges="orientation|keyboardHidden"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.EqualizerActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/equalizer.label"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.SelectGenreActivity"
            android:configChanges="orientation|keyboardHidden"
            android:launchMode="standard"/>
        <activity
            android:name=".activity.VoiceQueryReceiverActivity"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.QueryReceiverActivity"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable"/>
        </activity>

        <activity android:name=".activity.ServerSettingsActivity" />

        <service
            android:name=".service.MediaPlayerService"
            android:label="UltraSonic Download Service"
            android:exported="false">
            <intent-filter>
                <action android:name="org.moire.ultrasonic.CMD_TOGGLEPAUSE"/>
                <action android:name="org.moire.ultrasonic.CMD_PLAY"/>
                <action android:name="org.moire.ultrasonic.CMD_PAUSE"/>
                <action android:name="org.moire.ultrasonic.CMD_NEXT"/>
                <action android:name="org.moire.ultrasonic.CMD_PREVIOUS"/>
                <action android:name="org.moire.ultrasonic.CMD_STOP"/>
            </intent-filter>
        </service>

        <receiver android:name=".receiver.MediaButtonIntentReceiver">
            <intent-filter android:priority="2147483647">
                <action android:name="android.intent.action.MEDIA_BUTTON"/>
            </intent-filter>
        </receiver>
        <receiver android:name=".receiver.BluetoothIntentReceiver">
            <intent-filter>
                <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
                <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
                <action android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED"/>
                <action android:name="android.bluetooth.a2dp.action.SINK_STATE_CHANGED"/>
            </intent-filter>
        </receiver>
        <receiver
            android:name=".provider.UltraSonicAppWidgetProvider4x1"
            android:label="UltraSonic (4x1)">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/appwidget_info_4x1"/>
        </receiver>
        <receiver
            android:name=".provider.UltraSonicAppWidgetProvider4x2"
            android:label="UltraSonic (4x2)">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/appwidget_info_4x2"/>
        </receiver>
        <receiver
            android:name=".provider.UltraSonicAppWidgetProvider4x3"
            android:label="UltraSonic (4x3)">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/appwidget_info_4x3"/>
        </receiver>
        <receiver
            android:name=".provider.UltraSonicAppWidgetProvider4x4"
            android:label="UltraSonic (4x4)">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>

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

        <provider
            android:name=".provider.SearchSuggestionProvider"
            android:authorities="org.moire.ultrasonic.provider.SearchSuggestionProvider"/>

        <meta-data
            android:name="android.app.default_searchable"
            android:value="org.moire.ultrasonic.activity.QueryReceiverActivity"/>

        <receiver
            android:name=".receiver.A2dpIntentReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.android.music.playstatusrequest"/>
            </intent-filter>
        </receiver>
    </application>

</manifest>
