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

    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
    <uses-permission android:name="android.gms.permission.ACTIVITY_RECOGNITION"/>
    <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:name=".AWApplication"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="LockedOrientationActivity">
        <activity android:name=".ui.activities.MainActivity" android:launchMode="singleInstance" android:theme="@style/AppTheme.Main" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".ui.activities.ChooseApplicationActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />
        <activity android:name=".ui.activities.CustomLocationActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />
        <activity android:name=".ui.activities.WeatherProviderActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />
        <activity android:name=".ui.activities.SupportDevActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />
        <activity android:name=".ui.activities.CustomDateActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />
        <activity android:name=".ui.activities.IntegrationsActivity" android:launchMode="singleInstance" android:screenOrientation="portrait" />


        <receiver android:name=".ui.widgets.MainWidget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/the_widget_info" />
        </receiver>
        <receiver
            android:name=".receivers.NewCalendarEventReceiver"
            android:enabled="true"
            android:exported="true"
            android:priority="1000">
            <intent-filter>
                <action android:name="android.intent.action.PROVIDER_CHANGED" />
                <data android:scheme="content"/>
                <data android:host="com.android.calendar"/>
            </intent-filter>
            <intent-filter>
                <action android:name="com.tommasoberlose.anotherwidget.action.GO_TO_NEXT_EVENT" />
                <action android:name="com.tommasoberlose.anotherwidget.action.GO_TO_PREVIOUS_EVENT" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receivers.UpdatesReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="com.tommasoberlose.anotherwidget.action.ACTION_CALENDAR_UPDATE" />
                <action android:name="com.tommasoberlose.anotherwidget.action.ACTION_TIME_UPDATE" />
                <action android:name="com.sec.android.widgetapp.APPWIDGET_RESIZE" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />
                <action android:name="android.intent.action.DATE_CHANGED" />
                <action android:name="android.intent.action.TIME_SET" />
                <action android:name="android.intent.action.TIMEZONE_CHANGED" />
                <action android:name="android.intent.action.LOCALE_CHANGED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receivers.WeatherReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.tommasoberlose.anotherwidget.action.ACTION_WEATHER_UPDATE" />
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.TIME_SET" />
                <action android:name="android.intent.action.TIMEZONE_CHANGED" />
                <action android:name="android.intent.action.LOCALE_CHANGED" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".receivers.WidgetClickListenerReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="com.tommasoberlose.anotherwidget.action.ACTION_OPEN_WEATHER_INTENT" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".receivers.CrashlyticsReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="com.tommasoberlose.anotherwidget.action.ACTION_REPORT_CRASH" />
            </intent-filter>
        </receiver>

        <service android:name=".services.EventListenerJob" android:permission="android.permission.BIND_JOB_SERVICE" />

        <service android:name=".services.BatteryListenerJob" android:permission="android.permission.BIND_JOB_SERVICE" />

        <service android:name=".receivers.MusicNotificationListener"
            android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>

        <receiver android:name=".receivers.BatteryLevelReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
                <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
                <action android:name="android.intent.action.BATTERY_LOW"/>
                <action android:name="android.intent.action.BATTERY_OKAY"/>
                <action android:name="android.intent.action.BATTERY_CHANGED"/>
            </intent-filter>
        </receiver>

        <receiver android:name=".receivers.ActivityDetectionReceiver"
            android:exported="false"
            android:permission="com.google.android.gms.permission.ACTIVITY_RECOGNITION">
            <intent-filter>
                <action android:name="com.mypackage.ACTION_PROCESS_ACTIVITY_TRANSITIONS" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

        <service
            android:name=".services.UpdateCalendarJob"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:exported="true"/>
    </application>

</manifest>