blob: 31f8b2703c0ebe89b1c28072c2d42cccc735247b [file] [log] [blame]
Chris Wrenf9536642014-04-17 10:01:54 -04001/*
2* Copyright (C) 2014 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.server.notification;
18
19import android.content.Context;
20
21/**
22 * Extracts signals that will be useful to the {@link NotificationComparator} and caches them
Chris Wren333a61c2014-05-28 16:40:57 -040023 * on the {@link NotificationRecord} object. These annotations will
Chris Wrenf9536642014-04-17 10:01:54 -040024 * not be passed on to {@link android.service.notification.NotificationListenerService}s.
25 */
26public interface NotificationSignalExtractor {
27
28 /** One-time initialization. */
Chris Wren5eab2b72015-06-16 13:56:22 -040029 public void initialize(Context context, NotificationUsageStats usageStats);
Chris Wrenf9536642014-04-17 10:01:54 -040030
31 /**
32 * Called once per notification that is posted or updated.
33 *
34 * @return null if the work is done, or a future if there is more to do. The
Chris Wren470c1ac2014-05-21 15:28:10 -040035 * {@link RankingReconsideration} will be run on a worker thread, and if notifications
36 * are re-ordered by that execution, the {@link NotificationManagerService} may send order
37 * update events to the {@link android.service.notification.NotificationListenerService}s.
Chris Wrenf9536642014-04-17 10:01:54 -040038 */
Chris Wren470c1ac2014-05-21 15:28:10 -040039 public RankingReconsideration process(NotificationRecord notification);
Chris Wrenf9536642014-04-17 10:01:54 -040040
Chris Wren54bbef42014-07-09 18:37:56 -040041 /**
42 * Called whenever the {@link RankingConfig} changes.
43 *
44 * @param config information about which signals are important.
45 */
46 void setConfig(RankingConfig config);
Chris Wrenf9536642014-04-17 10:01:54 -040047}