<!--
Polassis: personal voice assistant for Android devices
Copyright (C) 2018 Maksymilian Graczyk

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

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

    <uses-sdk xmlns:tools="http://schemas.android.com/tools"
        tools:overrideLibrary="android.support.v14.preference" />

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.network"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.telephony"
        android:required="false" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/logo"
        android:label="Polassis"
        android:restoreAnyVersion="true"
        android:theme="@style/AppTheme">
        <service
            android:name=".service.BackgroundListenerService"
            android:exported="false" />
        <service
            android:name=".service.BluetoothAndSMSListenerService"
            android:exported="false" />
        <service
            android:name=".service.TimerService"
            android:exported="false" />
        <service
            android:name=".service.AssistantHeadService"
            android:exported="false" />
        <service
            android:name=".service.BackgroundSpeechRecognitionService"
            android:exported="true" />
        <service
            android:name=".service.TextToSpeechService"
            android:exported="false" />
        <service
            android:name=".service.SpeechRecognitionService"
            android:exported="false" />

        <receiver android:name=".receiver.SMSBroadcastReceiver" />
        <receiver
            android:name=".receiver.BluetoothBroadcastReceiver"
            android:enabled="true" />
        <receiver
            android:name=".receiver.OnBootCompletedBroadcastReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.PhoneStateBroadcastReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.PHONE_STATE" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".misc.Assistant"
            android:clearTaskOnLaunch="true"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

                <action android:name="android.intent.action.VOICE_COMMAND" />

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

                <action android:name="android.intent.action.ASSIST" />

                <category android:name="android.intent.categor.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".gui.SettingsActivity"
            android:label="title_settings_activity"
            android:parentActivityName=".misc.Assistant"
            android:screenOrientation="portrait"
            android:theme="@style/GreenActionBarTheme">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.mg.polassis.misc.Assistant" />
        </activity>
        <activity
            android:name=".gui.PossibilitiesActivity"
            android:label="title_possibilities_activity"
            android:parentActivityName=".misc.Assistant"
            android:screenOrientation="portrait"
            android:theme="@style/GreenActionBarTheme">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.mg.polassis.misc.Assistant" />
        </activity>
        <activity
            android:name=".gui.AboutActivity"
            android:label="title_about_activity"
            android:parentActivityName=".misc.Assistant"
            android:screenOrientation="portrait"
            android:theme="@style/GreenActionBarTheme">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.mg.polassis.misc.Assistant" />
        </activity>
        <activity
            android:name=".gui.AlarmActivity"
            android:label="title_alarm_activity"
            android:noHistory="true"
            android:screenOrientation="portrait" />

        <receiver
            android:name=".gui.Widget"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget_info" />
        </receiver>
        <receiver
            android:name=".gui.SmallWidget"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

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

        <activity
            android:name=".gui.LanguageSelectionActivity"
            android:label="Choose language"
            android:theme="@style/GreenActionBarTheme" />
    </application>

</manifest>
