blob: fac9e98a6caf1b3a183e6f6761af0522bb9b4c7c [file] [log] [blame]
/*
* Copyright (C) 2017 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.
*/
package com.android.systemui.plugins;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
import com.android.systemui.plugins.NotificationListenerController.NotificationProvider;
import com.android.systemui.plugins.annotations.DependsOn;
import com.android.systemui.plugins.annotations.ProvidesInterface;
@ProvidesInterface(action = NotificationListenerController.ACTION,
version = NotificationListenerController.VERSION)
@DependsOn(target = NotificationProvider.class)
public interface NotificationListenerController extends Plugin {
String ACTION = "com.android.systemui.action.PLUGIN_NOTIFICATION_ASSISTANT";
int VERSION = 1;
void onListenerConnected(NotificationProvider provider);
default boolean onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
return false;
}
default boolean onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap) {
return false;
}
default StatusBarNotification[] getActiveNotifications(
StatusBarNotification[] activeNotifications) {
return activeNotifications;
}
default RankingMap getCurrentRanking(RankingMap currentRanking) {
return currentRanking;
}
@ProvidesInterface(version = NotificationProvider.VERSION)
interface NotificationProvider {
int VERSION = 1;
// Methods to get info about current notifications
StatusBarNotification[] getActiveNotifications();
RankingMap getRankingMap();
// Methods to notify sysui of changes to notification list.
void addNotification(StatusBarNotification sbn);
void removeNotification(StatusBarNotification sbn);
void updateRanking();
}
}