Skip to content

Commit d21c343

Browse files
authored
Merge pull request #34 from webex/sdk-3.1.0-release
3.1.0 release
2 parents 3e046ab + 8337deb commit d21c343

File tree

21 files changed

+128
-29
lines changed

21 files changed

+128
-29
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,20 @@ This demo support Android device with **Android 7.0** or later
6868
6969
```
7070
dependencies {
71-
implementation 'com.ciscowebex:androidsdk:3.0.0@aar'
71+
implementation 'com.ciscowebex:androidsdk:3.1.0@aar'
7272
}
7373
```
7474
7575
## Usage
7676
7777
For example see [README](https://github.com/webex/webex-android-sdk/blob/master/README.md)
78-
78+
7979
## Note
80-
80+
8181
Please update below constants in gradle.properties
8282
```
8383
CLIENT_ID=""
8484
CLIENT_SECRET=""
85+
SCOPE=""
8586
REDIRECT_URI=""
8687
```

app/build.gradle

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ android {
1919
applicationId "com.cisco.sdk_android"
2020
minSdkVersion Versions.minSdk
2121
targetSdkVersion Versions.targetSdk
22-
versionCode 30001
23-
versionName "3.0.0"
22+
versionCode 30003
23+
versionName "3.1.0"
2424

2525
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2626
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}"
2727
buildConfigField "String", "CLIENT_SECRET", "${CLIENT_SECRET}"
28+
buildConfigField "String", "SCOPE", "${SCOPE}"
2829
buildConfigField "String", "REDIRECT_URI", "${REDIRECT_URI}"
2930
}
3031

@@ -41,10 +42,27 @@ android {
4142
buildFeatures {
4243
dataBinding true
4344
}
45+
splits {
46+
// Configures multiple APKs based on ABI.
47+
abi {
48+
// Enables building multiple APKs per ABI.
49+
enable true
50+
51+
// By default all ABIs are included, so use reset() and include to specify that we only
52+
// want APKs for x86, armeabi-v7a, and mips.
53+
reset()
54+
55+
// Specifies a list of ABIs that Gradle should create APKs for.
56+
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
57+
58+
// Specifies that we want to also generate a universal APK that includes all ABIs.
59+
universalApk true
60+
}
61+
}
4462
}
4563

4664
dependencies {
47-
implementation 'com.ciscowebex:androidsdk:3.0.0@aar'
65+
implementation 'com.ciscowebex:androidsdk:3.1.0@aar'
4866

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

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.ciscowebex.androidsdk.kitchensink.calling.CallActivity
2424
import com.ciscowebex.androidsdk.kitchensink.extras.ExtrasActivity
2525
import com.ciscowebex.androidsdk.kitchensink.search.SearchActivity
2626
import com.ciscowebex.androidsdk.kitchensink.setup.SetupActivity
27+
import com.ciscowebex.androidsdk.phone.Phone
2728
import org.koin.android.ext.android.inject
2829

2930
class HomeActivity : BaseActivity() {
@@ -41,6 +42,10 @@ class HomeActivity : BaseActivity() {
4142
webexViewModel.setLogLevel(webexViewModel.logFilter)
4243
webexViewModel.enableConsoleLogger(webexViewModel.isConsoleLoggerEnabled)
4344

45+
Log.d(tag, "Service URls METRICS: ${webexViewModel.getServiceUrl(Phone.ServiceUrlType.METRICS)}" +
46+
"\nCLIENT_LOGS: ${webexViewModel.getServiceUrl(Phone.ServiceUrlType.CLIENT_LOGS)}" +
47+
"\nKMS: ${webexViewModel.getServiceUrl(Phone.ServiceUrlType.KMS)}")
48+
4449
authenticator?.let {
4550
when (it) {
4651
is OAuthWebViewAuthenticator -> {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ val OAuthWebexModule = module {
1212
single <Authenticator> (named("oAuth")) {
1313
val clientId = BuildConfig.CLIENT_ID
1414
val clientSecret = BuildConfig.CLIENT_SECRET
15+
val additionalScopes = BuildConfig.SCOPE
1516
val redirectUri = BuildConfig.REDIRECT_URI
1617
val email = getEmailPref(androidApplication()).orEmpty()
17-
OAuthWebViewAuthenticator(clientId, clientSecret, redirectUri, email)
18+
OAuthWebViewAuthenticator(clientId, clientSecret, additionalScopes, redirectUri, email)
1819
}
1920

2021
factory {

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,4 +749,32 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
749749
fun openAuxStream(view: View) {
750750
getCall(currentCallId.orEmpty())?.openAuxStream(view)
751751
}
752+
753+
fun hasAnyoneJoined(): Boolean {
754+
return getCall(currentCallId.orEmpty())?.hasAnyoneJoined() ?: false
755+
}
756+
757+
fun isMeeting(): Boolean {
758+
return getCall(currentCallId.orEmpty())?.isMeeting() ?: false
759+
}
760+
761+
fun isPmr(): Boolean {
762+
return getCall(currentCallId.orEmpty())?.isPmr() ?: false
763+
}
764+
765+
fun isSelfCreator(): Boolean {
766+
return getCall(currentCallId.orEmpty())?.isSelfCreator() ?: false
767+
}
768+
769+
fun isSpaceMeeting(): Boolean {
770+
return getCall(currentCallId.orEmpty())?.isSpaceMeeting() ?: false
771+
}
772+
773+
fun isScheduledMeeting(): Boolean {
774+
return getCall(currentCallId.orEmpty())?.isScheduledMeeting() ?: false
775+
}
776+
777+
fun getServiceUrl(type: Phone.ServiceUrlType): String? {
778+
return webex.phone.getServiceUrl(type)
779+
}
752780
}

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/auth/JWTLoginActivity.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ class JWTLoginActivity : AppCompatActivity() {
6262
}
6363
})
6464

65+
loginViewModel.errorData.observe(this@JWTLoginActivity, Observer { errorMessage ->
66+
progressLayout.visibility = View.GONE
67+
onLoginFailed(errorMessage)
68+
})
69+
6570
loginViewModel.initialize()
6671
}
6772
}
@@ -75,8 +80,9 @@ class JWTLoginActivity : AppCompatActivity() {
7580
finish()
7681
}
7782

78-
private fun onLoginFailed() {
83+
private fun onLoginFailed(failureMessage: String = getString(R.string.jwt_login_failed)) {
7984
binding.loginButton.visibility = View.VISIBLE
8085
binding.loginFailedTextView.visibility = View.VISIBLE
86+
binding.loginFailedTextView.text = failureMessage
8187
}
8288
}

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/auth/LoginRepository.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ciscowebex.androidsdk.kitchensink.auth
22

3+
import android.util.Log
34
import android.webkit.WebView
45
import com.ciscowebex.androidsdk.Webex
56
import com.ciscowebex.androidsdk.auth.JWTAuthenticator
@@ -12,6 +13,7 @@ class LoginRepository() {
1213
fun authorizeOAuth(loginWebview: WebView, oAuthAuthenticator: OAuthWebViewAuthenticator): Observable<Boolean> {
1314
return Single.create<Boolean> { emitter ->
1415
oAuthAuthenticator.authorize(loginWebview, CompletionHandler { result ->
16+
Log.d("LoginRepository:authorizeOAuth ", "isAuthorized : ${oAuthAuthenticator.isAuthorized()}")
1517
if (result.error != null) {
1618
emitter.onError(Throwable(result.error?.errorMessage))
1719
} else {
@@ -24,6 +26,7 @@ class LoginRepository() {
2426
fun initialize(webex: Webex): Observable<Boolean> {
2527
return Single.create<Boolean> { emitter ->
2628
webex.initialize(CompletionHandler { result ->
29+
Log.d("LoginRepository:initialize ", "isAuthorized : ${webex.authenticator?.isAuthorized()}")
2730
if (result.error != null) {
2831
emitter.onError(Throwable(result.error?.errorMessage))
2932
} else {
@@ -36,6 +39,7 @@ class LoginRepository() {
3639
fun loginWithJWT(token: String, jwtAuthenticator: JWTAuthenticator): Observable<Boolean> {
3740
return Single.create<Boolean> { emitter ->
3841
jwtAuthenticator.authorize(token, CompletionHandler { result ->
42+
Log.d("LoginRepository:loginWithJWT ", "isAuthorized : ${jwtAuthenticator.isAuthorized()}")
3943
if (result.error != null) {
4044
emitter.onError(Throwable(result.error?.errorMessage))
4145
} else {

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/auth/LoginViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ class LoginViewModel(private val webex: Webex, private val loginRepository: Logi
4343
jwtAuthenticator?.let { auth ->
4444
loginRepository.loginWithJWT(token, auth).observeOn(AndroidSchedulers.mainThread()).subscribe({
4545
_isAuthorized.postValue(it)
46-
}, {_isAuthorized.postValue(false)}).autoDispose()
46+
}, {
47+
_errorData.postValue(it.message)
48+
}).autoDispose()
4749
} ?: run {
4850
_isAuthorized.postValue(false)
4951
}

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface
153153
}
154154

155155
override fun onConnected(call: Call?) {
156-
Log.d(TAG, "CallObserver onConnected : " + call?.getCallId())
156+
Log.d(TAG, "CallObserver onConnected callId: ${call?.getCallId()}, hasAnyoneJoined: ${webexViewModel.hasAnyoneJoined()}, " +
157+
"isMeeting: ${webexViewModel.isMeeting()}," +
158+
"isPmr: ${webexViewModel.isPmr()}," +
159+
"isSelfCreator: ${webexViewModel.isSelfCreator()}," +
160+
"isSpaceMeeting: ${webexViewModel.isSpaceMeeting()}"+
161+
"isScheduledMeeting: ${webexViewModel.isScheduledMeeting()}")
162+
157163
onCallConnected(call?.getCallId().orEmpty())
158164
ringerManager.stopRinger(if (isIncomingActivity) RingerManager.RingerType.Incoming else RingerManager.RingerType.Outgoing)
159165
webexViewModel.sendDTMF(call?.getCallId().orEmpty(), "2")
@@ -1507,6 +1513,14 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface
15071513

15081514
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
15091515
super.onActivityResult(requestCode, resultCode, data)
1516+
handleActivityResult(requestCode, resultCode, data)
1517+
}
1518+
1519+
private fun handleActivityResult(
1520+
requestCode: Int,
1521+
resultCode: Int,
1522+
data: Intent?
1523+
) {
15101524
if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK) {
15111525
val callNumber = data?.getStringExtra(CALLER_ID) ?: ""
15121526
//start call association to add new person on call

app/src/main/java/com/ciscowebex/androidsdk/kitchensink/extras/ExtrasViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ class ExtrasViewModel(private val extrasRepository: ExtrasRepository) : BaseView
2424
fun getRefreshToken() {
2525
extrasRepository.getRefreshToken().observeOn(AndroidSchedulers.mainThread()).subscribe({
2626
_refreshToken.postValue(it)
27-
}, { _refreshToken.postValue(null) }).autoDispose()
27+
}, {
28+
_refreshToken.postValue(it.message)
29+
}).autoDispose()
2830
}
2931

3032
fun getJwtAccessTokenExpiration(): Date? {

0 commit comments

Comments
 (0)