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

    <!--
      Asked for at the moment a reminder is switched on, never on first launch —
      §31. A permission dialog before the user has seen the app is a dialog
      answered "deny" out of reflex.
    -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <!--
      No INTERNET permission. The core tracker is offline by design
      (PRODUCT_PLAN.md §44, §49) and it stays that way until Batch 07 brings ads
      and billing, at which point adding it is a deliberate, reviewable change
      rather than something that was always there.

      No SCHEDULE_EXACT_ALARM either: reminders use WorkManager, because a period
      reminder does not need alarm-clock precision (§31).
    -->

    <application
        android:name=".PeriodApplication"
        android:allowBackup="false"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="false"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.Period">

        <!--
          WorkManager is initialised by PeriodApplication (Configuration.Provider)
          so Hilt can construct the reminder worker. The default initializer has
          to be removed or it runs first and the custom factory never applies.
        -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            android:exported="false"
            tools:node="merge">
            <meta-data
                android:name="androidx.work.WorkManagerInitializer"
                android:value="androidx.startup"
                tools:node="remove" />
        </provider>

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:theme="@style/Theme.Period">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
