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

	<uses-feature
		android:name="android.hardware.bluetooth"
		android:required="false"/>
	<uses-feature
		android:name="android.hardware.camera"
		android:required="false"/>
	<uses-feature
		android:name="android.hardware.touchscreen"
		android:required="false"/>
	<uses-feature android:name="android.software.leanback"
        android:required="false" />

	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
	<uses-permission android:name="android.permission.BLUETOOTH"/>
	<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
	<uses-permission android:name="android.permission.CAMERA"/>
	<uses-permission android:name="android.permission.INTERNET"/>
	<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
	<!--suppress DeprecatedClassUsageInspection -->
	<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
	<uses-permission android:name="android.permission.VIBRATE"/>
	<uses-permission android:name="android.permission.WAKE_LOCK"/>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

	<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"/>
	<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
	<uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
	<uses-permission-sdk-23 android:name="android.permission.FOREGROUND_SERVICE"/>

	<application
		android:name="org.briarproject.briar.android.BriarApplicationImpl"
		android:allowBackup="false"
		android:icon="@mipmap/ic_launcher_round"
		android:label="@string/app_name"
		android:logo="@mipmap/ic_launcher_round"
		android:banner="@mipmap/tv_banner"
		android:supportsRtl="true"
		android:theme="@style/BriarTheme"
		tools:ignore="GoogleAppIndexingWarning"
		tools:targetApi="16">

		<receiver
			android:name="org.briarproject.briar.android.login.SignInReminderReceiver"
			android:exported="false">
			<intent-filter>
				<action android:name="android.intent.action.BOOT_COMPLETED"/>
				<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
			</intent-filter>
		</receiver>

		<service
			android:name="org.briarproject.briar.android.BriarService"
			android:exported="false">
			<intent-filter>
				<action android:name="org.briarproject.briar.android.BriarService"/>
			</intent-filter>
		</service>

		<service
			android:name="org.briarproject.briar.android.NotificationCleanupService"
			android:exported="false">
		</service>

		<activity
			android:name="org.briarproject.briar.android.reporting.DevReportActivity"
			android:excludeFromRecents="true"
			android:exported="false"
			android:finishOnTaskLaunch="true"
			android:label="@string/crash_report_title"
			android:launchMode="singleInstance"
			android:theme="@style/BriarTheme.NoActionBar"
			android:windowSoftInputMode="adjustResize|stateHidden">
		</activity>

		<activity
			android:name="org.briarproject.briar.android.splash.ExpiredActivity"
			android:label="@string/app_name">
		</activity>

		<activity
			android:name="org.briarproject.briar.android.login.StartupActivity"
			android:label="@string/app_name">
		</activity>

		<activity
			android:name="org.briarproject.briar.android.account.SetupActivity"
			android:label="@string/setup_title"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
		</activity>

		<activity
			android:name="org.briarproject.briar.android.splash.SplashScreenActivity"
			android:label="@string/app_name"
			android:theme="@style/BriarTheme.NoActionBar">
			<intent-filter>
				<action android:name="android.intent.action.MAIN"/>
				<category android:name="android.intent.category.LAUNCHER"/>
				<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
			</intent-filter>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:launchMode="singleTask"
			android:theme="@style/BriarTheme.NoActionBar">
			<intent-filter android:label="@string/add_contact_remotely_title_case">
				<action android:name="android.intent.action.VIEW"/>

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

				<data android:scheme="briar"/>
			</intent-filter>
			<intent-filter android:label="@string/add_contact_remotely_title_case">
				<action android:name="android.intent.action.SEND"/>
				<category android:name="android.intent.category.DEFAULT"/>
				<data android:mimeType="text/plain"/>
			</intent-filter>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.conversation.ConversationActivity"
			android:label="@string/app_name"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:theme="@style/BriarTheme.NoActionBar"
			android:windowSoftInputMode="adjustResize|stateUnchanged">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name=".android.conversation.ImageActivity"
			android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity"
			android:theme="@style/BriarTheme.ActionBarOverlay">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.conversation.ConversationActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.creation.CreateGroupActivity"
			android:label="@string/groups_create_group_title"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.conversation.GroupActivity"
			android:label="@string/app_name"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:theme="@style/BriarTheme.NoActionBar"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.invitation.GroupInvitationActivity"
			android:label="@string/groups_invitations_title"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.memberlist.GroupMemberListActivity"
			android:label="@string/groups_member_list"
			android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.privategroup.conversation.GroupActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.reveal.RevealContactsActivity"
			android:label="@string/groups_reveal_contacts"
			android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.privategroup.conversation.GroupActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.privategroup.creation.GroupInviteActivity"
			android:label="@string/groups_invite_members"
			android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.privategroup.conversation.GroupActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.ForumInvitationActivity"
			android:label="@string/forum_invitations_title"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.BlogInvitationActivity"
			android:label="@string/blogs_sharing_invitations_title"
			android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.conversation.ConversationActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.forum.CreateForumActivity"
			android:label="@string/create_forum_title"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.forum.ForumActivity"
			android:label="@string/app_name"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:theme="@style/BriarTheme.NoActionBar"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.ShareForumActivity"
			android:label="@string/activity_share_toolbar_header"
			android:parentActivityName="org.briarproject.briar.android.forum.ForumActivity"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.forum.ForumActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.ShareBlogActivity"
			android:label="@string/activity_share_toolbar_header"
			android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.blog.BlogActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.ForumSharingStatusActivity"
			android:label="@string/sharing_status"
			android:parentActivityName="org.briarproject.briar.android.forum.ForumActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.forum.ForumActivity"
				/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.sharing.BlogSharingStatusActivity"
			android:label="@string/sharing_status"
			android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.blog.BlogActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.blog.BlogActivity"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:theme="@style/BriarTheme.NoActionBar">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.blog.WriteBlogPostActivity"
			android:label="@string/blogs_write_blog_post"
			android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.blog.BlogActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.blog.ReblogActivity"
			android:label="@string/blogs_reblog_button"
			android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.blog.BlogActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.blog.RssFeedImportActivity"
			android:label="@string/blogs_rss_feeds_import"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.blog.RssFeedManageActivity"
			android:label="@string/blogs_rss_feeds_manage"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.keyagreement.ContactExchangeActivity"
			android:label="@string/add_contact_title"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:theme="@style/BriarTheme.NoActionBar">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.introduction.IntroductionActivity"
			android:label="@string/introduction_activity_title"
			android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity"
			android:windowSoftInputMode="adjustResize|stateHidden">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.conversation.ConversationActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.StartupFailureActivity"
			android:label="@string/startup_failed_activity_title">
		</activity>

		<activity
			android:name="org.briarproject.briar.android.settings.SettingsActivity"
			android:label="@string/settings_button"
			android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
			android:permission="android.permission.READ_NETWORK_USAGE_HISTORY">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
			<intent-filter>
				<action android:name="android.intent.action.MANAGE_NETWORK_USAGE"/>
				<category android:name="android.intent.category.DEFAULT"/>
			</intent-filter>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.login.ChangePasswordActivity"
			android:label="@string/change_password"
			android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity"
			android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.settings.SettingsActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.test.TestDataActivity"
			android:label="Create test data"
			android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.settings.SettingsActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.panic.PanicPreferencesActivity"
			android:label="@string/panic_setting"
			android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity">
			<meta-data
				android:name="android.support.PARENT_ACTIVITY"
				android:value="org.briarproject.briar.android.settings.SettingsActivity"/>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.panic.PanicResponderActivity"
			android:noHistory="true"
			android:theme="@style/TranslucentTheme">
			<!-- this can never have launchMode singleTask or singleInstance! -->
			<intent-filter>
				<action android:name="info.guardianproject.panic.action.TRIGGER"/>
				<category android:name="android.intent.category.DEFAULT"/>
			</intent-filter>
		</activity>

		<activity
			android:name="org.briarproject.briar.android.logout.ExitActivity"
			android:theme="@android:style/Theme.NoDisplay">
		</activity>

		<activity
			android:name=".android.logout.HideUiActivity"
			android:theme="@android:style/Theme.NoDisplay">
		</activity>

		<activity
			android:name=".android.account.UnlockActivity"
			android:label="@string/lock_unlock"
			android:launchMode="singleTask"
			android:theme="@style/BriarTheme.NoActionBar"/>

		<activity
			android:name=".android.contact.add.remote.AddContactActivity"
			android:label="@string/add_contact_remotely_title_case"
			android:theme="@style/BriarTheme"
			android:windowSoftInputMode="adjustResize|stateHidden"/>

		<activity
			android:name=".android.contact.add.remote.PendingContactListActivity"
			android:label="@string/pending_contact_requests"
			android:theme="@style/BriarTheme"/>

	</application>
</manifest>
