<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.tgbotbuilder.app"
    android:versionCode="21"
    android:versionName="3.7.0" >

    <uses-sdk
        android:minSdkVersion="26"
        android:targetSdkVersion="37" />

    <!-- For the Calendar events features -->
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <!-- For reminders -->
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <!-- to start the alarms after restart. (By default, all alarms are canceled when a device shuts down) -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_LOCAL_NETWORK" />
    <uses-permission android:name="com.google.android.apps.aicore.service.BIND_SERVICE" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" /> <!-- suppress DeprecatedClassUsageInspection -->
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <queries>
        <package android:name="com.google.android.aicore" />
    </queries>

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <permission
        android:name="com.tgbotbuilder.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.tgbotbuilder.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" />

    <application
        android:name="com.mhss.app.mybrain.MyBrainApplication"
        android:allowBackup="false"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:debuggable="true"
        android:extractNativeLibs="false"
        android:fullBackupContent="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:localeConfig="@xml/locales_config"
        android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyBrain" >
        <property
            android:name="android.app.appfunctions.app_metadata"
            android:resource="@xml/app_metadata" />

        <service
            android:name="com.mhss.app.mybrain.appfunctions.MyBrainAppFunctionService"
            android:exported="true"
            android:permission="android.permission.BIND_APP_FUNCTION_SERVICE" >
            <property
                android:name="android.app.appfunctions.schema"
                android:value="app_functions_schema.xsd" />
            <property
                android:name="android.app.appfunctions.v2"
                android:value="my_brain_app_function_service.xml" />

            <intent-filter>
                <action android:name="android.app.appfunctions.AppFunctionService" />
            </intent-filter>
        </service>

        <activity
            android:name="com.mhss.app.mybrain.presentation.main.MainActivity"
            android:exported="true"
            android:theme="@style/Theme.MyBrain"
            android:windowSoftInputMode="adjustResize" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <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:scheme="app" />
                <data android:host="com.mhss.app.mybrain.task_details" />
                <data android:host="com.mhss.app.mybrain.tasks" />
                <data android:host="com.mhss.app.mybrain.calendar" />
                <data android:host="com.mhss.app.mybrain.calendar_event_details" />
                <data android:host="com.mhss.app.mybrain.notes" />
                <data android:host="com.mhss.app.mybrain.note_details" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="mybrain" />
                <data android:host="sync" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.mhss.app.presentation.QuickAddTaskActivity"
            android:autoRemoveFromRecents="true"
            android:excludeFromRecents="true"
            android:exported="false"
            android:launchMode="singleTop"
            android:taskAffinity="com.tgbotbuilder.app.quickadd"
            android:theme="@style/Theme.MyBrain.QuickAdd"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="com.mhss.app.mybrain.presentation.widget.TasksWidgetConfigurationActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:theme="@style/Theme.MyBrain" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.mhss.app.mybrain.presentation.widget.NotesWidgetConfigurationActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:theme="@style/Theme.MyBrain" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.mhss.app.mybrain.presentation.widget.CalendarWidgetConfigurationActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:theme="@style/Theme.MyBrain" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <receiver
            android:name="com.mhss.app.notification.BootBroadcastReceiver"
            android:enabled="true"
            android:exported="true" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.mhss.app.notification.AlarmReceiver"
            android:enabled="true" />
        <receiver
            android:name="com.mhss.app.notification.TaskActionButtonBroadcastReceiver"
            android:enabled="true" />

        <activity
            android:name="com.mhss.app.presentation.SaveBookmarkActivity"
            android:autoRemoveFromRecents="true"
            android:excludeFromRecents="true"
            android:exported="true"
            android:noHistory="true"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter android:label="@string/save_bookmark" >
                <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="com.mhss.app.presentation.AddTaskFromShareActivity"
            android:autoRemoveFromRecents="true"
            android:excludeFromRecents="true"
            android:exported="true"
            android:noHistory="true"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter android:label="@string/add_to_tasks" >
                <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="com.mhss.app.presentation.AddNoteFromShareActivity"
            android:autoRemoveFromRecents="true"
            android:excludeFromRecents="true"
            android:exported="true"
            android:noHistory="true"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter android:label="@string/add_note" >
                <action android:name="android.intent.action.SEND" />

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

                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>

        <!-- The Add task tile in the quick settings -->
        <service
            android:name="com.mhss.app.presentation.AddTaskTileService"
            android:exported="true"
            android:icon="@drawable/ic_check"
            android:label="@string/add_task_to_my_brain"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" >
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>

        <!-- Calendar widget -->
        <receiver
            android:name="com.mhss.app.widget.calendar.CalendarWidgetReceiver"
            android:enabled="@bool/glance_appwidget_available"
            android:exported="true"
            android:label="@string/calendar" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

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

        <!-- Tasks widget -->
        <receiver
            android:name="com.mhss.app.widget.tasks.TasksWidgetReceiver"
            android:enabled="@bool/glance_appwidget_available"
            android:exported="false"
            android:label="@string/tasks" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/tasks_widget_info" />
        </receiver>
        <receiver
            android:name="com.mhss.app.widget.tasks.CompleteTaskWidgetReceiver"
            android:enabled="@bool/glance_appwidget_available"
            android:exported="false" />

        <!-- Notes widget -->
        <receiver
            android:name="com.mhss.app.widget.notes.NotesWidgetReceiver"
            android:enabled="@bool/glance_appwidget_available"
            android:exported="false"
            android:label="@string/notes" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

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

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.tgbotbuilder.app.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true" >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

        <activity
            android:name="androidx.biometric.internal.ui.FingerprintDialogActivity"
            android:exported="false"
            android:label="@string/fingerprint_dialog_activity_label"
            android:theme="@style/Theme.AppCompat.Dialog.Alert" />

        <provider
            android:name="com.google.mlkit.common.internal.MlKitInitProvider"
            android:authorities="com.tgbotbuilder.app.mlkitinitprovider"
            android:exported="false"
            android:initOrder="99" />

        <service
            android:name="com.google.mlkit.common.internal.MlKitComponentDiscoveryService"
            android:directBootAware="true"
            android:exported="false" >
            <meta-data
                android:name="com.google.firebase.components:com.google.mlkit.common.internal.CommonComponentRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
        </service>

        <activity
            android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--
            Service handling Google Sign-In user revocation. For apps that do not integrate with
            Google Sign-In, this service will never be started.
        -->
        <service
            android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
            android:exported="true"
            android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION"
            android:visibleToInstantApps="true" />

        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <provider
            android:name="org.jetbrains.compose.resources.AndroidContextProvider"
            android:authorities="com.tgbotbuilder.app.resources.AndroidContextProvider"
            android:enabled="true"
            android:exported="false" >
        </provider>

        <activity
            android:name="androidx.glance.appwidget.action.ActionTrampolineActivity"
            android:enabled="true"
            android:excludeFromRecents="true"
            android:exported="false"
            android:theme="@android:style/Theme.NoDisplay" />
        <activity
            android:name="androidx.glance.appwidget.action.InvisibleActionTrampolineActivity"
            android:enabled="true"
            android:exported="false"
            android:launchMode="singleInstance"
            android:noHistory="true"
            android:taskAffinity="androidx.glance.appwidget.ListAdapterCallbackTrampoline"
            android:theme="@style/Widget.Glance.AppWidget.CallbackTrampoline" />

        <receiver
            android:name="androidx.glance.appwidget.action.ActionCallbackBroadcastReceiver"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name="androidx.glance.appwidget.UnmanagedSessionReceiver"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name="androidx.glance.appwidget.MyPackageReplacedReceiver"
            android:enabled="true"
            android:exported="false" >
            <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>

        <service
            android:name="androidx.glance.appwidget.GlanceRemoteViewsService"
            android:exported="true"
            android:permission="android.permission.BIND_REMOTEVIEWS" />
        <service
            android:name="androidx.work.impl.background.systemjob.SystemJobService"
            android:directBootAware="false"
            android:enabled="@bool/enable_system_job_service_default"
            android:exported="true"
            android:permission="android.permission.BIND_JOB_SERVICE" />
        <service
            android:name="androidx.work.impl.foreground.SystemForegroundService"
            android:directBootAware="false"
            android:enabled="@bool/enable_system_foreground_service_default"
            android:exported="false" />

        <receiver
            android:name="androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver"
            android:directBootAware="false"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name="androidx.work.impl.background.systemalarm.RescheduleReceiver"
            android:directBootAware="false"
            android:enabled="false"
            android:exported="false" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="androidx.work.impl.diagnostics.DiagnosticsReceiver"
            android:directBootAware="false"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.DUMP" >
            <intent-filter>
                <action android:name="androidx.work.diagnostics.REQUEST_DIAGNOSTICS" />
            </intent-filter>
        </receiver>

        <service
            android:name="androidx.core.widget.RemoteViewsCompatService"
            android:permission="android.permission.BIND_REMOTEVIEWS" />

        <activity
            android:name="androidx.compose.ui.tooling.PreviewActivity"
            android:exported="true" />

        <uses-library
            android:name="com.android.extensions.appfunctions"
            android:required="false" />

        <property
            android:name="android.app.appfunctions.schema"
            android:value="app_functions_schema.xsd" />

        <uses-library
            android:name="androidx.window.extensions"
            android:required="false" />
        <uses-library
            android:name="androidx.window.sidecar"
            android:required="false" />

        <service
            android:name="androidx.room3.MultiInstanceInvalidationService"
            android:directBootAware="true"
            android:exported="false" />
        <service
            android:name="androidx.room.MultiInstanceInvalidationService"
            android:directBootAware="true"
            android:exported="false" />

        <receiver
            android:name="androidx.profileinstaller.ProfileInstallReceiver"
            android:directBootAware="false"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.DUMP" >
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.INSTALL_PROFILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.SKIP_FILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.SAVE_PROFILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.datatransport.runtime.backends.TransportBackendDiscovery"
            android:exported="false" >
            <meta-data
                android:name="backend:com.google.android.datatransport.cct.CctBackendFactory"
                android:value="cct" />
        </service>
        <service
            android:name="com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" >
        </service>

        <receiver
            android:name="com.google.android.datatransport.runtime.scheduling.jobscheduling.AlarmManagerSchedulerBroadcastReceiver"
            android:exported="false" />
    </application>

</manifest>