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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />

    <application
        android:name=".app.RocketChatApplication"
        android:allowBackup="true"
        android:fullBackupContent="@xml/backup_config"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:networkSecurityConfig="@xml/network_security_config"
        android:supportsRtl="true">

        <activity
            android:name=".authentication.ui.AuthenticationActivity"
            android:configChanges="orientation"
            android:screenOrientation="portrait"
            android:theme="@style/AuthenticationTheme"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data
                    android:host="auth"
                    android:scheme="rocketchat" />
                <data
                    android:host="go.rocket.chat"
                    android:path="/auth"
                    android:scheme="https" />
            </intent-filter>
        </activity>

        <activity
            android:name=".server.ui.ChangeServerActivity"
            android:theme="@style/AuthenticationTheme" />

        <activity
            android:name=".main.ui.MainActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <activity
            android:name=".webview.ui.WebViewActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <activity
            android:name=".webview.cas.ui.CasWebViewActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <activity
            android:name=".webview.oauth.ui.OauthWebViewActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <activity
            android:name=".chatroom.ui.ChatRoomActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <!-- TODO: Change to fragment-->
        <activity
            android:name=".chatroom.ui.PinnedMessagesActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />

        <!-- TODO: Change to fragment-->
        <activity
            android:name=".settings.password.ui.PasswordActivity"
            android:theme="@style/AppTheme" />

        <!-- TODO: Change to fragment-->
        <activity
            android:name=".settings.about.ui.AboutActivity"
            android:theme="@style/AppTheme" />

        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="${applicationId}" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".push.DirectReplyReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="chat.rocket.android.ACTION_REPLY" />
            </intent-filter>
        </receiver>

        <service
            android:name=".push.FirebaseTokenService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name=".push.GcmListenerService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>
        <service
            android:name=".chatroom.service.MessageService"
            android:exported="true"
            android:permission="android.permission.BIND_JOB_SERVICE" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="12ac6e94f850aaffcdff52001af77ca415d06a43" />
    </application>

</manifest>
