ZRC Broadcast Intent Interfaces for LED Enclosure Integration
1. INTRODUCTION
Some partners' device has a built-in LED. The LED can indicate the audio usage and incoming invitation when ZRC as Controller mode and indicate the Zoom Room's state when as Scheduling Display. This doc defines Intent interfaces for build-in LEDs to indicate the Zoom Room's state.
ZRC starts support from 4.6.0 (40654.1216)
2. INTERFACE DEFINITION
2.1 Overall Architecture
According to the meeting industry's practice, the LEDs may have these behaviors to indicate the Zoom Room's state.
- For the Zoom Rooms Controller:
- Incoming an invitation (meeting or phone calls)
The LED turns green flashing
- In-call state
The LED turns green to indicate the microphone usage
- Mute state (mic is muted when call on hold or in waiting room)
The LED turns red to indicate the microphone's muted
- Not in used
The LED turns off to indicate the Zoom Room is idle
- Incoming an invitation (meeting or phone calls)
- For Scheduling Display:
- Offline (Scheduling Display disconnected with the room)
The LED turns off
- Busy (The Zoom Room is in used)
The LED turns red
- Available (The Zoom Room is available)
The LED turns green
- Offline (Scheduling Display disconnected with the room)
2.2 Interface for Controller
These APIs are only sent by ZRC when working as a Controller.
2.2.1 Incoming Call
Indicate the incoming call state, this time ZR will play some ringtone.
Intent Action
- ZRIntentDefinitions.ACTION_INCOMING_CALL_STATE_CHANGED="us.zoom.zrc.action.INCOMING_CALL_STATE_CHANGE"
Intent Extras
- "state" — the incoming state, 1 has incoming calls, otherwise 0 (include decline or accepted by the user)
Will send when
- Receive a SIP call invitation
- Receive a Zoom Meeting invitation
- The user accepts or declines the incoming calls
More info The LED may turn green flashing color when the state is "1", otherwise turns off.
This API currently used by Yealink CP960
2.2.2 In-Call state
Indicate the in-call state (the in-call means SIP/PSTN phone call, local presentation, and meeting)
Intent Action
- ZRIntentDefinitions.ACTION_IN_CALL_STATE_CHANGED="us.zoom.zrc.action.IN_CALL_STATE_CHANGED"
Intent Extras
- "state" — the incoming state
- 0 — idle
- 1 — in the call
Will send when
- Make a PSTN call
- Make a SIP call
- Join or Make a Zoom Meeting
- Local Presentation for
- Desktop share with Zoom
- AirPlay Share for iPhone/iPad/Mac
- HDMI Share
More info The LED may turn green when the state is "1", otherwise turns off.
This API currently used by Yealink CP960, Yealink also uses this API to prepare audio devices for meeting.
2.2.3 Mute/unmute microphone
Indicate the microphone's mute/unmute state
Intent Action
- ZRIntentDefinitions.ACTION_MIC_MUTE_STATE_CHANGED="us.zoom.zrc.action.MIC_MUTE_STATE_CHANGED"
Intent Extras
- "state" — the mute/unmute state
- 0 — unmute
- 1 — mute
Will send when
- Mute microphone in meeting
- Unmute microphone after muted
More info The LED may turn red when the state is "1", otherwise follow the in-call state.
2.3 Interface for Scheduling Display
This API is only sent by ZRC when working as a Scheduling Display.
Intent Action
- ZRIntentDefinitions.ACTION_SCHEDULING_DISPLAY_STATE_CHANGED="us.zoom.zrc.action.SCHEDULING_DISPLAY_STATE_CHANGED"
Intent Extras
- "state" — state of this room
- 0 — offline
- 1 — available
- 2 — busy
Will send when
- The Zoom Room's state changed
More info The LED turns green when the state is "1", turns red when it's "2", and turns off when it's "0" to indicate offline.
2.4 Interface for Query
Send from partners' devices, when ZRC received this broadcast, ZRC will resend states with intents described before.
Intent Action
- ZRIntentDefinitions.ACTION_QUERY_ZOOM_INFO="us.zoom.zrc.action.QUERY_ZOOM_INFO"
Intent Extras
- "query_type" — Which interface needs ZRC to resend.
- 0 — for All
- 1 — for pairing state (Not included in this doc)
- 2 — for incoming call state
- 3 — for in-call state
- 4 — for the microphone's mute/unmute state
- 5 — for the Scheduling Display's state (busy/available)
More Info This will be sent when partner devices want to know the Zoom Room's state.
3. Demo Code
Here is the demo code for handling LED intents
private class ZoomRoomsLedReceiver extends BroadcastReceiver {
// Handle LED flash with timer. Can be replaced by your own method.
private GreenFlashHandler greenFlashHandler = new GreenFlashHandler();
private boolean inCall;
private boolean incomingCall;
private boolean micMuted;
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
int state = intent.getIntExtra(ZRCStateIntents.EXTRA_STATE, -1);
Log.i("ZoomRoomsLED", "received: " + action + ", state=" + state);
if ("us.zoom.zrc.action.INCOMING_CALL_STATE_CHANGED".equals(action)) {
incomingCall = (1 == state);
handleLed4Controller();
} else if ("us.zoom.zrc.action.IN_CALL_STATE_CHANGED".equals(action)) {
inCall = (1 == state);
handleLed4Controller();
} else if ("us.zoom.zrc.action.MIC_MUTE_STATE_CHANGED".equals(action)) {
micMuted = (1 == state);
handleLed4Controller();
} else if ("us.zoom.zrc.action.SCHEDULING_DISPLAY_STATE_CHANGED".equals(action)) {
handleLed4SchedulingDisplay(state);
}
}
private void handleLed4Controller() {
if (incomingCall) {
greenFlashHandler.start();
} else {
// Will turn LED off
greenFlashHandler.stop();
if (micMuted) {
turnLedRed();
} else if (inCall) {
turnLedGreen();
} else {
turnLedOff();
}
}
}
private void handleLed4SchedulingDisplay(int state) {
if (1 == state) {
// Available
turnLedGreen();
} else if (2 == state) {
// Busy
turnLedRed();
} else {
// Offline
turnLedOff();
}
}
void turnLedRed() {
Log.d("ZoomRoomsLED", "turn LED red");
// Turn LED red
}
void turnLedGreen() {
Log.d("ZoomRoomsLED", "turn LED green");
// Turn LED green
}
void turnLedOff() {
Log.d("ZoomRoomsLED", "turn LED off");
// Turn LED off
}
}
NOTE: It's better to use the context-registered receiver, as the document mentioned:
If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for implicit broadcasts (broadcasts that do not target your app specifically), except for a few implicit broadcasts that are exempted from that restriction. In most cases, you can use scheduled jobs instead.
APPENDIX A - GLOSSARY
- ZRC — Zoom Rooms Controller, the Android Zoom Rooms App.