How Vendor OS API works
Vendor OS Side
Vendor OS framework extension is like the Android Standard framework which is provided by the Android device partner. On our side, we will init Vendor OS's framework extension by calling Class.forName(us.zoom.zr.vendoros.VendorOSManager) to get the instance.
All the API calls are done synchronously which means that all the interfaces/apis can be called once the VendorOSManager object is returned:
mVendorOSManager = new VendorOSManager(context);
if ((mVendorOSManager.getCapability() & VendorOSManager.ZRAPI_CAP_AUDIO) != 0) {
IAudioManager mAudioManager = mVendorOSManager.getAudioManager();
...
...
}
In vendor OS, AudioManager/SystemManger/... can just run as the system service. In VendorOSManager’s implementation, your code maybe like the below snippet:
public IAudioManager getAudioManager() {
//Get your AudioManger service just like android standard service
//For example when we need system DisplayManager, we just call
//DisplayManager mDisplayManager =
//(DisplayManager)mContext.getSystemService(Context.DISPLAY_SERVICE);
return mContext.getSystemService(‘you audio service name’);
}
- The Vendor Framework extension needs to contain all the classes and interfaces defined in the Zoom Rooms Vendor API doc. If the OS does not support one feature, just disable the related capability flag and give an empty implementation for related methods.
For example, if the vendor's OS does not support setting the microphone's volume but supports muting the microphone: In IAudioManger’s implement class
int getCapability() {
return ZRAPI_AUDIO_CAP_MIC_MUTE;
}
boolean setMicrophoneVolume(int volume) {
//Vendor's OS does not support this feature, leave an empty implementation
return false;
}
int getMicrophoneVolume() {
//Vendor's OS does not support this feature, leave an empty implementation
return 0;
}
What happens on Zoom Rooms Application-Side
Zoom Rooms uses the classes in Vendor OS Api doc as the provided library.(Only compiled, not packaged into the APK's package.)
Zoom Rooms will check if the system has integrated Zoom Rooms Vendor OS API by searching for the class “us.zoom.zr.vendoros.VendorOSManager”
private final static String VENDOR_OS_MGR_CLZ_NAME = "us.zoom.zr.vendoros.VendorOSManager";
Class targetClz = Class.forName(VENDOR_OS_MGR_CLZ_NAME);
- If the system has this class, ZR app will call VendorOSManger’s constructor and other public methods.