blob: 6d960d7b9e218603b62139c5fa4aca45b5b815c5 [file] [log] [blame]
Gus Prevasec9e1f02018-12-18 15:28:12 -05001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.systemui.car;
18
19import android.content.Context;
20
Gus Prevasec9e1f02018-12-18 15:28:12 -050021import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
Ned Burnsf81c4c42019-01-07 14:10:43 -050022import com.android.systemui.statusbar.notification.collection.NotificationEntry;
Gus Prevasec9e1f02018-12-18 15:28:12 -050023
24/** Auto-specific implementation of {@link NotificationInterruptionStateProvider}. */
25public class CarNotificationInterruptionStateProvider extends
26 NotificationInterruptionStateProvider {
27 public CarNotificationInterruptionStateProvider(Context context) {
28 super(context);
29 }
30
31 @Override
Ned Burnsf81c4c42019-01-07 14:10:43 -050032 public boolean shouldHeadsUp(NotificationEntry entry) {
Gus Prevasec9e1f02018-12-18 15:28:12 -050033 // Because space is usually constrained in the auto use-case, there should not be a
34 // pinned notification when the shade has been expanded. Ensure this by not pinning any
35 // notification if the shade is already opened.
36 if (!getPresenter().isPresenterFullyCollapsed()) {
37 return false;
38 }
39
40 return super.shouldHeadsUp(entry);
41 }
42}