Android calls: professional incoming UI + killed-state ring reliability

Addresses on-device feedback from Increment 1:
- #2 Professional incoming screen: IncomingCallActivity redesigned — brand-
  blue backdrop, circular avatar with the caller's initial, name + call
  type, and two round icon buttons (red hang-up = Decline, green phone =
  Accept) instead of the full-screen colored buttons. New vector drawables
  ic_call_answer / ic_call_decline (also used on the notification actions).
- #1 Killed-state ring: the missed-call notification arriving while killed
  proves FCM reaches the app, so the ring (high-priority DATA) is being
  held by OEM battery management (OnePlus/Oppo Doze) until the call is over.
  Added REQUEST_IGNORE_BATTERY_OPTIMIZATIONS + a requestCallReliability()
  plugin method that prompts the "allow background activity" dialog once;
  the web calls it on Android call setup. (OEM auto-launch is a manual
  toggle with no API — guide the user.)

#3 (speaker/Bluetooth) and #4 (background audio) ride Increment 2 (native
LiveKit Android media + foreground service) — kept separate so the LiveKit
dependency can't block these UI/reliability fixes (the iOS coupling lesson).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
SravanandClaude Opus 4.8 committed 2026-09-27 15:15:18 +05:30
1 parent b60ce6cda3
commit 5cb3d0c122
7 files changed
+140 -37

No files matched your search

+3
View File
@@ -4350,6 +4350,9 @@ async function setupNativeCall(){
// token is already registered by setupNativePush — the server call-wake targets it, so no token step here.
if(!cfg || !cfg.androidCall){ console.log('[nativecall] Android native calling disabled by server — using WebView calls'); return; }
_callkitReady=true; _callWebViewMedia=true;
// Ask for a battery-optimization exemption so a killed/Dozing phone still gets the high-priority FCM
// call-wake in time to ring (OnePlus/Oppo hold it otherwise). Prompt only the first time; then just check.
try{ if(NC.requestCallReliability){ const asked=localStorage.getItem('bzcCallRelAsked'); const rel=await NC.requestCallReliability({ prompt: !asked }); localStorage.setItem('bzcCallRelAsked','1'); if(rel && rel.ignoringBatteryOptimizations===false) console.log('[nativecall] app is NOT exempt from battery optimization — killed-state ring may be delayed until this is allowed'); } }catch(_){}
} else {
// iOS CallKit: native media (the plugin owns this identity's one LiveKit connection). Flipped on once native
// media carries the audio.