forked from Blendman974/faceclaw
Add notification filters
This commit is contained in:
1 parent
5c3b71aeea
commit
3d39d27456
8 files changed
+205
-18
No files matched your search
@@ -1,10 +1,13 @@
|
||||
import { GrayImage } from "../graphics/image";
|
||||
import { logCurrent, spanCurrent } from "./frame-timings";
|
||||
import { toUint8Array } from "../util/array-util";
|
||||
import { rememberNotificationSources } from "./notification-sources";
|
||||
|
||||
declare const com: any;
|
||||
|
||||
const ICON_SIZE = 24;
|
||||
/** Ask the native listener for every active source, including those below the list's display limit. */
|
||||
export const ALL_NOTIFICATIONS = 0x7fffffff;
|
||||
// Backstop TTL only: the icon caches are invalidated eagerly whenever a
|
||||
// notification is posted or dismissed (see invalidateIconCaches callers), so
|
||||
// the tray is kept fresh by invalidation, not by expiry. A short TTL just
|
||||
@@ -158,7 +161,9 @@ export function readActiveNotifications(maxNotifications = 50): AndroidNotificat
|
||||
);
|
||||
const parsed = JSON.parse(json);
|
||||
if (!Array.isArray(parsed)) return [];
|
||||
return parsed.map(normalizeNotification).filter((item): item is AndroidNotification => Boolean(item));
|
||||
const notifications = parsed.map(normalizeNotification).filter((item): item is AndroidNotification => Boolean(item));
|
||||
rememberNotificationSources(notifications);
|
||||
return notifications;
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user