1<?xml version="1.0" encoding="utf-8"?>
2
3<!-- Copyright (C) 2018 The Android Open Source Project
4
5     Licensed under the Apache License, Version 2.0 (the "License"" />
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8
9          http://www.apache.org/licenses/LICENSE-2.0
10
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16-->
17
18<roles>
19
20    <permission-set name="phone">
21        <permission name="android.permission.READ_PHONE_STATE" />
22        <permission name="android.permission.CALL_PHONE" />
23        <permission name="android.permission.READ_CALL_LOG" />
24        <permission name="android.permission.WRITE_CALL_LOG" />
25        <permission name="com.android.voicemail.permission.ADD_VOICEMAIL" />
26        <permission name="com.android.voicemail.permission.READ_VOICEMAIL" minSdkVersion="31" />
27        <permission name="com.android.voicemail.permission.WRITE_VOICEMAIL" minSdkVersion="31" />
28        <permission name="android.permission.USE_SIP" />
29        <permission name="android.permission.PROCESS_OUTGOING_CALLS" />
30        <permission name="android.permission.ANSWER_PHONE_CALLS" />
31    </permission-set>
32
33    <permission-set name="contacts">
34        <permission name="android.permission.READ_CONTACTS" />
35        <permission name="android.permission.WRITE_CONTACTS" />
36        <permission name="android.permission.GET_ACCOUNTS" />
37    </permission-set>
38
39    <permission-set name="location">
40        <permission name="android.permission.ACCESS_FINE_LOCATION" />
41        <permission name="android.permission.ACCESS_COARSE_LOCATION" />
42    </permission-set>
43
44    <permission-set name="coarse_location">
45        <permission name="android.permission.ACCESS_COARSE_LOCATION" />
46    </permission-set>
47
48    <permission-set name="calendar">
49        <permission name="android.permission.READ_CALENDAR" />
50        <permission name="android.permission.WRITE_CALENDAR" />
51    </permission-set>
52
53    <permission-set name="sms">
54        <permission name="android.permission.SEND_SMS" />
55        <permission name="android.permission.RECEIVE_SMS" />
56        <permission name="android.permission.READ_SMS" />
57        <permission name="android.permission.RECEIVE_WAP_PUSH" />
58        <permission name="android.permission.RECEIVE_MMS" />
59        <permission name="android.permission.READ_CELL_BROADCASTS" />
60    </permission-set>
61
62    <permission-set name="microphone">
63        <permission name="android.permission.RECORD_AUDIO" />
64    </permission-set>
65
66    <permission-set name="camera">
67        <permission name="android.permission.CAMERA" />
68    </permission-set>
69
70    <permission-set name="sensors">
71        <permission name="android.permission.BODY_SENSORS" />
72    </permission-set>
73
74    <permission-set name="storage">
75        <permission name="android.permission.READ_EXTERNAL_STORAGE" />
76        <permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
77    </permission-set>
78
79    <permission-set name="nearby_devices">
80        <permission name="android.permission.BLUETOOTH_ADVERTISE" minSdkVersion="31" />
81        <permission name="android.permission.BLUETOOTH_CONNECT" minSdkVersion="31" />
82        <permission name="android.permission.BLUETOOTH_SCAN" minSdkVersion="31" />
83    </permission-set>
84
85    <role
86        name="android.app.role.ASSISTANT"
87        behavior="AssistantRoleBehavior"
88        defaultHolders="config_defaultAssistant"
89        description="@string/role_assistant_description"
90        exclusive="true"
91        fallBackToDefaultHolder="true"
92        showNone="true"
93        label="@string/role_assistant_label"
94        overrideUserWhenGranting="true"
95        requestable="false"
96        shortLabel="@string/role_assistant_short_label">
97        <required-components>
98            <!-- Qualified components are determined int AssistantRoleBehavior. This comment here is
99                 ignored and represents just a rough description
100
101            <any-of>
102                <service permission="android.permission.BIND_VOICE_INTERACTION"
103                         supportsAssist="true">
104                    <intent-filter>
105                        <action name="android.service.voice.VoiceInteractionService" />
106                    </intent-filter>
107                    <meta-data name="android.voice_interaction"
108                               optional="false">
109                        required tag in metadata xml: sessionService
110                        required tag in metadata xml: recognitionService
111                        required tag in metadata xml: supportsAssist = true
112                    </meta-data>
113                </service>
114                <activity>
115                    <intent-filter>
116                        <action name="android.intent.action.ASSIST" />
117                    </intent-filter>
118                </activity>
119            </ any-of>
120
121            -->
122        </required-components>
123        <permissions>
124            <permission-set name="sms" />
125            <permission name="android.permission.READ_CALL_LOG" />
126            <permission name="android.permission.ACCESS_BLOBS_ACROSS_USERS" minSdkVersion="31" />
127        </permissions>
128        <app-op-permissions>
129            <app-op-permission name="android.permission.SYSTEM_ALERT_WINDOW" />
130        </app-op-permissions>
131    </role>
132
133    <!---
134      ~ @see com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController
135      ~ @see com.android.settings.applications.defaultapps.DefaultBrowserPicker
136      ~ @see com.android.server.pm.PackageManagerService.resolveAllBrowserApps(int)
137      ~ @see com.android.server.pm.PackageManagerService.setDefaultBrowserPackageName(String, int)
138      ~ @see com.android.server.pm.permission.DefaultPermissionGrantPolicy.grantDefaultPermissionsToDefaultBrowser(String, int)
139      -->
140    <role
141        name="android.app.role.BROWSER"
142        behavior="BrowserRoleBehavior"
143        defaultHolders="config_defaultBrowser"
144        description="@string/role_browser_description"
145        exclusive="true"
146        label="@string/role_browser_label"
147        overrideUserWhenGranting="true"
148        requestDescription="@string/role_browser_request_description"
149        requestTitle="@string/role_browser_request_title"
150        shortLabel="@string/role_browser_short_label">
151        <!--
152          ~ Required components matching is handled in BrowserRoleBehavior because it needs the
153          ~ PackageManager.MATCH_ALL flag and other manual filtering, which cannot fit in our
154          ~ current mechanism easily.
155          -->
156        <!--
157        <required-components>
158            <activity>
159                <intent-filter>
160                    <action name="android.intent.action.VIEW" />
161                    <category name="android.intent.category.BROWSABLE" />
162                    <data scheme="http" />
163                </intent-filter>
164            </activity>
165        </required-components>
166        -->
167        <!--
168          ~ Not need to set preferred activity because PackageManager handles browser intents
169          ~ specially.
170          -->
171    </role>
172
173    <!--
174      ~ @see com.android.settings.applications.defaultapps.DefaultPhonePreferenceController
175      ~ @see com.android.settings.applications.defaultapps.DefaultPhonePicker
176      ~ @see android.telecom.DefaultDialerManager
177      ~ @see com.android.server.pm.permission.DefaultPermissionGrantPolicy.grantDefaultPermissionsToDefaultDialerApp(String, int)
178      ~ @see com.android.server.pm.Settings.setDefaultDialerPackageNameLPw(String, int)
179      -->
180    <role
181        name="android.app.role.DIALER"
182        behavior="DialerRoleBehavior"
183        defaultHolders="config_defaultDialer"
184        description="@string/role_dialer_description"
185        exclusive="true"
186        fallBackToDefaultHolder="true"
187        label="@string/role_dialer_label"
188        overrideUserWhenGranting="true"
189        requestDescription="@string/role_dialer_request_description"
190        requestTitle="@string/role_dialer_request_title"
191        searchKeywords="@string/role_dialer_search_keywords"
192        shortLabel="@string/role_dialer_short_label">
193        <required-components>
194            <activity>
195                <intent-filter>
196                    <action name="android.intent.action.DIAL" />
197                </intent-filter>
198            </activity>
199            <activity>
200                <intent-filter>
201                    <action name="android.intent.action.DIAL" />
202                    <data scheme="tel" />
203                </intent-filter>
204            </activity>
205        </required-components>
206        <permissions>
207            <permission-set name="phone" />
208            <permission-set name="contacts" />
209            <permission-set name="sms" />
210            <permission-set name="microphone" />
211            <permission-set name="camera" />
212        </permissions>
213        <app-op-permissions>
214            <app-op-permission name="android.permission.SYSTEM_ALERT_WINDOW" />
215        </app-op-permissions>
216        <app-ops>
217            <!--
218              ~ @see com.android.settings.applications.defaultapps.DefaultPhonePicker#setDefaultKey(String)
219              ~ @see com.android.settings.fuelgauge.BatteryUtils#setForceAppStandby(int, String, int)
220              -->
221            <app-op name="android:run_in_background" maxTargetSdkVersion="25" mode="allowed" />
222            <app-op name="android:run_any_in_background" mode="allowed" />
223        </app-ops>
224        <preferred-activities>
225            <preferred-activity>
226                <activity>
227                    <intent-filter>
228                        <action name="android.intent.action.DIAL" />
229                    </intent-filter>
230                </activity>
231                <intent-filter>
232                    <action name="android.intent.action.DIAL" />
233                </intent-filter>
234            </preferred-activity>
235            <preferred-activity>
236                <activity>
237                    <intent-filter>
238                        <action name="android.intent.action.DIAL" />
239                        <data scheme="tel" />
240                    </intent-filter>
241                </activity>
242                <intent-filter>
243                    <action name="android.intent.action.DIAL" />
244                    <data scheme="tel" />
245                </intent-filter>
246            </preferred-activity>
247        </preferred-activities>
248    </role>
249
250    <!--
251      ~ @see com.android.settings.applications.defaultapps.DefaultSmsPreferenceController
252      ~ @see com.android.settings.applications.defaultapps.DefaultSmsPicker
253      ~ @see com.android.internal.telephony.SmsApplication
254      ~ @see com.android.server.pm.permission.DefaultPermissionGrantPolicy.grantDefaultPermissionsToDefaultSmsApp(String, int)
255      -->
256    <role
257        name="android.app.role.SMS"
258        behavior="SmsRoleBehavior"
259        defaultHolders="config_defaultSms"
260        description="@string/role_sms_description"
261        exclusive="true"
262        label="@string/role_sms_label"
263        overrideUserWhenGranting="true"
264        requestDescription="@string/role_sms_request_description"
265        requestTitle="@string/role_sms_request_title"
266        searchKeywords="@string/role_sms_search_keywords"
267        shortLabel="@string/role_sms_short_label">
268        <required-components>
269            <receiver permission="android.permission.BROADCAST_SMS">
270                <intent-filter>
271                    <action name="android.provider.Telephony.SMS_DELIVER" />
272                </intent-filter>
273            </receiver>
274            <receiver permission="android.permission.BROADCAST_WAP_PUSH">
275                <intent-filter>
276                    <action name="android.provider.Telephony.WAP_PUSH_DELIVER" />
277                    <data mimeType="application/vnd.wap.mms-message" />
278                </intent-filter>
279            </receiver>
280            <service permission="android.permission.SEND_RESPOND_VIA_MESSAGE">
281                <intent-filter>
282                    <action name="android.intent.action.RESPOND_VIA_MESSAGE" />
283                    <data scheme="smsto" />
284                </intent-filter>
285            </service>
286            <activity>
287                <intent-filter>
288                    <action name="android.intent.action.SENDTO" />
289                    <data scheme="smsto" />
290                </intent-filter>
291            </activity>
292        </required-components>
293        <permissions>
294            <permission-set name="phone" />
295            <permission-set name="contacts" />
296            <permission-set name="sms" />
297            <permission-set name="storage" />
298            <permission-set name="microphone" />
299            <permission-set name="camera" />
300            <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND" minSdkVersion="31" />
301        </permissions>
302        <app-ops>
303            <app-op name="android:write_sms" mode="allowed" />
304            <!--
305              ~ @see com.android.settings.applications.defaultapps.DefaultSmsPicker#setDefaultKey(String)
306              ~ @see com.android.settings.fuelgauge.BatteryUtils#setForceAppStandby(int, String, int)
307              -->
308            <app-op name="android:run_in_background" maxTargetSdkVersion="25" mode="allowed" />
309            <app-op name="android:run_any_in_background" mode="allowed" />
310            <app-op name="android:read_device_identifiers" mode="allowed" />
311        </app-ops>
312        <preferred-activities>
313            <preferred-activity>
314                <activity>
315                    <intent-filter>
316                        <action name="android.intent.action.SENDTO" />
317                        <data scheme="smsto" />
318                    </intent-filter>
319                </activity>
320                <intent-filter>
321                    <action name="android.intent.action.SENDTO" />
322                    <data scheme="sms" />
323                </intent-filter>
324                <intent-filter>
325                    <action name="android.intent.action.SENDTO" />
326                    <data scheme="smsto" />
327                </intent-filter>
328                <intent-filter>
329                    <action name="android.intent.action.SENDTO" />
330                    <data scheme="mms" />
331                </intent-filter>
332                <intent-filter>
333                    <action name="android.intent.action.SENDTO" />
334                    <data scheme="mmsto" />
335                </intent-filter>
336            </preferred-activity>
337        </preferred-activities>
338    </role>
339
340    <!---
341      ~ @see com.android.settings.applications.defaultapps.DefaultEmergencyPreferenceController
342      ~ @see com.android.settings.applications.defaultapps.DefaultEmergencyPicker
343      ~ @see com.android.phone.EmergencyAssistanceHelper
344      -->
345    <role
346        name="android.app.role.EMERGENCY"
347        behavior="EmergencyRoleBehavior"
348        description="@string/role_emergency_description"
349        exclusive="true"
350        label="@string/role_emergency_label"
351        overrideUserWhenGranting="true"
352        requestDescription="@string/role_emergency_request_description"
353        requestTitle="@string/role_emergency_request_title"
354        searchKeywords="@string/role_emergency_search_keywords"
355        shortLabel="@string/role_emergency_short_label"
356        systemOnly="true">
357        <required-components>
358            <activity>
359                <intent-filter>
360                    <action name="android.telephony.action.EMERGENCY_ASSISTANCE" />
361                </intent-filter>
362            </activity>
363        </required-components>
364        <permissions>
365            <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND" minSdkVersion="31" />
366            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" minSdkVersion="31" />
367        </permissions>
368    </role>
369
370    <!---
371      ~ @see com.android.settings.applications.defaultapps.DefaultHomePreferenceController
372      ~ @see com.android.settings.applications.defaultapps.DefaultHomePicker
373      ~ @see com.android.server.pm.PackageManagerService#setHomeActivity(ComponentName, int)
374      -->
375    <role
376        name="android.app.role.HOME"
377        behavior="HomeRoleBehavior"
378        description="@string/role_home_description"
379        exclusive="true"
380        label="@string/role_home_label"
381        overrideUserWhenGranting="true"
382        requestDescription="@string/role_home_request_description"
383        requestTitle="@string/role_home_request_title"
384        searchKeywords="@string/role_home_search_keywords"
385        shortLabel="@string/role_home_short_label">
386        <!-- Also used by HomeRoleBehavior.getFallbackHolder(). -->
387        <required-components>
388            <activity>
389                <intent-filter>
390                    <action name="android.intent.action.MAIN" />
391                    <category name="android.intent.category.HOME" />
392                </intent-filter>
393            </activity>
394        </required-components>
395        <preferred-activities>
396            <preferred-activity>
397                <activity>
398                    <intent-filter>
399                        <action name="android.intent.action.MAIN" />
400                        <category name="android.intent.category.HOME" />
401                    </intent-filter>
402                </activity>
403                <intent-filter>
404                    <action name="android.intent.action.MAIN" />
405                    <category name="android.intent.category.HOME" />
406                </intent-filter>
407            </preferred-activity>
408        </preferred-activities>
409    </role>
410
411    <!--- @see android.telecom.CallRedirectionService -->
412    <role
413        name="android.app.role.CALL_REDIRECTION"
414        defaultHolders="config_defaultCallRedirection"
415        description="@string/role_call_redirection_description"
416        exclusive="true"
417        label="@string/role_call_redirection_label"
418        overrideUserWhenGranting="true"
419        requestDescription="@string/role_call_redirection_request_description"
420        requestTitle="@string/role_call_redirection_request_title"
421        shortLabel="@string/role_call_redirection_short_label"
422        showNone="true">
423        <required-components>
424            <service permission="android.permission.BIND_CALL_REDIRECTION_SERVICE">
425                <intent-filter>
426                    <action name="android.telecom.CallRedirectionService" />
427                </intent-filter>
428            </service>
429        </required-components>
430    </role>
431
432    <!--- @see android.telecom.CallScreeningService -->
433    <role
434        name="android.app.role.CALL_SCREENING"
435        defaultHolders="config_defaultCallScreening"
436        description="@string/role_call_screening_description"
437        exclusive="true"
438        label="@string/role_call_screening_label"
439        overrideUserWhenGranting="true"
440        requestDescription="@string/role_call_screening_request_description"
441        requestTitle="@string/role_call_screening_request_title"
442        shortLabel="@string/role_call_screening_short_label"
443        showNone="true">
444        <required-components>
445            <service permission="android.permission.BIND_SCREENING_SERVICE">
446                <intent-filter>
447                    <action name="android.telecom.CallScreeningService" />
448                </intent-filter>
449            </service>
450        </required-components>
451        <app-op-permissions>
452            <app-op-permission name="android.permission.SYSTEM_ALERT_WINDOW" />
453        </app-op-permissions>
454    </role>
455
456    <role
457        name="android.app.role.SYSTEM_GALLERY"
458        defaultHolders="config_systemGallery"
459        exclusive="true"
460        static="true"
461        systemOnly="true"
462        visible="false">
463        <permissions>
464            <permission-set name="storage" />
465            <permission name="android.permission.ACCESS_MEDIA_LOCATION" />
466            <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND" minSdkVersion="31" />
467        </permissions>
468        <app-ops>
469            <app-op name="android:write_media_images" mode="allowed" />
470            <app-op name="android:write_media_video" mode="allowed" />
471        </app-ops>
472    </role>
473
474    <role
475        name="android.app.role.SYSTEM_AUTOMOTIVE_CLUSTER"
476        behavior="SystemAutomotiveClusterRoleBehavior"
477        defaultHolders="config_systemAutomotiveCluster"
478        exclusive="true"
479        minSdkVersion="31"
480        static="true"
481        systemOnly="true"
482        visible="false">
483        <permissions>
484            <permission name="android.permission.ANSWER_PHONE_CALLS" />
485            <permission name="android.permission.READ_CALL_LOG" />
486            <permission name="android.permission.READ_CONTACTS" />
487            <permission name="android.car.permission.CAR_ENERGY"/>
488        </permissions>
489    </role>
490
491    <role
492        name="android.app.role.COMPANION_DEVICE_WATCH"
493        behavior="CompanionDeviceWatchRoleBehavior"
494        description="@string/role_watch_description"
495        exclusive="false"
496        minSdkVersion="31"
497        systemOnly="false"
498        visible="false">
499        <permissions>
500            <permission-set name="calendar" />
501            <permission-set name="phone" />
502            <permission-set name="sms" />
503            <permission-set name="contacts" />
504            <permission-set name="nearby_devices" />
505        </permissions>
506        <app-op-permissions>
507            <app-op-permission name="android.permission.MANAGE_ONGOING_CALLS" />
508            <app-op-permission name="android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER" />
509        </app-op-permissions>
510    </role>
511
512    <role
513        name="android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION"
514        defaultHolders="config_systemAutomotiveProjection"
515        exclusive="false"
516        minSdkVersion="31"
517        static="true"
518        systemOnly="true"
519        visible="false">
520        <permissions>
521            <permission-set name="microphone" />
522            <permission-set name="location" />
523            <permission-set name="nearby_devices" />
524            <permission name="android.permission.CALL_PHONE" />
525            <permission name="android.permission.READ_CALENDAR" />
526            <permission name="android.permission.READ_CALL_LOG" />
527            <permission name="android.permission.READ_CONTACTS" />
528            <permission name="android.permission.READ_PHONE_STATE" />
529            <permission name="android.permission.RECEIVE_SMS" />
530            <permission name="android.permission.SEND_SMS" />
531        </permissions>
532    </role>
533
534    <role
535        name="android.app.role.SYSTEM_SHELL"
536        behavior="SystemShellRoleBehavior"
537        defaultHolders="config_systemShell"
538        exclusive="true"
539        minSdkVersion="31"
540        static="true"
541        systemOnly="true"
542        visible="false">
543        <permissions>
544            <!-- Used for CTS testing -->
545            <permission name="android.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE" />
546            <permission name="android.permission.PERFORM_IMS_SINGLE_REGISTRATION" />
547            <permission name="android.permission.BACKGROUND_CAMERA" />
548            <permission name="android.permission.RECORD_BACKGROUND_AUDIO" />
549            <permission name="android.permission.BYPASS_ROLE_QUALIFICATION" />
550            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" />
551            <permission name="android.permission.MANAGE_SENSOR_PRIVACY" />
552            <permission name="android.permission.READ_GLOBAL_APP_SEARCH_DATA" />
553        </permissions>
554    </role>
555
556    <role
557        name="android.app.role.SYSTEM_CONTACTS"
558        defaultHolders="config_systemContacts"
559        exclusive="true"
560        minSdkVersion="31"
561        static="true"
562        systemOnly="true"
563        visible="false">
564        <permissions>
565            <permission name="android.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE" />
566        </permissions>
567    </role>
568
569    <role
570        name="android.app.role.SYSTEM_SPEECH_RECOGNIZER"
571        allowBypassingQualification="true"
572        defaultHolders="config_systemSpeechRecognizer"
573        exclusive="true"
574        minSdkVersion="31"
575        static="true"
576        systemOnly="true"
577        visible="false">
578        <permissions>
579            <permission name="android.permission.RECORD_AUDIO" />
580            <permission name="android.permission.UPDATE_APP_OPS_STATS" />
581        </permissions>
582        <required-components>
583            <service>
584                <intent-filter>
585                    <action name="android.speech.RecognitionService" />
586                </intent-filter>
587            </service>
588        </required-components>
589    </role>
590
591    <role
592        name="android.app.role.SYSTEM_WIFI_COEX_MANAGER"
593        defaultHolders="config_systemWifiCoexManager"
594        exclusive="true"
595        minSdkVersion="31"
596        static="true"
597        systemOnly="true"
598        visible="false">
599        <permissions>
600            <permission name="android.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS" />
601            <permission name="android.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS" />
602        </permissions>
603    </role>
604
605    <role
606        name="android.app.role.SYSTEM_WELLBEING"
607        defaultHolders="config_systemWellbeing"
608        exclusive="true"
609        minSdkVersion="31"
610        static="true"
611        systemOnly="true"
612        visible="false" >
613        <permissions>
614            <permission name="android.permission.ACCESS_INSTANT_APPS"/>
615            <permission name="android.permission.SUSPEND_APPS"/>
616            <permission name="android.permission.SYSTEM_APPLICATION_OVERLAY"/>
617        </permissions>
618    </role>
619
620    <!---
621      ~ A role for the notification handler on TV devices.
622      ~ Note: on TV devices that have the Dashboard screen, the holder for this role is responsible
623      ~ for it, which is why it needs OBSERVE_SENSOR_PRIVACY permission (the Dashboard displays
624      ~ the state of the privacy sensors).
625      -->
626    <role
627        name="android.app.role.SYSTEM_TELEVISION_NOTIFICATION_HANDLER"
628        behavior="TelevisionRoleBehavior"
629        defaultHolders="config_systemTelevisionNotificationHandler"
630        exclusive="true"
631        minSdkVersion="31"
632        static="true"
633        systemOnly="true"
634        visible="false">
635        <permissions>
636            <permission name="android.permission.SYSTEM_APPLICATION_OVERLAY" />
637        </permissions>
638    </role>
639
640    <!---
641        A role for the system package that is allowed to create CompanionDeviceManager associations
642        based on user consent to allow the associated app to manage the associated device.
643    -->
644    <role
645        name="android.app.role.SYSTEM_COMPANION_DEVICE_PROVIDER"
646        defaultHolders="config_systemCompanionDeviceProvider"
647        exclusive="true"
648        minSdkVersion="31"
649        static="true"
650        systemOnly="true"
651        visible="false" >
652        <permissions>
653            <permission name="android.permission.ASSOCIATE_COMPANION_DEVICES"/>
654        </permissions>
655    </role>
656
657    <!---
658      ~ A role for the system package that provides privacy-preserving intelligent processor for
659      ~ system UI features.
660      ~
661      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
662      ~ section "9.8.6 Content Capture".
663      ~ Example link for Android 11:
664      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
665      ~
666      ~ In addition, packages MUST NOT:
667      ~ - Request INTERNET permission. Instead packages MUST access the internet through
668      ~   well-defined APIs in an open source project.
669      ~ - Perform direct binds to other applications, except the following system packages:
670      ~   - Bluetooth
671      ~   - Contacts
672      ~   - Media
673      ~   - Telephony
674      ~   - System UI
675      ~   - Component providing internet APIs (see above)
676      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
677      ~   system config.
678      -->
679    <role
680        name="android.app.role.SYSTEM_UI_INTELLIGENCE"
681        defaultHolders="config_systemUiIntelligence"
682        exclusive="true"
683        minSdkVersion="31"
684        static="true"
685        systemOnly="true"
686        visible="false">
687        <permissions>
688            <permission name="android.permission.ACCESS_SHORTCUTS" />
689            <permission name="android.permission.BLUETOOTH_CONNECT" />
690            <permission name="android.permission.BLUETOOTH_SCAN" />
691            <permission name="android.permission.MANAGE_APP_PREDICTIONS" />
692            <permission name="android.permission.UNLIMITED_SHORTCUTS_API_CALLS" />
693            <permission name="android.permission.MANAGE_SEARCH_UI" />
694            <permission name="android.permission.READ_EXTERNAL_STORAGE" />
695            <permission name="android.permission.READ_PEOPLE_DATA" />
696            <permission name="android.permission.READ_GLOBAL_APP_SEARCH_DATA" />
697        </permissions>
698    </role>
699
700    <!---
701      ~ A role for the system package that provides on-device intelligent processor for ambient
702      ~ audio.
703      ~
704      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
705      ~ section "9.8.6 Content Capture".
706      ~ Example link for Android 11:
707      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
708      ~
709      ~ In addition, packages MUST NOT:
710      ~ - Request INTERNET permission. Instead packages MUST access the internet through
711      ~   well-defined APIs in an open source project.
712      ~ - Perform direct binds to other applications, except the following system packages:
713      ~   - Bluetooth
714      ~   - Contacts
715      ~   - Media
716      ~   - Telephony
717      ~   - System UI
718      ~   - Component providing internet APIs (see above)
719      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
720      ~   system config.
721      -->
722    <role
723        name="android.app.role.SYSTEM_AMBIENT_AUDIO_INTELLIGENCE"
724        defaultHolders="config_systemAmbientAudioIntelligence"
725        exclusive="true"
726        minSdkVersion="31"
727        static="true"
728        systemOnly="true"
729        visible="false">
730        <permissions>
731            <permission name="android.permission.CAPTURE_AUDIO_OUTPUT" />
732            <permission name="android.permission.CAPTURE_MEDIA_OUTPUT" />
733            <permission name="android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT" />
734            <permission name="android.permission.MODIFY_AUDIO_ROUTING" />
735            <permission name="android.permission.RECORD_AUDIO" />
736            <permission name="android.permission.CAPTURE_AUDIO_HOTWORD" />
737            <permission name="android.permission.EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS" />
738            <permission name="android.permission.MANAGE_SOUND_TRIGGER" />
739            <permission name="android.permission.LOCATION_HARDWARE" />
740            <permission name="android.permission.MANAGE_MUSIC_RECOGNITION" />
741            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" />
742        </permissions>
743    </role>
744
745    <!---
746      ~ A role for the system package that provides on-device intelligent processor for audio.
747      ~
748      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
749      ~ section "9.8.6 Content Capture".
750      ~ Example link for Android 11:
751      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
752      ~
753      ~ In addition, packages MUST NOT:
754      ~ - Request INTERNET permission. Instead packages MUST access the internet through
755      ~   well-defined APIs in an open source project.
756      ~ - Perform direct binds to other applications, except the following system packages:
757      ~   - Bluetooth
758      ~   - Contacts
759      ~   - Media
760      ~   - Telephony
761      ~   - System UI
762      ~   - Component providing internet APIs (see above)
763      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
764      ~   system config.
765      -->
766    <role
767        name="android.app.role.SYSTEM_AUDIO_INTELLIGENCE"
768        defaultHolders="config_systemAudioIntelligence"
769        exclusive="true"
770        minSdkVersion="31"
771        static="true"
772        systemOnly="true"
773        visible="false">
774        <permissions>
775            <permission name="android.permission.CAPTURE_AUDIO_OUTPUT" />
776            <permission name="android.permission.CAPTURE_MEDIA_OUTPUT" />
777            <permission name="android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT" />
778            <permission name="android.permission.CONTROL_INCALL_EXPERIENCE" />
779            <permission name="android.permission.MODIFY_AUDIO_ROUTING" />
780            <permission name="android.permission.MODIFY_PHONE_STATE" />
781            <permission name="android.permission.RECORD_AUDIO" />
782            <permission name="android.permission.SYSTEM_APPLICATION_OVERLAY" />
783        </permissions>
784    </role>
785
786    <!---
787      ~ A role for the system package that provides on-device intelligent processor for
788      ~ notifications.
789      ~
790      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
791      ~ section "9.8.6 Content Capture".
792      ~ Example link for Android 11:
793      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
794      ~
795      ~ In addition, packages MUST NOT:
796      ~ - Request INTERNET permission. Instead packages MUST access the internet through
797      ~   well-defined APIs in an open source project.
798      ~ - Perform direct binds to other applications, except the following system packages:
799      ~   - Bluetooth
800      ~   - Contacts
801      ~   - Media
802      ~   - Telephony
803      ~   - System UI
804      ~   - Component providing internet APIs (see above)
805      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
806      ~   system config.
807      -->
808    <role
809        name="android.app.role.SYSTEM_NOTIFICATION_INTELLIGENCE"
810        defaultHolders="config_systemNotificationIntelligence"
811        exclusive="true"
812        minSdkVersion="31"
813        static="true"
814        systemOnly="true"
815        visible="false">
816        <permissions>
817            <permission name="android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE" />
818            <permission name="android.permission.SYSTEM_APPLICATION_OVERLAY" />
819        </permissions>
820    </role>
821
822    <!---
823      ~ A role for the system package that provides on-device intelligent processor for text.
824      ~
825      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
826      ~ section "9.8.6 Content Capture".
827      ~ Example link for Android 11:
828      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
829      ~
830      ~ In addition, packages MUST NOT:
831      ~ - Request INTERNET permission. Instead packages MUST access the internet through
832      ~   well-defined APIs in an open source project.
833      ~ - Perform direct binds to other applications, except the following system packages:
834      ~   - Bluetooth
835      ~   - Contacts
836      ~   - Media
837      ~   - Telephony
838      ~   - System UI
839      ~   - Component providing internet APIs (see above)
840      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
841      ~   system config.
842      -->
843    <role
844        name="android.app.role.SYSTEM_TEXT_INTELLIGENCE"
845        defaultHolders="config_systemTextIntelligence"
846        exclusive="true"
847        minSdkVersion="31"
848        static="true"
849        systemOnly="true"
850        visible="false">
851        <permissions>
852            <permission name="android.permission.MANAGE_UI_TRANSLATION" />
853            <permission name="android.permission.SYSTEM_APPLICATION_OVERLAY" />
854        </permissions>
855    </role>
856
857    <!---
858      ~ A role for the system package that provides on-device intelligent processor for visual
859      ~ features.
860      ~
861      ~ A package holding this role MUST comply with requirements outlined in the Android CDD
862      ~ section "9.8.6 Content Capture".
863      ~ Example link for Android 11:
864      ~ https://source.android.com/compatibility/11/android-11-cdd#9_8_6_content_capture
865      ~
866      ~ In addition, packages MUST NOT:
867      ~ - Request INTERNET permission. Instead packages MUST access the internet through
868      ~   well-defined APIs in an open source project.
869      ~ - Perform direct binds to other applications, except the following system packages:
870      ~   - Bluetooth
871      ~   - Contacts
872      ~   - Media
873      ~   - Telephony
874      ~   - System UI
875      ~   - Component providing internet APIs (see above)
876      ~   To achieve this packages MUST set up explicit <allow-association> configuration in the
877      ~   system config.
878      -->
879    <role
880        name="android.app.role.SYSTEM_VISUAL_INTELLIGENCE"
881        defaultHolders="config_systemVisualIntelligence"
882        exclusive="true"
883        minSdkVersion="31"
884        static="true"
885        systemOnly="true"
886        visible="false">
887        <permissions>
888            <permission name="android.permission.CAMERA" />
889            <permission name="android.permission.SYSTEM_CAMERA" />
890            <permission name="android.permission.UPDATE_DEVICE_STATS" />
891            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" />
892        </permissions>
893    </role>
894
895    <!---
896      ~ A role for the system package that serves as the activity recognizer on the device.
897      ~ This is the application that provides the data behind the activity recognition
898      ~ runtime permission.
899      -->
900    <role
901        name="android.app.role.SYSTEM_ACTIVITY_RECOGNIZER"
902        allowBypassingQualification="true"
903        defaultHolders="config_systemActivityRecognizer"
904        exclusive="false"
905        static="true"
906        systemOnly="true"
907        visible="false">
908        <required-components>
909            <service>
910                <intent-filter>
911                    <action name="android.intent.action.ACTIVITY_RECOGNIZER" />
912                </intent-filter>
913            </service>
914        </required-components>
915    </role>
916
917    <!---
918      ~ A role for the system UI package.
919      -->
920    <role
921        name="android.app.role.SYSTEM_UI"
922        defaultHolders="config_systemUi"
923        exclusive="true"
924        minSdkVersion="31"
925        static="true"
926        systemOnly="true"
927        visible="false">
928        <permissions>
929            <permission name="android.permission.MANAGE_SENSOR_PRIVACY" />
930            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" />
931        </permissions>
932    </role>
933
934    <!---
935      ~ A role for the package responsible for interacting with a TV remote.
936      -->
937    <role
938        name="android.app.role.SYSTEM_TELEVISION_REMOTE_SERVICE"
939        behavior="TelevisionRoleBehavior"
940        defaultHolders="config_systemTelevisionRemoteService"
941        exclusive="true"
942        minSdkVersion="31"
943        static="true"
944        systemOnly="true"
945        visible="false">
946        <permissions>
947            <permission name="android.permission.OBSERVE_SENSOR_PRIVACY" />
948        </permissions>
949    </role>
950
951</roles>
952