summaryrefslogtreecommitdiff
path: root/app/src/main/AndroidManifest.xml
blob: b92be673aebfefea2f26f23472dc0552949a6667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- Background audio requires a foreground service, and since Android 14 that service must
         declare its type. The notification this produces is the transport control (play/pause on
         the lock screen), not an alert: Listen posts no new-episode notifications of any kind. -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:name=".ListenApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.Listen">

        <!-- Declares Listen as a media app to Android Auto. The head unit reads this before it
             will show the app at all, and it must sit at application level — inside an
             activity it is simply ignored. -->
        <meta-data
            android:name="com.google.android.gms.car.application"
            android:resource="@xml/automotive_app_desc" />

        <activity
            android:name=".ui.MainActivity"
            android:exported="true"
            android:theme="@style/Theme.Listen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- "Play X on Listen" from the system or a head unit. In a car this is the only
                 interaction that keeps your eyes on the road. -->
            <intent-filter>
                <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- Share-sheet target. Listen has no discovery, so this and OPML import are how
             subscriptions get added: a URL shared from a browser or FeeDreader is resolved to
             a feed here. -->
        <activity
            android:name=".ui.ShareReceiverActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:theme="@style/Theme.Listen">
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>

        <!-- Exported, because the controller here is another process: Android Auto, Assistant
             or a Bluetooth remote binding from outside the app. A media service that is not
             exported simply never gets found by a car. -->
        <service
            android:name=".playback.PlaybackService"
            android:exported="true"
            android:foregroundServiceType="mediaPlayback">
            <intent-filter>
                <action android:name="androidx.media3.session.MediaLibraryService" />
                <!-- The legacy action, which is what Android Auto actually looks for. -->
                <action android:name="android.media.browse.MediaBrowserService" />
            </intent-filter>
        </service>

    </application>
</manifest>