Merge "Notification filter changes." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cc52409625
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
package com.android.settings.applications;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
|
||||
import com.android.settings.notification.NotificationBackend;
|
||||
import com.android.settings.notification.NotificationBackend.AppRow;
|
||||
@@ -70,4 +72,55 @@ public class AppStateNotificationBridge extends AppStateBaseBridge {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public static final AppFilter FILTER_APP_NOTIFICATION_SILENCED = new AppFilter() {
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(AppEntry info) {
|
||||
if (info == null) {
|
||||
return false;
|
||||
}
|
||||
AppRow row = (AppRow) info.extraInfo;
|
||||
return row.appImportance > NotificationListenerService.Ranking.IMPORTANCE_NONE
|
||||
&& row.appImportance < NotificationListenerService.Ranking.IMPORTANCE_DEFAULT;
|
||||
}
|
||||
};
|
||||
|
||||
public static final AppFilter FILTER_APP_NOTIFICATION_PRIORITY = new AppFilter() {
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(AppEntry info) {
|
||||
return info.extraInfo != null && ((AppRow) info.extraInfo).appBypassDnd;
|
||||
}
|
||||
};
|
||||
|
||||
public static final AppFilter FILTER_APP_NOTIFICATION_HIDE_SENSITIVE = new AppFilter() {
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(AppEntry info) {
|
||||
return info.extraInfo != null
|
||||
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_PRIVATE;
|
||||
}
|
||||
};
|
||||
|
||||
public static final AppFilter FILTER_APP_NOTIFICATION_HIDE_ALL = new AppFilter() {
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(AppEntry info) {
|
||||
return info.extraInfo != null
|
||||
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_SECRET;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user