Class PolyOsManager
com.poly.polyos
Class PolyOsManager
- java.lang.Object
- com.poly.polyos.PolyOsManager
public class
PolyOsManager
extends java.lang.Object
Exposes the API to communicate between a client application and PolyOS.
Usage:
//Create an instance of PolyOsManager
polyOsManager = PolyOsManager(context);
//Notify PolyOS when app state changes
polyOsManager.notifyAppStateChanged(AppState(inCall = true))
//Access services through the suspend function. Suspends until connected with polyos
val isMuted = polyOsManager { audioService.isMicrophoneMuted }
//Mute microphone
polyOsManager { audioService.muteMicrophone(true)}
//register listeners whenever polyos gets connected/reconnected
polyOsManager.runWhenConnected {
//Register for audio notifications
audioService.registerAudioListener(audioListener)
//Register for messages
roomService.registerRoomListener(roomListener)
}
Since: 3.0.11
See Also:
IPolyAppCallBacks
, PolyOsListener
, PolyOsException
Constructor Summary
Constructor and Description
PolyOsManager
(android.content.Context context, IPolyAppCallBacks
polyAppCallBacks, PolyOsListener
polyOsListener)
Initialize the PolyOsManager
.
Method Summary
Modifier and Type | Method and Description |
---|---|
void | destroy() |
Called to destroy the manager instance | |
IPolyAnalyticsService | getAnalyticsService() |
Returns IPolyAnalyticsService if connected. | |
IPolyAudioService | getAudioService() |
Returns IPolyAudioService if connected. | |
IPolyCameraService | getCameraService() |
Returns IPolyCameraService if connected. | |
IPolyApiExtensions | getExtension(java.lang.Class<? extends IPolyApiExtensions> extension) |
Returns various extensions to PolyOS. | |
IPolyRoomService | getRoomService() |
Returns IPolyRoomService if connected. | |
IPolySettingsService | getSettingsService() |
Returns IPolySettingsService if connected. | |
IPolySystemService | getSystemService() |
Returns IPolySystemService if connected. | |
java.lang.String | getVersion() |
Returns the version of PolyOS API | |
boolean | isConnected() |
Returns whether this is connected with the PolyOS API |
Methods inherited from class java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
Constructor Detail
PolyOsManager
public PolyOsManager(android.content.Context context,
IPolyAppCallBacks polyAppCallBacks,
PolyOsListener polyOsListener)
Initialize the PolyOsManager
.
Use isConnected()
to know whether this instance is connected with PolyOS.
Once connected, any of the other methods (like getAudioService()
) will return the corresponding service.
Parameters:
context
- Context
to use
polyAppCallBacks
- The IPolyAppCallBacks
so that PolyOS can query/listen to app changes
polyOsListener
- The PolyOsListener
to know connected state and any other call backs
Method Detail
isConnected
public boolean isConnected()
Returns whether this is connected with the PolyOS API
destroy
public void destroy()
Called to destroy the manager instance
getVersion
public java.lang.String getVersion()
Returns the version of PolyOS API
getAudioService
public IPolyAudioService getAudioService()
Returns IPolyAudioService
if connected.
See Also:
isConnected()
getCameraService
public IPolyCameraService getCameraService()
Returns IPolyCameraService
if connected.
See Also:
isConnected()
getSystemService
public IPolySystemService getSystemService()
Returns IPolySystemService
if connected.
See Also:
isConnected()
getAnalyticsService
public IPolyAnalyticsService getAnalyticsService()
Returns IPolyAnalyticsService
if connected.
Since:
3.0.45
See Also:
isConnected()
getRoomService
public IPolyRoomService getRoomService()
Returns IPolyRoomService
if connected.
Since:
3.0.31
See Also:
isConnected()
getSettingsService
public IPolySettingsService getSettingsService()
Returns IPolySettingsService
if connected.
See Also:
isConnected()
getExtension
public IPolyApiExtensions getExtension(java.lang.Class<? extends IPolyApiExtensions> extension)
Returns various extensions to PolyOS.
These may only be available to internal apps, or specific client apps Other will fail with
PolyOsException
Since:
3.0.20