Skip to content

Commit

Permalink
Merge pull request #38 from webex/3.3.0-GA
Browse files Browse the repository at this point in the history
3.3.0 Release
  • Loading branch information
ankibatr authored Feb 15, 2022
2 parents 6056183 + fe185e9 commit b643bfa
Show file tree
Hide file tree
Showing 42 changed files with 1,597 additions and 76 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "com.cisco.sdk_android"
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
versionCode 32100
versionName "3.2.1"
versionCode 33000
versionName "3.3.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}"
Expand Down Expand Up @@ -62,7 +62,7 @@ android {
}

dependencies {
implementation 'com.ciscowebex:androidsdk:3.2.1@aar'
implementation 'com.ciscowebex:androidsdk:3.3.0@aar'

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation Dependencies.kotlinStdLib
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@
</activity>
<activity
android:name=".calling.CallActivity"
android:screenOrientation="portrait"
android:showOnLockScreen="true"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
tools:ignore="UnusedAttribute" />
<activity
android:name=".search.SearchActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class WebexRepository(val webex: Webex) : WebexUCLoginDelegate {
var enableBgStreamtoggle = true
var enableBgConnectiontoggle = true
var enablePhoneStatePermission = true
var enableHWAcceltoggle = true
var enableHWAcceltoggle = false
var logFilter = LogLevel.ALL.name
var isConsoleLoggerEnabled = true
var callCapability: CallCap = CallCap.Audio_Video
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import com.ciscowebex.androidsdk.message.LocalFile
import com.ciscowebex.androidsdk.phone.AdvancedSetting
import com.ciscowebex.androidsdk.phone.AuxStream
import com.ciscowebex.androidsdk.phone.VirtualBackground
import com.ciscowebex.androidsdk.phone.CameraExposureISO
import com.ciscowebex.androidsdk.phone.CameraExposureDuration
import com.ciscowebex.androidsdk.phone.CameraExposureTargetBias


class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseViewModel() {
Expand Down Expand Up @@ -81,6 +84,8 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
var isVideoViewsSwapped: Boolean = true

var isSendingVideoForceLandscape: Boolean = false
var torchMode = Call.TorchMode.OFF
var flashMode = Call.FlashMode.OFF

var callCapability: WebexRepository.CallCap
get() = repository.callCapability
Expand Down Expand Up @@ -377,6 +382,10 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
override fun onCpuHitThreshold() {
callObserverInterface?.onCpuHitThreshold()
}

override fun onPhotoCaptured(imageData: ByteArray?) {
callObserverInterface?.onPhotoCaptured(imageData)
}
})
}

Expand Down Expand Up @@ -459,6 +468,10 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
})
}

fun cancel() {
webex.phone.cancel()
}

fun hangup(callId: String) {
getCall(callId)?.hangup(CompletionHandler { result ->
if (result.isSuccessful) {
Expand Down Expand Up @@ -824,6 +837,8 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
webex.authenticator?.let {
if (it is TokenAuthenticator) {
it.setOnTokenExpiredListener(CompletionHandler {
// Handle when auth token has expired.
// When a token expires, new instances of `Webex` and `Authenticator` need to be created and used with a new token
Log.d(tag, "KS setOnTokenExpiredListener")
_signOutListenerLiveData.postValue(it.isSuccessful)
})
Expand Down Expand Up @@ -883,4 +898,56 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
fun getMaxVirtualBackgrounds(): Int {
return repository.getMaxVirtualBackgrounds()
}

fun setCameraFocusAtPoint(pointX: Float, pointY: Float): Boolean {
return getCall(currentCallId.orEmpty())?.setCameraFocusAtPoint(pointX, pointY) ?: false
}

fun setCameraFlashMode(mode: Call.FlashMode): Boolean {
return getCall(currentCallId.orEmpty())?.setCameraFlashMode(mode) ?: false
}

fun getCameraFlashMode(): Call.FlashMode {
return getCall(currentCallId.orEmpty())?.getCameraFlashMode() ?: Call.FlashMode.OFF
}

fun setCameraTorchMode(mode: Call.TorchMode): Boolean {
return getCall(currentCallId.orEmpty())?.setCameraTorchMode(mode) ?: false
}

fun getCameraTorchMode(): Call.TorchMode {
return getCall(currentCallId.orEmpty())?.getCameraTorchMode() ?: Call.TorchMode.OFF
}

fun getCameraExposureDuration(): CameraExposureDuration? {
return getCall(currentCallId.orEmpty())?.getCameraExposureDuration()
}

fun getCameraExposureISO(): CameraExposureISO? {
return getCall(currentCallId.orEmpty())?.getCameraExposureISO()
}

fun getCameraExposureTargetBias(): CameraExposureTargetBias? {
return getCall(currentCallId.orEmpty())?.getCameraExposureTargetBias()
}

fun setCameraCustomExposure(duration: Double, iso: Float): Boolean {
return getCall(currentCallId.orEmpty())?.setCameraCustomExposure(duration, iso) ?: false
}

fun setCameraAutoExposure(targetBias: Float): Boolean {
return getCall(currentCallId.orEmpty())?.setCameraAutoExposure(targetBias) ?: false
}

fun setVideoZoomFactor(factor: Float): Boolean {
return getCall(currentCallId.orEmpty())?.setVideoZoomFactor(factor) ?: false
}

fun getVideoZoomFactor(): Float {
return getCall(currentCallId.orEmpty())?.getVideoZoomFactor() ?: 1.0f
}

fun takePhoto(): Boolean {
return getCall(currentCallId.orEmpty())?.takePhoto() ?: false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,28 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import com.ciscowebex.androidsdk.kitchensink.databinding.BottomSheetCallOptionsBinding
import com.ciscowebex.androidsdk.phone.Call
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.ciscowebex.androidsdk.kitchensink.R
import com.ciscowebex.androidsdk.phone.MediaOption
import com.ciscowebex.androidsdk.phone.Phone

class CallBottomSheetFragment(val receivingVideoClickListener: (Call?) -> Unit,
class CallBottomSheetFragment(val transcriptionClickListener: (Call?) -> Unit,
val toggleWXAClickListener: (Call?) -> Unit,
val receivingVideoClickListener: (Call?) -> Unit,
val receivingAudioClickListener: (Call?) -> Unit,
val receivingSharingClickListener: (Call?) -> Unit,
val scalingModeClickListener: (Call?) -> Unit,
val virtualBackgroundOptionsClickListener: (Call?) -> Unit,
val compositeStreamLayoutClickListener: (Call?) -> Unit,
val swapVideoClickListener: (Call?) -> Unit,
val forceLandscapeClickListener: (Call?) -> Unit): BottomSheetDialogFragment() {
val forceLandscapeClickListener: (Call?) -> Unit,
val cameraOptionsClickListener: (Call?) -> Unit,
val sendDTMFClickListener: (Call?) -> Unit): BottomSheetDialogFragment() {
companion object {
val TAG = "MessageActionBottomSheetFragment"
val TAG = "CallBottomSheetFragment"
}

private lateinit var binding: BottomSheetCallOptionsBinding
Expand Down Expand Up @@ -156,7 +161,49 @@ class CallBottomSheetFragment(val receivingVideoClickListener: (Call?) -> Unit,
dismiss()
virtualBackgroundOptionsClickListener(call)
}

cameraOptions.setOnClickListener {
dismiss()
cameraOptionsClickListener(call)
}

showTranscripts.setOnClickListener {
dismiss()
transcriptionClickListener(call)
}

enableWXA.text = if (call?.getWXA()?.isEnabled() == true) "Disable Webex Assistant" else "Enable Webex Assistant"
enableWXA.setOnClickListener {
dismiss()
toggleWXAClickListener(call)
}

val canControlWXAStr = if (call?.getWXA()?.canControlWXA() == true) "Can control WXA" else "Can not control WXA"
Toast.makeText(activity, canControlWXAStr, Toast.LENGTH_LONG).show()

val showDTMFOption = call?.isSendingDTMFEnabled() ?: false

if (showDTMFOption) {
sendDTMF.visibility = View.VISIBLE
} else {
sendDTMF.visibility = View.GONE
}
sendDTMF.setOnClickListener {
dismiss()
sendDTMFClickListener(call)
}

cancel.setOnClickListener { dismiss() }
}.root
}

fun isDTMFOptionEnabled() : Boolean {
if (::binding.isInitialized) {
if (binding.sendDTMF.visibility == View.VISIBLE) {
return true
}
}

return false
}
}
Loading

0 comments on commit b643bfa

Please sign in to comment.