<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (C) 2018 The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.car.notification">
    <!-- Permission to show display overlay window for heads-up notifications -->
    <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW"/>
    <!-- Permission to get the current user id to cancel a notification -->
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
    <!-- Permission to get the current user id to cancel all notifications -->
    <uses-permission android:name="android.permission.MANAGE_USERS"/>
    <!-- Permission to get status if a user in on call -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <!-- Permission to talk to the Status bar service which proxies the calls to remove
                notifications to the notification service -->
    <uses-permission android:name="android.permission.STATUS_BAR_SERVICE"/>
    <!-- Permission to start a voice interaction service -->
    <uses-permission android:name="android.permission.ACCESS_VOICE_INTERACTION_SERVICE"/>
    <!-- Permission to check the ongoing foreground applications to throttle HeadsUp Notifications
    when allowlist applications are in foreground -->
    <uses-permission android:name="android.permission.MANAGE_ACTIVITY_TASKS"/>

    <!-- Permission to query application package info to determine if sender package is a
            system or privileged app -->
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

    <!-- Permission to send notification when HUN is suppressed by the system -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

    <!-- Permission needed to collapse panels using StatusBarService -->
    <uses-permission android:name="android.permission.STATUS_BAR"/>

    <application android:name=".NotificationApplication"
                 android:label="@string/app_label"
                 android:icon="@mipmap/ic_launcher">
        <activity android:name=".CarNotificationCenterActivity"
                  android:theme="@style/Theme.DeviceDefault.NoActionBar.Notification"
                  android:launchMode="singleInstance"
                  android:noHistory="true"
                  android:exported="true"
                  android:stateNotNeeded="true"
                  android:excludeFromRecents="true">
            <meta-data android:name="distractionOptimized"
                       android:value="true"/>
        </activity>
        <service android:name=".CarNotificationListener"
                 android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
                 android:directBootAware="true"
                 android:exported="true">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService"/>
            </intent-filter>
        </service>
    </application>
</manifest>
