Prd/components/dialer-patch/patches/0009-notification-channel-manager-keep-helpdesk-channel.patch
Lucy Doupalů be9f14ce34 Helpdesk - operator console + patched GrapheneOS Dialer for call handling
A small helpdesk system: an office Pixel running a patched GrapheneOS Dialer
answers technician calls, records both call legs as separate channels, and a
Ruby backend transcribes them through Whisper and files an AI summary against
the caller.

Squashed to a single commit for sharing. No credentials are included; secrets
live outside the repo in /etc/helpdesk/env on the server or a gitignored
.claude/env.local locally. See .claude/env.local.example for the shape.

Start at README.md, then docs/architecture.md.
2026-07-27 18:50:32 +02:00

32 lines
1.8 KiB
Diff

diff --git a/java/com/android/dialer/notification/NotificationChannelManager.java b/java/com/android/dialer/notification/NotificationChannelManager.java
index 790aac36f..122a14014 100644
--- a/java/com/android/dialer/notification/NotificationChannelManager.java
+++ b/java/com/android/dialer/notification/NotificationChannelManager.java
@@ -75,7 +75,14 @@ public final class NotificationChannelManager {
// re-inserts the SIM.
for (String existingChannelId : existingChannelIds) {
if (!desiredChannelIds.contains(existingChannelId)) {
- notificationManager.deleteNotificationChannel(existingChannelId);
+ try {
+ notificationManager.deleteNotificationChannel(existingChannelId);
+ } catch (SecurityException e) {
+ // A channel backing a live foreground service cannot be deleted. Never let cleanup of a
+ // stale channel take down the calling process (this runs in incallui, next to the recorder).
+ LogUtil.w("NotificationChannelManager.initChannels",
+ "could not delete channel " + existingChannelId + ": " + e);
+ }
}
}
@@ -111,6 +118,11 @@ public final class NotificationChannelManager {
result.add(NotificationChannelId.MISSED_CALL);
result.add(NotificationChannelId.DEFAULT);
result.addAll(VoicemailChannelUtils.getAllChannelIds(context));
+ // helpdesk: the always-on command service (com.android.dialer.helpdesk.HelpdeskCommandService) owns
+ // this channel for its foreground-service notification. It must be in the desired set: deleting a
+ // channel that backs a live FGS throws SecurityException, which would crash whichever process runs
+ // initChannels (observed: com.android.incallui, killing CallRecorderServiceV2 with it).
+ result.add("helpdesk_command_channel");
return result;
}