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

    <uses-permission
        android:name="android.permission.BLUETOOTH"
        android:maxSdkVersion="30" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28"
        tools:ignore="ScopedStorage" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.front"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.telephony"
        android:required="false" />

    <application
        android:icon="@mipmap/ic_launcher"
        android:installLocation="internalOnly"
        android:label="@string/app_name_plus"
        android:largeHeap="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:requestLegacyExternalStorage="true"
        tools:remove="android:appComponentFactory">
        <activity
            android:name="kr.co.rito.ritosip.StartActivity"
            android:exported="true">
<!--            <intent-filter>-->
<!--                <action android:name="android.intent.action.MAIN" />-->

<!--                <category android:name="android.intent.category.LAUNCHER" />-->
<!--            </intent-filter>-->
        </activity>
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:exported="true"
            android:launchMode="singleTask"
            android:theme="@style/AppTheme.Main"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DIAL" />
                <action android:name="android.intent.action.CALL" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.DIAL" />
                <action android:name="android.intent.action.CALL" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="tel" />
                <data android:scheme="sip" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AccountsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/accounts"
            android:parentActivityName=".MainActivity"
            android:windowSoftInputMode="adjustPan"></activity>
        <activity
            android:name=".AccountActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/account"
            android:windowSoftInputMode="adjustPan"></activity>
        <activity
            android:name=".CodecsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/codecs"
            android:parentActivityName=".AccountActivity"></activity>
        <activity
            android:name=".ContactsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/contacts"
            android:parentActivityName=".MainActivity"
            android:windowSoftInputMode="adjustPan"></activity>
        <activity
            android:name=".ContactActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/contact"
            android:parentActivityName=".ContactsActivity"></activity>
        <activity
            android:name=".AndroidContactActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/contact"
            android:parentActivityName=".ContactsActivity"></activity>
        <activity
            android:name=".ConfigActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/configuration"
            android:parentActivityName=".MainActivity"></activity>
        <activity
            android:name=".AudioActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/audio_settings"
            android:parentActivityName=".ConfigActivity"></activity>
        <activity
            android:name=".CallsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/call_history"
            android:parentActivityName=".MainActivity"></activity>
        <activity
            android:name=".CallDetailsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/call_details"
            android:parentActivityName=".CallsActivity"></activity>
        <activity
            android:name=".ChatsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/chats"
            android:parentActivityName=".MainActivity"
            android:windowSoftInputMode="adjustPan"></activity>
        <activity
            android:name=".ChatActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/chat"></activity>
        <activity
            android:name=".AboutActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/about_title_plus"
            android:parentActivityName=".MainActivity"></activity>

        <service
            android:name=".BaresipService"
            android:enabled="true"
            android:foregroundServiceType="microphone|camera|phoneCall"
            android:permission="android.permission.FOREGROUND_SERVICE"
            android:stopWithTask="false"></service>
        <service
            android:name=".InCallService"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.BIND_INCALL_SERVICE">
            <meta-data
                android:name="android.telecom.IN_CALL_SERVICE_UI"
                android:value="true" />
            <meta-data
                android:name="android.telecom.IN_CALL_SERVICE_CAR_MODE_UI"
                android:value="false" />

            <intent-filter>
                <action android:name="android.telecom.InCallService" />
            </intent-filter>
        </service>

        <receiver
            android:name=".BootCompletedReceiver"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".TaskReceiver"
            android:enabled="true"
            android:exported="true"
            tools:ignore="ExportedReceiver">
            <intent-filter>
                <action android:name="com.tutpro.baresip.plus.REGISTER" />
                <action android:name="com.tutpro.baresip.plus.UNREGISTER" />
                <action android:name="com.tutpro.baresip.plus.QUIT" />
            </intent-filter>
        </receiver>
    </application>

</manifest>