1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2022 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<manifest xmlns:android="http://schemas.android.com/apk/res/android"
18          package="com.android.safetycenter.testing">
19    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
20    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
21    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
22
23    <application>
24        <!-- The receiver is marked as disabled and is manually enabled in the tests for the desired
25             user(s); as it does not support multi-users calls for now. -->
26        <receiver android:name=".SafetySourceReceiver"
27                  android:enabled="false"
28                  android:exported="false">
29            <intent-filter>
30                <action android:name="android.safetycenter.action.SAFETY_CENTER_ENABLED_CHANGED"/>
31                <action android:name="android.safetycenter.action.REFRESH_SAFETY_SOURCES"/>
32                <action android:name="com.android.safetycenter.testing.action.RESOLVE_ACTION"/>
33                <action android:name="com.android.safetycenter.testing.action.DISMISS_ISSUE"/>
34            </intent-filter>
35        </receiver>
36
37        <service android:name=".SafetySourceReceiver$ForegroundService"
38                 android:foregroundServiceType="dataSync"
39                 android:exported="false"/>
40
41        <activity android:name=".TestActivity"
42                  android:theme="@style/OptOutEdgeToEdgeEnforcement"
43                  android:exported="false">
44            <intent-filter android:priority="-1">
45                <action android:name="com.android.safetycenter.testing.action.TEST_ACTIVITY"/>
46                <category android:name="android.intent.category.DEFAULT"/>
47            </intent-filter>
48          </activity>
49
50        <!-- Create an alias at higher priority, disabled.  We have seen flakes where implicit
51        intents for TEST_ACTIVITY fail owing to multiple receivers, perhaps due to an older
52        CTS APK hanging around.  We turn this component on (and off in tidyup) in tests, in
53        the hope of only resolving to the actively running test in these cases. -->
54        <activity-alias android:name=".TestActivityPriority"
55                        android:targetActivity=".TestActivity"
56                        android:enabled="false"
57                        android:exported="false">
58            <intent-filter android:priority="0">
59                <action android:name="com.android.safetycenter.testing.action.TEST_ACTIVITY"/>
60                <category android:name="android.intent.category.DEFAULT"/>
61            </intent-filter>
62        </activity-alias>
63
64        <activity-alias android:name=".TestActivityExported"
65                        android:targetActivity=".TestActivity"
66                        android:exported="true">
67            <intent-filter>
68                <action android:name="com.android.safetycenter.testing.action.TEST_ACTIVITY_EXPORTED"/>
69                <category android:name="android.intent.category.DEFAULT"/>
70            </intent-filter>
71        </activity-alias>
72
73        <service android:name=".TestNotificationListener"
74            android:label="TestNotificationListener"
75            android:exported="false"
76            android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
77            <intent-filter>
78                <action android:name="android.service.notification.NotificationListenerService" />
79            </intent-filter>
80        </service>
81    </application>
82</manifest>
83