Skip to content

Commit

Permalink
Merge pull request #57 from ciscoRankush/3.9.0GA
Browse files Browse the repository at this point in the history
3.9.0 release
  • Loading branch information
rohits5-cisco authored Jun 5, 2023
2 parents bf4086c + 1fc0a26 commit 1368efd
Show file tree
Hide file tree
Showing 69 changed files with 1,881 additions and 467 deletions.
30 changes: 27 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ android {
applicationId "com.cisco.sdk_android"
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
versionCode 38000
versionName "3.8.0"
versionCode 39000
versionName "3.9.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}"
buildConfigField "String", "CLIENT_SECRET", "${CLIENT_SECRET}"
buildConfigField "String", "SCOPE", "${SCOPE}"
buildConfigField "String", "REDIRECT_URI", "${REDIRECT_URI}"
buildConfigField "String", "FEDRAMP_CLIENT_ID", "${FEDRAMP_CLIENT_ID}"
buildConfigField "String", "FEDRAMP_CLIENT_SECRET", "${FEDRAMP_CLIENT_SECRET}"
buildConfigField "String", "FEDRAMP_REDIRECT_URI", "${FEDRAMP_REDIRECT_URI}"
}

buildTypes {
Expand Down Expand Up @@ -64,10 +67,31 @@ android {
universalApk true
}
}
flavorDimensions 'sdktype'
productFlavors {
full {
dimension 'sdktype'
matchingFallbacks = ["full"]
}
meeting {
dimension 'sdktype'
versionNameSuffix '-meeting'
matchingFallbacks = ["meeting"]
}
wxc {
dimension 'sdktype'
versionNameSuffix '-wxc'
matchingFallbacks = ["wxc"]
}
}
}

dependencies {
implementation 'com.ciscowebex:webexsdk:3.8.0'

// At a time only one WebexSDK should be used.
implementation 'com.ciscowebex:webexsdk-wxc:3.9.0' //For webexCalling flavor
//implementation 'com.ciscowebex:webexsdk-meeting:3.9.0' // For meeting flavor
//implementation 'com.ciscowebex:webexsdk:3.9.0' // For full flavor
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation Dependencies.kotlinStdLib
implementation Dependencies.coreKtx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HomeActivityTest : KitchenSinkTest() {

@Test
fun testWaitingCallButton_homeActivity() {
clickOnView(R.id.iv_waitingCall)
//clickOnView(R.id.iv_waitingCall)
intended(hasComponent(CallActivity::class.java.name))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class PostMessageTest : KitchenSinkTest() {
override fun matchesSafely(item: RecyclerView?): Boolean {
item?.adapter?.let {
val adapter = it as MessageComposerActivity.UploadAttachmentsAdapter
adapter.attachedFiles.add(file)
// adapter.attachedFiles.add(file)
adapter.notifyDataSetChanged()
return true
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<meta-data
android:name="android.content.APP_RESTRICTIONS"
android:resource="@xml/app_restrictions" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package com.ciscowebex.androidsdk.kitchensink
import com.ciscowebex.androidsdk.Webex
import com.ciscowebex.androidsdk.auth.JWTAuthenticator
import com.ciscowebex.androidsdk.auth.TokenAuthenticator
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils
import org.koin.android.ext.koin.androidApplication
import org.koin.dsl.module

val AccessTokenWebexModule = module {

factory {
Webex(androidApplication(), TokenAuthenticator())
val isFedrampEnabled = SharedPrefUtils.getFedrampPref(androidApplication())
Webex(androidApplication(), TokenAuthenticator(isFedrampEnabled))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CallRejectService : Service() {
if(intent != null){
if(intent.action == Constants.Action.WEBEX_CALL_REJECT_ACTION){
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager?
notificationManager?.cancel(Constants.Notification.WEBEX_CALLING)
notificationManager?.cancel(Constants.Notification.WEBEX_CALL)
val callId = intent.getStringExtra(Constants.Intent.CALL_ID)
if(!callId.isNullOrBlank()) {
val call = repository.getCall(callId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,32 @@ import androidx.lifecycle.Observer
import com.ciscowebex.androidsdk.CompletionHandler
import com.ciscowebex.androidsdk.auth.OAuthWebViewAuthenticator
import com.ciscowebex.androidsdk.auth.TokenAuthenticator
import com.ciscowebex.androidsdk.auth.UCLoginServerConnectionStatus
import com.ciscowebex.androidsdk.kitchensink.auth.LoginActivity
import com.ciscowebex.androidsdk.kitchensink.calling.CallActivity
import com.ciscowebex.androidsdk.kitchensink.cucm.UCLoginActivity
import com.ciscowebex.androidsdk.kitchensink.databinding.ActivityHomeBinding
import com.ciscowebex.androidsdk.kitchensink.extras.ExtrasActivity
import com.ciscowebex.androidsdk.kitchensink.messaging.MessagingActivity
import com.ciscowebex.androidsdk.kitchensink.cucm.UCLoginActivity
import com.ciscowebex.androidsdk.kitchensink.messaging.spaces.detail.MessageDetailsDialogFragment
import com.ciscowebex.androidsdk.kitchensink.person.PersonDialogFragment
import com.ciscowebex.androidsdk.kitchensink.person.PersonViewModel
import com.ciscowebex.androidsdk.kitchensink.utils.Constants
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.clearLoginTypePref
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.saveLoginTypePref
import com.ciscowebex.androidsdk.kitchensink.webhooks.WebhooksActivity
import com.ciscowebex.androidsdk.auth.UCLoginServerConnectionStatus
import com.ciscowebex.androidsdk.kitchensink.calling.CallActivity
import com.ciscowebex.androidsdk.kitchensink.extras.ExtrasActivity
import com.ciscowebex.androidsdk.kitchensink.search.SearchActivity
import com.ciscowebex.androidsdk.kitchensink.setup.SetupActivity
import com.ciscowebex.androidsdk.kitchensink.utils.CallObjectStorage
import com.ciscowebex.androidsdk.kitchensink.utils.Constants
import com.ciscowebex.androidsdk.kitchensink.utils.FileUtils
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.clearLoginTypePref
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.saveLoginTypePref
import com.ciscowebex.androidsdk.kitchensink.webhooks.WebhooksActivity
import com.ciscowebex.androidsdk.message.LocalFile
import com.ciscowebex.androidsdk.phone.Phone
import com.google.android.material.snackbar.Snackbar
import org.koin.android.ext.android.inject
import java.io.FileDescriptor
import java.io.PrintWriter


class HomeActivity : BaseActivity() {

Expand All @@ -45,9 +49,9 @@ class HomeActivity : BaseActivity() {

val authenticator = webexViewModel.webex.authenticator

webexViewModel.enableBackgroundConnection(webexViewModel.enableBgConnectiontoggle)
webexViewModel.setLogLevel(webexViewModel.logFilter)
webexViewModel.enableConsoleLogger(webexViewModel.isConsoleLoggerEnabled)
webexViewModel.setOnInitialSpacesSyncCompletedListener()

if(SharedPrefUtils.isAppBackgroundRunningPreferred(this)) {
KitchenSinkForegroundService.startForegroundService(this)
Expand Down Expand Up @@ -101,14 +105,24 @@ class HomeActivity : BaseActivity() {
webexViewModel.incomingListenerLiveData.observe(this@HomeActivity, Observer {
it?.let {
Log.d(tag, "incomingListenerLiveData: ${it.getCallId()}")
Handler(Looper.getMainLooper()).post {
startActivity(CallActivity.getIncomingIntent(this, it.getCallId()))
val callId = it.getCallId()
if(callId != null){
if(CallObjectStorage.getCallObject(callId) != null){
if(!it.isWebexCallingOrWebexForBroadworks() && !it.isCUCMCall()) {
// For Webex Calling call is notified in FCM service with accept decline button even for foreground case
// So not notifying here in home screen
Handler(Looper.getMainLooper()).post {
startActivity(CallActivity.getIncomingIntent(this, it.getCallId()))
}
}
}
}
}
})

webexViewModel.initialSpacesSyncCompletedLiveData.observe(this@HomeActivity) {
Log.d(tag, getString(R.string.initial_spaces_sync_completed))
Snackbar.make(binding.root, getString(R.string.initial_spaces_sync_completed), Snackbar.LENGTH_LONG).show()
}

DataBindingUtil.setContentView<ActivityHomeBinding>(this, R.layout.activity_home)
Expand Down Expand Up @@ -302,4 +316,16 @@ class HomeActivity : BaseActivity() {
})
}
}

override fun dump(
prefix: String,
fd: FileDescriptor?,
writer: PrintWriter,
args: Array<out String>?
) {
super.dump(prefix, fd, writer, args)
writer.println(" ")
writer.println("Dump logs: ")
webexViewModel.printObservers(writer)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ import com.ciscowebex.androidsdk.Webex
import com.ciscowebex.androidsdk.auth.OAuthWebViewAuthenticator
import com.ciscowebex.androidsdk.auth.Authenticator
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.getEmailPref
import com.ciscowebex.androidsdk.kitchensink.utils.SharedPrefUtils.getFedrampPref
import org.koin.android.ext.koin.androidApplication
import org.koin.core.qualifier.named
import org.koin.dsl.module

val OAuthWebexModule = module {
single <Authenticator> (named("oAuth")) {
val clientId = BuildConfig.CLIENT_ID
val clientSecret = BuildConfig.CLIENT_SECRET
val additionalScopes = BuildConfig.SCOPE
val redirectUri = BuildConfig.REDIRECT_URI
val isFedrampEnabled = getFedrampPref(androidApplication())
val clientId = if(isFedrampEnabled) BuildConfig.FEDRAMP_CLIENT_ID else BuildConfig.CLIENT_ID
val clientSecret = if(isFedrampEnabled) BuildConfig.FEDRAMP_CLIENT_SECRET else BuildConfig.CLIENT_SECRET
val redirectUri = if(isFedrampEnabled) BuildConfig.FEDRAMP_REDIRECT_URI else BuildConfig.REDIRECT_URI
val additionalScopes = BuildConfig.SCOPE
val email = getEmailPref(androidApplication()).orEmpty()
OAuthWebViewAuthenticator(clientId, clientSecret, additionalScopes, redirectUri, email)

OAuthWebViewAuthenticator(clientId, clientSecret, additionalScopes, redirectUri, email, isFedrampEnabled)
}

factory {
Expand Down
Loading

0 comments on commit 1368efd

Please sign in to comment.