Skip to content

Commit b643bfa

Browse files
authored
Merge pull request #38 from webex/3.3.0-GA
3.3.0 Release
2 parents 6056183 + fe185e9 commit b643bfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1597
-76
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ android {
1919
applicationId "com.cisco.sdk_android"
2020
minSdkVersion Versions.minSdk
2121
targetSdkVersion Versions.targetSdk
22-
versionCode 32100
23-
versionName "3.2.1"
22+
versionCode 33000
23+
versionName "3.3.0"
2424

2525
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2626
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}"
@@ -62,7 +62,7 @@ android {
6262
}
6363

6464
dependencies {
65-
implementation 'com.ciscowebex:androidsdk:3.2.1@aar'
65+
implementation 'com.ciscowebex:androidsdk:3.3.0@aar'
6666

6767
implementation fileTree(dir: "libs", include: ["*.jar"])
6868
implementation Dependencies.kotlinStdLib

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@
123123
</activity>
124124
<activity
125125
android:name=".calling.CallActivity"
126-
android:screenOrientation="portrait"
127126
android:showOnLockScreen="true"
128127
android:showWhenLocked="true"
129128
android:turnScreenOn="true"
129+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
130130
tools:ignore="UnusedAttribute" />
131131
<activity
132132
android:name=".search.SearchActivity"

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/WebexRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class WebexRepository(val webex: Webex) : WebexUCLoginDelegate {
109109
var enableBgStreamtoggle = true
110110
var enableBgConnectiontoggle = true
111111
var enablePhoneStatePermission = true
112-
var enableHWAcceltoggle = true
112+
var enableHWAcceltoggle = false
113113
var logFilter = LogLevel.ALL.name
114114
var isConsoleLoggerEnabled = true
115115
var callCapability: CallCap = CallCap.Audio_Video

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/WebexViewModel.kt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ import com.ciscowebex.androidsdk.message.LocalFile
3131
import com.ciscowebex.androidsdk.phone.AdvancedSetting
3232
import com.ciscowebex.androidsdk.phone.AuxStream
3333
import com.ciscowebex.androidsdk.phone.VirtualBackground
34+
import com.ciscowebex.androidsdk.phone.CameraExposureISO
35+
import com.ciscowebex.androidsdk.phone.CameraExposureDuration
36+
import com.ciscowebex.androidsdk.phone.CameraExposureTargetBias
3437

3538

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

8386
var isSendingVideoForceLandscape: Boolean = false
87+
var torchMode = Call.TorchMode.OFF
88+
var flashMode = Call.FlashMode.OFF
8489

8590
var callCapability: WebexRepository.CallCap
8691
get() = repository.callCapability
@@ -377,6 +382,10 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
377382
override fun onCpuHitThreshold() {
378383
callObserverInterface?.onCpuHitThreshold()
379384
}
385+
386+
override fun onPhotoCaptured(imageData: ByteArray?) {
387+
callObserverInterface?.onPhotoCaptured(imageData)
388+
}
380389
})
381390
}
382391

@@ -459,6 +468,10 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
459468
})
460469
}
461470

471+
fun cancel() {
472+
webex.phone.cancel()
473+
}
474+
462475
fun hangup(callId: String) {
463476
getCall(callId)?.hangup(CompletionHandler { result ->
464477
if (result.isSuccessful) {
@@ -824,6 +837,8 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
824837
webex.authenticator?.let {
825838
if (it is TokenAuthenticator) {
826839
it.setOnTokenExpiredListener(CompletionHandler {
840+
// Handle when auth token has expired.
841+
// When a token expires, new instances of `Webex` and `Authenticator` need to be created and used with a new token
827842
Log.d(tag, "KS setOnTokenExpiredListener")
828843
_signOutListenerLiveData.postValue(it.isSuccessful)
829844
})
@@ -883,4 +898,56 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
883898
fun getMaxVirtualBackgrounds(): Int {
884899
return repository.getMaxVirtualBackgrounds()
885900
}
901+
902+
fun setCameraFocusAtPoint(pointX: Float, pointY: Float): Boolean {
903+
return getCall(currentCallId.orEmpty())?.setCameraFocusAtPoint(pointX, pointY) ?: false
904+
}
905+
906+
fun setCameraFlashMode(mode: Call.FlashMode): Boolean {
907+
return getCall(currentCallId.orEmpty())?.setCameraFlashMode(mode) ?: false
908+
}
909+
910+
fun getCameraFlashMode(): Call.FlashMode {
911+
return getCall(currentCallId.orEmpty())?.getCameraFlashMode() ?: Call.FlashMode.OFF
912+
}
913+
914+
fun setCameraTorchMode(mode: Call.TorchMode): Boolean {
915+
return getCall(currentCallId.orEmpty())?.setCameraTorchMode(mode) ?: false
916+
}
917+
918+
fun getCameraTorchMode(): Call.TorchMode {
919+
return getCall(currentCallId.orEmpty())?.getCameraTorchMode() ?: Call.TorchMode.OFF
920+
}
921+
922+
fun getCameraExposureDuration(): CameraExposureDuration? {
923+
return getCall(currentCallId.orEmpty())?.getCameraExposureDuration()
924+
}
925+
926+
fun getCameraExposureISO(): CameraExposureISO? {
927+
return getCall(currentCallId.orEmpty())?.getCameraExposureISO()
928+
}
929+
930+
fun getCameraExposureTargetBias(): CameraExposureTargetBias? {
931+
return getCall(currentCallId.orEmpty())?.getCameraExposureTargetBias()
932+
}
933+
934+
fun setCameraCustomExposure(duration: Double, iso: Float): Boolean {
935+
return getCall(currentCallId.orEmpty())?.setCameraCustomExposure(duration, iso) ?: false
936+
}
937+
938+
fun setCameraAutoExposure(targetBias: Float): Boolean {
939+
return getCall(currentCallId.orEmpty())?.setCameraAutoExposure(targetBias) ?: false
940+
}
941+
942+
fun setVideoZoomFactor(factor: Float): Boolean {
943+
return getCall(currentCallId.orEmpty())?.setVideoZoomFactor(factor) ?: false
944+
}
945+
946+
fun getVideoZoomFactor(): Float {
947+
return getCall(currentCallId.orEmpty())?.getVideoZoomFactor() ?: 1.0f
948+
}
949+
950+
fun takePhoto(): Boolean {
951+
return getCall(currentCallId.orEmpty())?.takePhoto() ?: false
952+
}
886953
}

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/calling/CallBottomSheetFragment.kt

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,28 @@ import android.os.Bundle
44
import android.view.LayoutInflater
55
import android.view.View
66
import android.view.ViewGroup
7+
import android.widget.Toast
78
import com.ciscowebex.androidsdk.kitchensink.databinding.BottomSheetCallOptionsBinding
89
import com.ciscowebex.androidsdk.phone.Call
910
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
1011
import com.ciscowebex.androidsdk.kitchensink.R
1112
import com.ciscowebex.androidsdk.phone.MediaOption
1213
import com.ciscowebex.androidsdk.phone.Phone
1314

14-
class CallBottomSheetFragment(val receivingVideoClickListener: (Call?) -> Unit,
15+
class CallBottomSheetFragment(val transcriptionClickListener: (Call?) -> Unit,
16+
val toggleWXAClickListener: (Call?) -> Unit,
17+
val receivingVideoClickListener: (Call?) -> Unit,
1518
val receivingAudioClickListener: (Call?) -> Unit,
1619
val receivingSharingClickListener: (Call?) -> Unit,
1720
val scalingModeClickListener: (Call?) -> Unit,
1821
val virtualBackgroundOptionsClickListener: (Call?) -> Unit,
1922
val compositeStreamLayoutClickListener: (Call?) -> Unit,
2023
val swapVideoClickListener: (Call?) -> Unit,
21-
val forceLandscapeClickListener: (Call?) -> Unit): BottomSheetDialogFragment() {
24+
val forceLandscapeClickListener: (Call?) -> Unit,
25+
val cameraOptionsClickListener: (Call?) -> Unit,
26+
val sendDTMFClickListener: (Call?) -> Unit): BottomSheetDialogFragment() {
2227
companion object {
23-
val TAG = "MessageActionBottomSheetFragment"
28+
val TAG = "CallBottomSheetFragment"
2429
}
2530

2631
private lateinit var binding: BottomSheetCallOptionsBinding
@@ -156,7 +161,49 @@ class CallBottomSheetFragment(val receivingVideoClickListener: (Call?) -> Unit,
156161
dismiss()
157162
virtualBackgroundOptionsClickListener(call)
158163
}
164+
165+
cameraOptions.setOnClickListener {
166+
dismiss()
167+
cameraOptionsClickListener(call)
168+
}
169+
170+
showTranscripts.setOnClickListener {
171+
dismiss()
172+
transcriptionClickListener(call)
173+
}
174+
175+
enableWXA.text = if (call?.getWXA()?.isEnabled() == true) "Disable Webex Assistant" else "Enable Webex Assistant"
176+
enableWXA.setOnClickListener {
177+
dismiss()
178+
toggleWXAClickListener(call)
179+
}
180+
181+
val canControlWXAStr = if (call?.getWXA()?.canControlWXA() == true) "Can control WXA" else "Can not control WXA"
182+
Toast.makeText(activity, canControlWXAStr, Toast.LENGTH_LONG).show()
183+
184+
val showDTMFOption = call?.isSendingDTMFEnabled() ?: false
185+
186+
if (showDTMFOption) {
187+
sendDTMF.visibility = View.VISIBLE
188+
} else {
189+
sendDTMF.visibility = View.GONE
190+
}
191+
sendDTMF.setOnClickListener {
192+
dismiss()
193+
sendDTMFClickListener(call)
194+
}
195+
159196
cancel.setOnClickListener { dismiss() }
160197
}.root
161198
}
199+
200+
fun isDTMFOptionEnabled() : Boolean {
201+
if (::binding.isInitialized) {
202+
if (binding.sendDTMF.visibility == View.VISIBLE) {
203+
return true
204+
}
205+
}
206+
207+
return false
208+
}
162209
}

0 commit comments

Comments
 (0)