<?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.app.simplitend">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- For app blocking -> open new window over other apps to deny access -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- permissions for app blocking -->
    <uses-permission
        android:name="android.permission.PACKAGE_USAGE_STATS"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission
        android:name="android.permission.WRITE_SECURE_SETTINGS"
        tools:ignore="ProtectedPermissions" />

<!--    for retrieving all the apps having launcher screen-->
    <queries>
        <intent>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent>
    </queries>

    <application
        android:name=".apputils.SimpliTendApp"
        android:allowBackup="false"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.SimpliTend"
        android:usesCleartextTraffic="true"
        tools:targetApi="31">
        <activity
            android:name=".chats.ChatsActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:exported="false" />
        <activity
            android:name=".apputils.BottomNotificationActivity"
            android:exported="false"
            android:theme="@style/BottomNotification" />
        <activity
            android:name=".patient_dashboard.NotificationsActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".patient_dashboard.PatSettingsActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".patient_dashboard.fragments.CallsActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".patient_dashboard.DirectionToHomeActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.deactivateacc.DeActivateAccountActivity"
            android:exported="false"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".caregiverdashboard.activities.CaregiverSettingsActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.ContactAdminActivity"
            android:exported="false"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".caregiverdashboard.activities.ChangePinActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.CgChangePwdActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.CaregiverProfileActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".faqs.FAQ_Activity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".articles.ArticleShowerActivity"
            android:exported="false" />
        <activity
            android:name=".articles.ArticlesActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.PatientProfileShowerActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.EditProfileInfoActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".caregiverdashboard.activities.CgProfileProgressActivity"
            android:exported="false"
            android:screenOrientation="portrait" />
        <activity
            android:name=".cg_geofencing.CgGeoFencingActivity"
            android:exported="false"
            android:screenOrientation="portrait" />

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="${MAPS_API_KEY}" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".caregiverdashboard.activities.CaregiverDashActivity"
            android:exported="true"
            android:screenOrientation="portrait" />
        <activity
            android:name=".patient_dashboard.DashBoardActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.DIAL" />

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

                <!-- cannot handle DIAL_ACTION -->
                <data android:scheme="no_scheme" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DIAL" />

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

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".welcome.activities.WelcomeActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <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" />
                <action android:name="android.intent.action.DIAL" />

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

                <!-- cannot handle DIAL_ACTION -->
                <data android:scheme="no_scheme" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DIAL" />

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

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".welcome.welcomecg.fragments.CgAuthActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".cg_subscription.CgSubscriptionActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity> <!-- // app blocking stuff -->
        <activity android:name=".appblocking.FUAActivity" />
        <activity
            android:name=".appblocking.BlockApp"
            android:exported="true"
            android:launchMode="singleTop" />

        <meta-data
            android:name="com.onesignal.NotificationServiceExtension"
            android:value="com.app.simplitend.apputils.NotificationService" />

        <service
            android:name=".appblocking.TopAppDetectionService"
            android:exported="false"
            android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
            <intent-filter>
                <action android:name="android.accessibilityservice.AccessibilityService" />
            </intent-filter>

            <meta-data
                android:name="android.accessibilityservice"
                android:resource="@xml/accessibility_service_config" />
        </service>
        <service
            android:name=".callwhitelisting.CallService"
            android:exported="true"
            android:permission="android.permission.BIND_SCREENING_SERVICE">
            <intent-filter>
                <action android:name="android.telecom.CallScreeningService" />
            </intent-filter>
        </service>
        <service
            android:name=".locationupdates.LocationService"
            android:foregroundServiceType="location" />

        <receiver android:name=".patientgeofencing.PatientLocationUpdatesReceiver" />
        <receiver android:name=".apputils.BootCompleteReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>
        <receiver android:name=".patientgeofencing.GeoFenceBroadcastReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.simplitend.ACTION_GEOFENCE"/>
            </intent-filter>
        </receiver>

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

</manifest>