Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / music / src / main / AndroidManifest.xml

AndroidManifest.xml199 lines · 9.5 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools">
4
5 <!-- No network, deliberately: local library + cast-over-IPC only. :library:image merges in
6 INTERNET (its HttpFetcher) and :library:network merges in ACCESS_NETWORK_STATE, neither
7 of which this app uses, so both are stripped here like camera/ does. -->
8 <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). -->
9 <!-- This app uses no motion/environment sensors; MAOS withholds the -->
10 <!-- Sensors permission at install instead of auto-granting it. -->
11 <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" />
12
13 <!-- Single APK for phone and watch. Deliberately NO
14 android.hardware.type.watch uses-feature here: required="true"
15 would block every phone install, and required="false" is
16 disallowed for this feature (lint InvalidWearFeatureAttribute;
17 Google's packaging model does not support one APK for Wear and
18 non-Wear via Play). This app does not distribute through Play's
19 watch channel — it is sideloaded / F-Droid-installed, where no
20 feature declaration is needed to install on a watch — so the
21 APK carries no watch feature filter at all and
22 FormFactor.isWatch (PackageManager.FEATURE_WATCH, still
23 reported by watch hardware at runtime) routes the experience. -->
24 <uses-feature
25 android:name="android.hardware.touchscreen"
26 android:required="false" />
27 <!-- The watch experience's WearLink transport wakes the watch CPU. -->
28 <uses-permission android:name="android.permission.WAKE_LOCK" />
29
30 <uses-permission android:name="android.permission.INTERNET" tools:node="remove" />
31 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove" />
32
33 <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
34 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
35 <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
36 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
37 <!-- Cast guards its picker Activity and its content service with this, so a consumer that omits
38 it does not degrade: launching the picker throws a SecurityException outright. Signature
39 level, so it grants nothing to anyone outside this repo. -->
40 <uses-permission android:name="com.vayunmathur.cast.permission.STREAM_CONTENT" />
41
42 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
43
44 <permission
45 android:name="com.vayunmathur.music.permissions.ACCESS_MUSIC"
46 android:protectionLevel="signature" />
47
48 <application
49 android:allowBackup="true"
50 android:dataExtractionRules="@xml/data_extraction_rules"
51 android:icon="@mipmap/ic_launcher"
52 android:label="@string/app_name"
53 android:roundIcon="@mipmap/ic_launcher"
54 android:supportsRtl="true"
55 android:theme="@style/Theme.General">
56
57 <!-- Watch experience is paired with the phone app, not standalone. -->
58 <meta-data
59 android:name="com.google.android.wearable.standalone"
60 android:value="false" />
61
62 <meta-data
63 android:name="com.google.android.gms.car.application"
64 android:resource="@xml/automotive_app_desc" />
65
66 <activity
67 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
68 android:name=".MainActivity"
69 android:exported="true"
70 android:theme="@style/Theme.General">
71 <intent-filter>
72 <action android:name="android.intent.action.MAIN" />
73
74 <category android:name="android.intent.category.LAUNCHER" />
75 </intent-filter>
76 </activity>
77
78 <!-- Watch experience: entered only via MainActivity's watch routing
79 (no launcher filter of its own). Inert on a phone: nothing
80 starts it there, and the phone player/sync it talks to over
81 WearLink is the phone side of this same APK. -->
82 <activity
83 android:name=".ui.WearMainActivity"
84 android:exported="false"
85 android:taskAffinity=""
86 android:theme="@android:style/Theme.Material.NoActionBar" />
87
88 <!-- ExportedService: MediaLibrary/MediaSession service must be exported without a
89 permission so Android Auto and other media controllers (different UIDs) can bind;
90 Media3 validates controllers itself. tools:ignore is the genuine-false-positive
91 suppression for this framework-required export. -->
92 <service
93 android:name=".service.PlaybackService"
94 android:foregroundServiceType="mediaPlayback"
95 android:exported="true"
96 tools:ignore="ExportedService">
97 <intent-filter>
98 <action android:name="androidx.media3.session.MediaLibraryService" />
99 <action android:name="androidx.media3.session.MediaSessionService" />
100 <action android:name="android.media.browse.MediaBrowserService" />
101 <action android:name="android.intent.action.MEDIA_BUTTON" />
102 <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
103 </intent-filter>
104 </service>
105
106 <!-- ExportedService: CarAppService must be exported without a permission so the car
107 host (Android Auto / AAOS, a different UID) can bind; the Car App Library
108 validates hosts via createHostValidator(). Genuine false positive. -->
109 <service
110 android:name=".service.car.MusicCarAppService"
111 android:exported="true"
112 tools:ignore="ExportedService">
113 <intent-filter>
114 <action android:name="androidx.car.app.CarAppService" />
115 <category android:name="androidx.car.app.category.MEDIA" />
116 </intent-filter>
117 </service>
118
119 <meta-data
120 android:name="androidx.car.app.minCarApiLevel"
121 android:value="1" />
122
123 <activity
124 android:name=".intents.SearchIntent"
125 android:exported="true"
126 android:theme="@android:style/Theme.NoDisplay"
127 android:permission="com.vayunmathur.music.permissions.ACCESS_MUSIC">
128 </activity>
129
130 <activity
131 android:name=".intents.PlayIntent"
132 android:exported="true"
133 android:theme="@android:style/Theme.NoDisplay"
134 android:permission="com.vayunmathur.music.permissions.ACCESS_MUSIC">
135 </activity>
136
137 <activity
138 android:name=".intents.NowPlayingIntent"
139 android:exported="true"
140 android:theme="@android:style/Theme.NoDisplay"
141 android:permission="com.vayunmathur.music.permissions.ACCESS_MUSIC">
142 </activity>
143
144 <activity
145 android:name=".intents.GetPlaylistsIntent"
146 android:exported="true"
147 android:theme="@android:style/Theme.NoDisplay"
148 android:permission="com.vayunmathur.music.permissions.ACCESS_MUSIC">
149 </activity>
150
151 <activity
152 android:name=".intents.GetPlaylistTracksIntent"
153 android:exported="true"
154 android:theme="@android:style/Theme.NoDisplay"
155 android:permission="com.vayunmathur.music.permissions.ACCESS_MUSIC">
156 </activity>
157
158 <activity
159 android:name=".intents.AudioPreviewActivity"
160 android:exported="true"
161 android:excludeFromRecents="true"
162 android:theme="@android:style/Theme.Translucent.NoTitleBar">
163 <intent-filter>
164 <action android:name="android.intent.action.VIEW" />
165 <category android:name="android.intent.category.DEFAULT" />
166 <data android:scheme="file" />
167 <data android:scheme="content" />
168 <data android:mimeType="audio/*" />
169 </intent-filter>
170 </activity>
171
172 <!-- Watch conduit scheduled push sync: the phone Watch app fires
173 ConduitSync.ACTION (signature permission, package-addressed)
174 and this receiver pushes the current snapshot over the
175 conduit. Exported only to holders of that permission. -->
176 <receiver
177 android:name=".sync.ConduitSyncTriggerReceiver"
178 android:exported="true"
179 android:permission="com.vayunmathur.watch.permissions.CONDUIT">
180 <intent-filter>
181 <action android:name="com.vayunmathur.watch.action.SYNC_TRIGGER" />
182 </intent-filter>
183 </receiver>
184 <!-- Watch "Open on phone" wake: the phone Watch conduit host fires
185 OpenOnPhoneContract.ACTION (signature permission, package-addressed)
186 when a watch open request arrives with no live registration in
187 this app; this receiver launches the main activity. -->
188 <receiver
189 android:name=".sync.OpenOnPhoneReceiver"
190 android:exported="true"
191 android:permission="com.vayunmathur.watch.permissions.CONDUIT">
192 <intent-filter>
193 <action android:name="com.vayunmathur.watch.action.OPEN_ON_PHONE" />
194 </intent-filter>
195 </receiver>
196
197 </application>
198
199</manifest>