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

	<uses-permission android:name="android.permission.INTERNET"/>
	<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
	<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
	<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
	<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

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

	<queries>
		<intent>
			<action android:name="android.intent.action.PROCESS_TEXT" />
			<data android:mimeType="text/plain" />
		</intent>
	</queries>

	<application
		android:name=".MastodonApp"
		android:allowBackup="true"
		android:label="@string/app_name"
		android:supportsRtl="true"
		android:localeConfig="@xml/locales_config"
		android:icon="@mipmap/ic_launcher"
		android:roundIcon="@mipmap/ic_launcher_round"
		android:theme="@style/Theme.Mastodon.AutoLightDark"
		android:largeHeap="true">

		<activity android:name=".MainActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask">
			<intent-filter>
				<action android:name="android.intent.action.MAIN"/>
				<category android:name="android.intent.category.LAUNCHER"/>
			</intent-filter>
		</activity>
		<activity android:name=".OAuthActivity" android:exported="true" android:configChanges="orientation|screenSize" android:launchMode="singleTask">
			<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:scheme="mastodon-android-auth" android:host="callback"/>
			</intent-filter>
		</activity>
		<activity android:name=".ExternalShareActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize">
			<intent-filter>
				<action android:name="android.intent.action.SEND"/>
				<category android:name="android.intent.category.DEFAULT"/>
				<data android:mimeType="*/*"/>
			</intent-filter>
			<intent-filter>
				<action android:name="android.intent.action.SEND_MULTIPLE"/>
				<category android:name="android.intent.category.DEFAULT"/>
				<data android:mimeType="*/*"/>
			</intent-filter>
		</activity>

		<service android:name=".AudioPlayerService" android:foregroundServiceType="mediaPlayback"/>

		<receiver android:name=".PushNotificationReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
			<intent-filter>
				<action android:name="com.google.android.c2dm.intent.RECEIVE" />
			</intent-filter>
		</receiver>
		<receiver android:name=".api.PushSubscriptionManager$RegistrationReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
			<intent-filter>
				<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
				<category android:name="me.grishka.fcmtest"/>
			</intent-filter>
		</receiver>

	</application>

</manifest>