-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathAndroidManifest.xml
505 lines (444 loc) · 21.6 KB
/
AndroidManifest.xml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<!-- Permission RECORD_AUDIO.
Used to record the speech input to be transcribed.
This is an essential permission for Kõnele. Because it is also a "dangerous" permission,
then Kõnele requests it as soon as the user starts the audio recorder.
-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Permission INTERNET.
Used to reach the speech recognition server.
Non-dangerous permission, i.e. granted automatically at install time.
This is not needed when only using offline recognition services (e.g. wake up word triggers),
but unfortunately there is no way to enable/disable it at runtime.
-->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Permission READ_EXTERNAL_STORAGE is sometimes required when importing rewrite rules,
e.g. when opening rules via Firefox or Dropbox. (It is not needed via Chrome.)
This is a "dangerous" permission, i.e. it is not enabled by default. Kõnele currently does not
provide a UI to request it either, but listing it in the manifest makes it show up in the Apps settings,
i.e. the user can grant it, if needed.
In Android versions before v6.0 (~35% of the users as of 2017-06-18)
the permission is granted at install time, which is not nice, but this user base will
disappear over time.
Doc: "READ_EXTERNAL_STORAGE is deprecated (and is not granted) when targeting Android 13+.
If you need to query or interact with MediaStore or media files on the shared storage,
you should instead use one or more new storage permissions: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO or READ_MEDIA_AUDIO."
TODO: test importing rewrite rules (which are plain text) on Android 13+.
-->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<!-- Permission SET_ALARM.
Used to set the alarm clock if the transcription resolves to an AlarmClock intent.
Non-dangerous permission, i.e. granted automatically at install time.
This is only used when a rewrite rule creates an AlarmClock intent, so most users would not
need it, but unfortunately there is no way to enable/disable it at runtime.
-->
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<!-- TODO: investigate if we need this permission (and enable it during runtime), to
mute the audio stream during recognition. -->
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<!-- Custom permission required by GetPutPreferenceActivity to be able to read/write the Kõnele settings. -->
<!--
<uses-permission android:name="ee.ioc.phon.android.speak.permission.GET_PUT_SETTING" />
-->
<!-- Custom permission required by FetchUrlActivity to be able to fetch data from a given URL
and interpret and execute its corresponding activity. -->
<uses-permission android:name="ee.ioc.phon.android.speak.permission.FETCH_URL" />
<!--
<permission
android:name="ee.ioc.phon.android.speak.permission.GET_PUT_SETTING"
android:description="@string/descriptionPermissionGetPutSetting"
android:label="@string/labelPermissionGetPutSetting"
android:permissionGroup="android.permission-group.CHANGE_SETTINGS"
android:protectionLevel="dangerous" />
-->
<!--
TODO: setting the permissionGroup to a non-existent group did not work in Android v12.
android:permissionGroup="android.permission-group.RUN_ACTIVITY"
-->
<permission
android:name="ee.ioc.phon.android.speak.permission.FETCH_URL"
android:description="@string/descriptionPermissionFetchUrl"
android:label="@string/labelPermissionFetchUrl"
android:protectionLevel="dangerous" />
<!-- Some Chromebooks don't support touch. Although not essential,
it's a good idea to explicitly include this declaration. -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<!-- <uses-feature android:name="android.hardware.type.watch" /> -->
<!-- TODO: review -->
<queries>
<intent>
<!-- Packages that provide speech recognition services -->
<action android:name="android.speech.RecognitionService" />
</intent>
<intent>
<!-- Packages that provide TTS services -->
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
<intent>
<!-- This seems to be needed to be able to show the labels and icons of apps, queried by package name. -->
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
<application
android:allowBackup="true"
android:description="@string/descriptionApp"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/labelApp"
android:localeConfig="@xml/locales_config"
android:supportsRtl="true"
android:theme="@style/Theme.K6nele"
android:usesCleartextTraffic="true">
<!--
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<uses-library
android:name="com.google.android.wearable"
android:required="false" />
-->
<!--
TODO: singleTask seems a more appropriate launchMode but returns the results to the caller
only on Android v5, So we have to use standard on older versions. See also:
http://stackoverflow.com/questions/8960072/onactivityresult-with-launchmode-singletask
Also, failed to set the launchMode from the resource, INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
-->
<!-- Voice search panel. -->
<!--
android:finishOnTaskLaunch="true"
android:allowTaskReparenting="false"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
-->
<activity
android:name=".activity.SpeechActionActivity"
android:clearTaskOnLaunch="true"
android:exported="true"
android:label="@string/labelActivityRecognizerIntent"
android:launchMode="standard"
android:theme="@style/Theme.K6nele.Dialog.NoActionBar">
<intent-filter>
<action android:name="android.speech.action.RECOGNIZE_SPEECH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.speech.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- input/output: Nothing -->
<!-- Samsung Galaxy SII launches VOICE_COMMAND when HOME is double-clicked -->
<intent-filter>
<action android:name="android.intent.action.VOICE_COMMAND" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!--
Action ASSIST (API 16)
Input: EXTRA_ASSIST_PACKAGE, EXTRA_ASSIST_CONTEXT. Output: nothing.
* "Search assistant" on CM10.2, which can be mapped to various buttons.
* Long press on the HOME button on Nexus 5X.
* Upper physical button on Huawei Watch 2.
The default ASSIST app is user-configurable on the phone but not on Wear,
i.e. on the phone the user can choose which app is started, e.g. when long-pressing
on the HOME button, and the filter priority plays no role. On Wear the choice
is based only on the priority.
We set it to lower than default to let the other guy win. This is probably
specific to Huawei Watch 2 with its weird setup,
where the upper button launches ASSIST (and this cannot be
changed) and the lower button can open any app (other than Google Assist).
-->
<intent-filter android:priority="-10">
<action android:name="android.intent.action.ASSIST" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- input/output: Nothing -->
<!-- API 3 -->
<!-- "Voice search" on CM10.2, which can be mapped to various buttons -->
<intent-filter>
<action android:name="android.intent.action.SEARCH_LONG_PRESS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- input/output: Nothing -->
<intent-filter>
<action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- TODO: future work
<intent-filter>
<action android:name="android.provider.MediaStore.RECORD_SOUND" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
-->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- TODO: do we still need it, now that we support all services -->
<meta-data
android:name="android.speech.DETAILS"
android:value="ee.ioc.phon.android.speak.GetLanguageDetailsReceiver" />
</activity>
<!-- This receiver is exported, i.e. any app can ask which languages K6nele supports. -->
<receiver
android:name=".GetLanguageDetailsReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.speech.action.GET_LANGUAGE_DETAILS" />
</intent-filter>
</receiver>
<!-- Preferences are exported by default because they have intent filters.
But they should be not exported to avoid a security issue on older Androids (see lint check).
But on Android 12 they must be exported again...
-->
<activity
android:name=".activity.Preferences"
android:exported="true"
android:label="@string/labelActivityPreferences">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".PreferencesRecognitionServiceHttp"
android:exported="true"
android:label="@string/labelActivityPreferencesRecognitionServiceHttp"
android:parentActivityName=".activity.RecServiceSelectorActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".PreferencesRecognitionServiceWs"
android:exported="true"
android:label="@string/labelActivityPreferencesRecognitionServiceWs"
android:parentActivityName=".activity.RecServiceSelectorActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:exported="false"
android:label="@string/labelActivityAbout"
android:parentActivityName=".activity.Preferences"
android:theme="@style/Theme.K6nele" />
<!-- This is the only activity that the recognizer can launch. -->
<!-- TODO: do not reparent -->
<activity
android:name=".activity.DetailsActivity"
android:exported="false"
android:theme="@style/Theme.K6nele.Dialog" />
<!-- TODO: remove Light (once style inheritance works) -->
<activity
android:name=".activity.RewritesErrorsActivity"
android:exported="false"
android:theme="@style/Theme.K6nele.Light.Dialog" />
<activity
android:name=".activity.ComboSelectorActivity"
android:exported="false"
android:label="@string/dialogTitleCombo"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.RecServiceSelectorActivity"
android:exported="true"
android:label="@string/titleServices"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.AppListActivity"
android:exported="false"
android:label="@string/labelActivityAppList"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.GrammarListActivity"
android:exported="false"
android:label="@string/labelActivityGrammarList"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.ServerListActivity"
android:exported="false"
android:label="@string/labelActivityServerList"
android:parentActivityName=".PreferencesRecognitionServiceHttp" />
<!-- Exporting this to allow a shortcut to be created e.g. using Tasker. -->
<activity
android:name=".activity.RewritesSelectorActivity"
android:exported="true"
android:label="@string/labelActivityRewritesSelector"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.RewritesLoaderActivity"
android:exported="true"
android:label="@string/labelActivityRewritesLoader"
android:theme="@style/Theme.K6nele.Dialog.NoActionBar"
android:windowSoftInputMode="stateUnchanged">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/tab-separated-values" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/tab-separated-values" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="*"
android:scheme="k6" />
</intent-filter>
</activity>
<activity
android:name=".activity.RewritesActivity"
android:exported="false"
android:parentActivityName=".activity.RewritesSelectorActivity">
<!--
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable"></meta-data>
-->
</activity>
<activity
android:name=".activity.PermissionsRequesterActivity"
android:exported="false"
android:theme="@style/Theme.K6nele.Translucent" />
<activity
android:name=".activity.FetchUrlActivity"
android:exported="true"
android:permission="ee.ioc.phon.android.speak.permission.FETCH_URL"
android:theme="@style/Theme.K6nele.Translucent" />
<!-- TODO: require: ee.ioc.phon.android.speak.permission.GET_PUT_SETTING -->
<activity
android:name=".activity.GetPutPreferenceActivity"
android:exported="true"
android:theme="@style/Theme.K6nele.Translucent" />
<activity
android:name=".activity.QuickSettingsActivity"
android:exported="false"
android:label="@string/labelActivityQuickSettings"
android:parentActivityName=".activity.Preferences" />
<activity
android:name=".activity.RecognitionServiceWsUrlActivity"
android:exported="false"
android:label="@string/titleWsServer"
android:parentActivityName=".PreferencesRecognitionServiceWs"
android:windowSoftInputMode="stateUnchanged" />
<activity
android:name=".demo.SimpleDemo"
android:exported="false"
android:theme="@style/Theme.K6nele.Translucent" />
<activity
android:name=".demo.ExtrasDemo"
android:exported="true"
android:theme="@style/Theme.K6nele.Translucent" />
<activity
android:name=".demo.HandsfreeDemoActivity"
android:exported="true"
android:label="@string/labelActivityHandsfreeDemo">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".demo.ChatDemoActivity"
android:exported="true"
android:label="@string/labelActivityChatDemo"
android:theme="@style/Theme.K6nele.Light" />
<activity
android:name=".demo.VoiceSearchDemo"
android:exported="false"
android:label="@string/labelActivityVoiceSearchDemo" />
<activity
android:name=".demo.EncoderDemoActivity"
android:exported="true"
android:label="@string/labelActivityEncoderDemo" />
<activity
android:name=".demo.EncoderListDemo"
android:exported="true"
android:label="@string/labelActivityEncoderListDemo" />
<activity
android:name=".demo.ImeListDemo"
android:exported="true"
android:label="@string/labelActivityImeListDemo" />
<activity
android:name=".demo.FormDemoActivity"
android:exported="true"
android:label="@string/labelActivityFormDemo" />
<!-- This service is exported, i.e. any app can call K6nele, but needs to have recording-permission. -->
<!-- TODO: why can't I specify more permissions here? -->
<!-- Setting the process here solves the permission issue on Android 11. -->
<service
android:name=".service.WebSocketRecognitionService"
android:description="@string/summaryServiceWs"
android:exported="true"
android:foregroundServiceType="microphone"
android:icon="@drawable/ic_service"
android:label="@string/labelRecognitionServiceWs"
android:permission="android.permission.RECORD_AUDIO"
android:process=":service">
<intent-filter>
<!-- The constant value is defined at RecognitionService.SERVICE_INTERFACE. -->
<action android:name="android.speech.RecognitionService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.speech"
android:resource="@xml/recognition_service_ws" />
<!--
<meta-data
android:name="k6nele.test"
android:value="123" />
-->
</service>
<service
android:name=".service.HttpRecognitionService"
android:description="@string/summaryServiceHttp"
android:exported="true"
android:foregroundServiceType="microphone"
android:icon="@drawable/ic_service"
android:label="@string/labelRecognitionServiceHttp"
android:permission="android.permission.RECORD_AUDIO"
android:process=":service">
<intent-filter>
<!-- The constant value is defined at RecognitionService.SERVICE_INTERFACE. -->
<action android:name="android.speech.RecognitionService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.speech"
android:resource="@xml/recognition_service_http" />
</service>
<service
android:name=".service.SpeechInputMethodService"
android:exported="true"
android:foregroundServiceType="microphone"
android:label="@string/labelIme"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="@xml/input_method" />
</service>
<provider
android:name=".provider.AppsContentProvider"
android:authorities="ee.ioc.phon.android.speak.provider.AppsContentProvider"
android:exported="false" />
<provider
android:name=".provider.FileContentProvider"
android:authorities="ee.ioc.phon.android.speak.provider.FileContentProvider"
android:exported="true"
android:permission="android.permission.RECORD_AUDIO" />
</application>
</manifest>