4.5 KiB · text History 44bc4f7
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <!-- The upload progress notification, and the uploads running as a
         foreground service so a long batch isn't cut short. -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
    <!-- Photos' locations: Android takes the GPS out of shared photos unless
         the app may see it, and reads the originals behind Google Photos'
         share links (upload/Originals.kt). Asked for from the app's screen,
         never needed to upload. -->
    <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>

    <application
        android:name=".CartosnapApplication"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_icon"
        android:roundIcon="@mipmap/ic_icon"
        android:allowBackup="false"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:supportsRtl="true"
        android:theme="@style/Theme.Cartosnap"
        android:usesCleartextTraffic="${cleartext}">

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <!-- Photos shared from the gallery or camera. One screen, two ways
             into it, each its own entry in the share sheet: -->
        <activity
            android:name=".ShareActivity"
            android:exported="false"
            android:excludeFromRecents="true"
            android:taskAffinity=""
            android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboardHidden|uiMode|density"
            android:theme="@style/Theme.Cartosnap.Share"/>

        <!-- "Add to a trip…": pick the trip from a list. -->
        <activity-alias
            android:name=".ShareToTrip"
            android:targetActivity=".ShareActivity"
            android:label="@string/share_to_trip"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
        </activity-alias>

        <!-- "Add to last trip": straight into the trip used last, no questions. -->
        <activity-alias
            android:name=".ShareToLastTrip"
            android:targetActivity=".ShareActivity"
            android:label="@string/share_to_last_trip"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
        </activity-alias>

        <!-- WorkManager's foreground service, declared as data sync so
             Android 14 lets uploads run in it. -->
        <service
            android:name="androidx.work.impl.foreground.SystemForegroundService"
            android:foregroundServiceType="dataSync"
            tools:node="merge"/>
    </application>
</manifest>