FileDocCategorySizeDatePackage
NotificationIntrusivenessExtractor.javaAPI DocAndroid 5.1 API2614Thu Mar 12 22:22:42 GMT 2015com.android.server.notification

NotificationIntrusivenessExtractor

public class NotificationIntrusivenessExtractor extends Object implements NotificationSignalExtractor
This {@link com.android.server.notification.NotificationSignalExtractor} noticies noisy notifications and marks them to get a temporary ranking bump.

Fields Summary
private static final String
TAG
private static final boolean
DBG
private static final long
HANG_TIME_MS
Length of time (in milliseconds) that an intrusive or noisy notification will stay at the top of the ranking order, before it falls back to its natural position.
Constructors Summary
Methods Summary
public voidinitialize(android.content.Context ctx)


        
        if (DBG) Slog.d(TAG, "Initializing  " + getClass().getSimpleName() + ".");
    
public RankingReconsiderationprocess(NotificationRecord record)

        if (record == null || record.getNotification() == null) {
            if (DBG) Slog.d(TAG, "skipping empty notification");
            return null;
        }

        final Notification notification = record.getNotification();
        if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 ||
                notification.vibrate != null ||
                (notification.defaults & Notification.DEFAULT_SOUND) != 0 ||
                notification.sound != null ||
                notification.fullScreenIntent != null) {
            record.setRecentlyIntusive(true);
        }

        return new RankingReconsideration(record.getKey(), HANG_TIME_MS) {
            @Override
            public void work() {
                // pass
            }

            @Override
            public void applyChangesLocked(NotificationRecord record) {
                record.setRecentlyIntusive(false);
            }
        };
    
public voidsetConfig(RankingConfig config)

        // ignore: config has no relevant information yet.