diff --git a/LICENSE b/LICENSE.txt
similarity index 99%
rename from LICENSE
rename to LICENSE.txt
index 9e85851..2b9efc3 100644
--- a/LICENSE
+++ b/LICENSE.txt
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 977221d..265608b 100644
--- a/README.md
+++ b/README.md
@@ -1,79 +1,86 @@
# Cisco Webex Android SDK Example
-This "Kitchen Sink" demo employs Cisco Webex service through [Webex Android SDK](https://github.com/webex/webex-android-sdk). It provides a developer friendly sample implementation of Webex client SDK and showcases all SDK features. It focuses on how to call and use "Webex-SDK" APIs. Developers could directly cut, paste, and use the code from this sample. It basically implements “Webex-SDK” APIs by sequence.
+This *Kitchen Sink* demo employs Cisco Webex service through [Webex Android SDK](https://github.com/webex/webex-android-sdk). It provides a developer friendly sample implementation of Webex client SDK and showcases all SDK features. It focuses on how to call and use *Webex-SDK* APIs. Developers could directly cut, paste, and use the code from this sample. It basically implements *Webex-SDK* APIs by sequence.
-This demo support Android device with **Android 6.0** or later
+This demo support Android device with **Android 7.0** or later
## Table of Contents
-- [Setup](#setup)
-- [Install](#install)
+- [Integration](#integration)
- [Usage](#usage)
+- [Note](#note)
## Screenshots
-
-
-
+
+
+
+
+
+
+
+
1. ScreenShot-1: Main page of Application, listing main functions of this demo.
-2. ScreenShot-2: Initiate call page, contains call configuration options.
-3. ScreenShot-3: Show messaing APIs with present payloads.
-
-## Setup
-
-- Install Java SE Development Kit 7u45 or later (Java 8 is OK)
-
- http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
-- Android Studio 2.3 or later
-
- https://developer.android.com/sdk/installing/studio.html
-
-- Android Plugin for Gradle 3 or later
-
- If you upgrade your gradle plugin newer than 3.0.0, make sure to add google repository and remove retrolambda plugin in your build.gradle file:
- ```
- allprojects {
- repositories {
- jcenter()
- google()
- ...
- }
- }
- ```
-
-- Select tools->Android->SDK Manager in Android Studio, and install the following packages:
- * Android SDK Tools
- * Android SDK Platform-Tools
- * Android SDK Build-Tools (latest)
- * Android 7.1.1 (latest)
- * Support Repository: Android Support Repository
- * Support Repository: ConstraintLayout for Android
- * Support Repository: Google Repository
-
-
-## Install
-
-1. Clone or download project to your computer.
- ```
- git clone https://github.com/webex/webex-android-sdk-example
- ```
-
-2. Import project
-In Android Studio,open "File" -> "Open", select project.
-
-3. Connect your device with debug enabled
-
-4. Build & Run
+2. ScreenShot-2: Initiate call page.
+3. ScreenShot-3: Show call controls when call is connected.
+4. ScreenShot-4: Video calling screen
+5. ScreenShot-5: Teams listing screen
+6. ScreenShot-6: Space related option screen
+7. ScreenShot-7: Space listing screen
+8. ScreenShot-8: Send Message screen
+
+## Integration
+
+### Option 1
+1. Put AAR file in libs folder of your Android project
+2. Open the project level Gradle file and add the following lines under the repositories tag, which is nested under allprojects.
+
+ ```
+ allprojects {
+ repositories {
+ jcenter()
+ google()
+ flatDir { dirs 'aars'} //add this line
+ }
+ }
+ ```
+3. Add the following dependency in module level Gradle file and press sync-now
+ ```
+ implementation files('libs/WebexSDK.aar')
+ ```
+### Option 2
+
+ 1. Add the following repository to your top-level `build.gradle` file:
+ ```
+ allprojects {
+ repositories {
+ jcenter()
+ maven {
+ url 'https://devhub.cisco.com/artifactory/webexsdk/'
+ }
+ }
+ }
+ ```
+ 2. Add the `webex-android-sdk` library as a dependency for your app in the `build.gradle` file:
+
+ ```
+ dependencies {
+ implementation 'com.ciscowebex:androidsdk:3.0.0@aar'
+ }
+ ```
## Usage
-### Authorize
-**Webex ID**
-If you have a Webex ID (your email address), you can choose "**Webex ID**" to authorize your device.
-
-**Guest ID**
-If you have a Guest ID (a string token), choose "**Guest ID**" in the first page, then you need to enter your App JWT token and login.
+For example see [README.md](https://github.com/webex/webex-android-sdk/README.md)
+
+## Note
+
+ Please update below constants in gradle.properties
+ ```
+ CLIENT_ID=""
+ CLIENT_SECRET=""
+ REDIRECT_URI=""
+ ```
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/app/build.gradle b/app/build.gradle
deleted file mode 100644
index 59246cd..0000000
--- a/app/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply plugin: 'org.greenrobot.greendao'
-
-android {
- compileSdkVersion 30
- buildToolsVersion "29.0.3"
- defaultConfig {
- applicationId "com.ciscowebex.androidsdk.kitchensink"
- minSdkVersion 24
- targetSdkVersion 30
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.agent.AndroidJUnitRunner"
- vectorDrawables.useSupportLibrary = true
-
- ndk {
- abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
- }
- multiDexEnabled true
-
- buildConfigField "String", "CLIENT_ID", "\"C338457876c27e853fb5e4dc85c6087164073e1e2bf415c081b600fe654d7af60\""
- buildConfigField "String", "CLIENT_SEC", "\"0dc8b9c77c8b5597e7eef4b72c7dfaf8d5b834fdba24cf0a0b55eb85ae209b31\""
- buildConfigField "String", "REDIRECT_URL", "\"AndroidKitchenSink://response\""
- buildConfigField "String", "SCOPE", "\"spark:all\""
- }
- packagingOptions {
- exclude 'META-INF/DEPENDENCIES'
- exclude 'META-INF/NOTICE'
- exclude 'META-INF/LICENSE'
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/NOTICE.txt'
- exclude 'META-INF/rxjava.properties'
- }
- buildTypes {
- release {
- minifyEnabled false
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- dexOptions {
- preDexLibraries = false
- javaMaxHeapSize "4g"
- }
-}
-
-repositories {
- flatDir {
- dirs 'libs'
- }
-}
-
-dependencies {
- implementation('com.ciscowebex:androidsdk:2.8.0@aar', {
- transitive = true
- changing = true
- })
- implementation 'com.android.support:appcompat-v7:27.1.0'
- implementation 'com.android.support:cardview-v7:27.1.0'
- implementation 'com.android.support:gridlayout-v7:27.1.0'
- implementation 'com.android.support:support-annotations:27.1.0'
- implementation 'com.android.support:design:27.1.0'
- implementation 'com.android.support:support-v13:27.1.0'
- implementation 'com.android.support:gridlayout-v7:27.1.0'
- implementation 'com.android.support:design:27.1.0'
-
- implementation 'org.greenrobot:eventbus:3.0.0'
-
-
- implementation 'com.android.support.constraint:constraint-layout:1.1.3'
- implementation 'com.squareup.picasso:picasso:2.5.2'
- implementation 'org.greenrobot:greendao:3.2.2'
- implementation 'com.jakewharton:butterknife:8.8.1'
- annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
- testImplementation 'junit:junit:4.12'
-}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
deleted file mode 100644
index 1547ae6..0000000
--- a/app/proguard-rules.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/lm/Library/Android/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
diff --git a/app/src/androidTest/java/com/ciscowebex/androidsdk/kitchensink/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/ciscowebex/androidsdk/kitchensink/ExampleInstrumentedTest.java
deleted file mode 100644
index 8c12513..0000000
--- a/app/src/androidTest/java/com/ciscowebex/androidsdk/kitchensink/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.ciscowebex.androidsdk.kitchensink;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getTargetContext();
-
- assertEquals("com.ciscowebex.androidsdk.webexkitchensink", appContext.getPackageName());
- }
-}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 305714d..0000000
--- a/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/KitchenSinkApp.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/KitchenSinkApp.java
deleted file mode 100644
index b5e6171..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/KitchenSinkApp.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink;
-
-import android.app.Application;
-
-import com.ciscowebex.androidsdk.kitchensink.models.DaoMaster;
-import com.ciscowebex.androidsdk.kitchensink.models.DaoSession;
-
-import org.greenrobot.greendao.database.Database;
-
-/**
- * Created on 18/09/2017.
- */
-
-public class KitchenSinkApp extends Application {
-
- private static KitchenSinkApp application;
- private static DaoSession daoSession;
-
- @Override
- public void onCreate() {
- super.onCreate();
- application = this;
- DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "call-history-db");
- Database db = helper.getWritableDb();
- daoSession = new DaoMaster(db).newSession();
- }
-
- public static KitchenSinkApp getApplication() {
- return application;
- }
-
- public static DaoSession getDaoSession() {
- return daoSession;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/EventPubCallObserver.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/EventPubCallObserver.java
deleted file mode 100644
index caa9355..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/EventPubCallObserver.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions;
-
-import com.ciscowebex.androidsdk.internal.reachability.BackgroundChecker;
-import com.ciscowebex.androidsdk.internal.reachability.ForegroundChecker;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnCallMembershipEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnConnectEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnDisconnectEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnScheduleChangedEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnWaitingEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnMediaChangeEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnRingingEvent;
-import com.ciscowebex.androidsdk.phone.Call;
-import com.ciscowebex.androidsdk.phone.CallObserver;
-import com.ciscowebex.androidsdk.utils.Utils;
-
-import org.greenrobot.eventbus.EventBus;
-
-
-/**
- * Created on 18/09/2017.
- */
-
-public class EventPubCallObserver implements CallObserver {
- @Override
- public void onRinging(Call call) {
- postEvent(new OnRingingEvent(call));
- }
-
- @Override
- public void onConnected(Call call) {
- postEvent(new OnConnectEvent(call));
- }
-
- @Override
- public void onDisconnected(CallDisconnectedEvent callDisconnectedEvent) {
- postEvent(new OnDisconnectEvent(callDisconnectedEvent));
- }
-
- @Override
- public void onMediaChanged(MediaChangedEvent mediaChangedEvent) {
- postEvent(new OnMediaChangeEvent(mediaChangedEvent));
- }
-
- @Override
- public void onCallMembershipChanged(CallMembershipChangedEvent event) {
- postEvent(new OnCallMembershipEvent(event));
- }
-
- @Override
- public void onScheduleChanged(Call call) {
- postEvent(new OnScheduleChangedEvent(call));
- }
-
- @Override
- public void onWaiting(Call call, Call.WaitReason waitReason) {
- postEvent(new OnWaitingEvent(call, waitReason));
- }
-
- private void postEvent(Object event) {
- if (ForegroundChecker.getInstance().isForeground()) {
- EventBus.getDefault().post(event);
- } else {
- EventBus.getDefault().postSticky(event);
- }
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/IAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/IAction.java
deleted file mode 100644
index b35eb12..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/IAction.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions;
-
-/**
- * Created on 19/09/2017.
- */
-
-public interface IAction {
- void execute();
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/WebexAgent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/WebexAgent.java
deleted file mode 100644
index d73b922..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/WebexAgent.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions;
-
-import android.net.Uri;
-import android.support.annotation.Nullable;
-import android.util.Pair;
-import android.view.View;
-
-import com.ciscowebex.androidsdk.CompletionHandler;
-import com.ciscowebex.androidsdk.Result;
-import com.ciscowebex.androidsdk.Webex;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.AnswerEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.DialEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.HangupEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.LoginEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnIncomingCallEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.RejectEvent;
-import com.ciscowebex.androidsdk.membership.MembershipClient;
-import com.ciscowebex.androidsdk.message.MessageClient;
-import com.ciscowebex.androidsdk.message.RemoteFile;
-import com.ciscowebex.androidsdk.phone.Call;
-import com.ciscowebex.androidsdk.phone.CallObserver;
-import com.ciscowebex.androidsdk.phone.MediaOption;
-import com.ciscowebex.androidsdk.phone.Phone;
-import com.ciscowebex.androidsdk.space.SpaceClient;
-
-import java.io.File;
-
-import static com.ciscowebex.androidsdk.kitchensink.actions.events.WebexAgentEvent.postEvent;
-
-
-/**
- * Created on 13/09/2017.
- */
-
-public class WebexAgent {
-
- public enum CallCap {AUDIO_ONLY, AUDIO_VIDEO}
-
- public enum CameraCap {FRONT, BACK, CLOSE}
-
- private Webex webex;
- private Phone phone;
- private Call activeCall;
- private Call incomingCall;
- private boolean isSpeakerOn = true;
- private boolean isDialing = false;
-
- private static WebexAgent instance;
- private final CallObserver callObserver = new EventPubCallObserver();
- private CallCap callCap = CallCap.AUDIO_VIDEO;
- private CameraCap cameraCap = CameraCap.FRONT;
-
- public static WebexAgent getInstance() {
- if (instance == null) {
- instance = new WebexAgent();
- }
- return instance;
- }
-
- public Webex getWebex() {
- return webex;
- }
-
- public void setWebex(Webex webex) {
- this.webex = webex;
- //this.webex.setLogLevel(Webex.LogLevel.ALL);
- }
-
- public Phone getPhone() {
- return phone;
- }
-
- public Call getActiveCall() {
- return activeCall;
- }
-
- public boolean getSpeakerPhoneOn() {
- return isSpeakerOn;
- }
-
- public void setSpeakerPhoneOn(boolean on) {
- isSpeakerOn = on;
- }
-
- public void setMaxBandWidth(int maxBandWidth) {
- if (phone != null) {
- phone.setVideoMaxBandwidth(maxBandWidth);
- }
- }
-
- public int getMaxBandWidth() {
- if (phone != null) {
- return phone.getVideoMaxBandwidth();
- }
- return -1;
- }
-
- public void register() {
- phone = webex.phone();
- phone.register(r -> {
- if (r.isSuccessful()) {
- setupIncomingCallListener();
- }
- new LoginEvent(r).post();
- });
- }
-
- private void setupIncomingCallListener() {
- phone.setIncomingCallListener(call -> {
- incomingCall = call;
- incomingCall.setObserver(callObserver);
- postEvent(new OnIncomingCallEvent(call));
- });
- }
-
- public void getMembership(String roomId, CompletionHandler handler) {
- MembershipClient client = webex.memberships();
- client.list(roomId, null, null, 0, handler);
- }
-
- public boolean isCallIncoming() {
- return incomingCall != null && !incomingCall.getStatus().equals(Call.CallStatus.DISCONNECTED);
- }
-
- public void setCallCapability(CallCap cap) {
- callCap = cap;
- }
-
- public CallCap getCallCapability() {
- return callCap;
- }
-
- public MessageClient getMessageClient() {
- return webex.messages();
- }
-
- public SpaceClient getSpaceClient() {
- return webex.spaces();
- }
-
- public MembershipClient getMembershipClient() {
- return webex.memberships();
- }
-
- public void downloadThumbnail(RemoteFile file, File saveTo, MessageClient.ProgressHandler handler, CompletionHandler completionHandler) {
- getMessageClient().downloadThumbnail(file, saveTo, handler, completionHandler);
- }
-
- public void downloadFile(RemoteFile file, File saveTo, MessageClient.ProgressHandler handler, CompletionHandler completionHandler) {
- getMessageClient().downloadFile(file, saveTo, handler, completionHandler);
- }
-
- public void dial(String callee, View localView, View remoteView, View screenSharing, boolean isModerator, @Nullable String pin) {
- isDialing = true;
- phone.dial(callee, getMediaOption(localView, remoteView, screenSharing, isModerator, pin), (Result result) -> {
- if (result.isSuccessful()) {
- activeCall = result.getData();
- if (!isDialing || activeCall == null) {
- hangup();
- } else {
- activeCall.setObserver(callObserver);
- }
- }
- isDialing = false;
- new DialEvent(result).post();
- });
- }
-
- private MediaOption getMediaOption(View localView, View remoteView, View screenSharing, boolean isModerator, String pin) {
- MediaOption mediaOption;
- if (callCap.equals(CallCap.AUDIO_ONLY))
- mediaOption = MediaOption.audioOnly();
- else
- mediaOption = MediaOption.audioVideoSharing(new Pair<>(localView, remoteView), screenSharing);
- mediaOption.setModerator(isModerator);
- mediaOption.setPin(pin);
- return mediaOption;
- }
-
- public void reject() {
- incomingCall.reject(r -> new RejectEvent(r).post());
- incomingCall = null;
- }
-
- public void hangup() {
- isDialing = false;
- if (activeCall != null) {
- activeCall.hangup(r -> new HangupEvent(r).post());
- activeCall = null;
- }
- }
-
- public void answer(View localView, View remoteView, View screenShare, boolean isModerator, @Nullable String pin) {
- if (isCallIncoming()) {
- activeCall = incomingCall;
- incomingCall = null;
- activeCall.setObserver(callObserver);
- activeCall.answer(getMediaOption(localView, remoteView, screenShare, isModerator, pin), r -> new AnswerEvent(r).post());
- }
- }
-
- public void setVideoRenderViews(@Nullable Pair videoRenderViews) {
- activeCall.setVideoRenderViews(videoRenderViews);
- }
-
- public void startPreview(View view) {
- cameraCap = getDefaultCamera();
- phone.startPreview(view);
- }
-
- public void stopPreview() {
- phone.stopPreview();
- }
-
- public void setFrontCamera() {
- if (activeCall != null) activeCall.setFacingMode(Phone.FacingMode.USER);
- }
-
- public void setBackCamera() {
- if (activeCall != null) activeCall.setFacingMode(Phone.FacingMode.ENVIROMENT);
- }
-
- public void setDefaultCamera(CameraCap cap) {
- cameraCap = cap;
- switch (cap) {
- case FRONT:
- phone.setDefaultFacingMode(Phone.FacingMode.USER);
- break;
- case BACK:
- phone.setDefaultFacingMode(Phone.FacingMode.ENVIROMENT);
- break;
- case CLOSE:
- break;
- }
- }
-
- public CameraCap getDefaultCamera() {
- if (cameraCap.equals(CameraCap.CLOSE))
- return CameraCap.CLOSE;
- if (phone.getDefaultFacingMode().equals(Phone.FacingMode.USER))
- return CameraCap.FRONT;
- else
- return CameraCap.BACK;
- }
-
- public void sendVideo(boolean b) {
- if (activeCall != null)
- activeCall.setSendingVideo(b);
- }
-
- public void sendAudio(boolean b) {
- if (activeCall != null)
- activeCall.setSendingAudio(b);
- }
-
- public void receiveVideo(boolean b) {
- if (activeCall != null)
- activeCall.setReceivingVideo(b);
- }
-
- public void receiveAudio(boolean b) {
- if (activeCall != null)
- activeCall.setReceivingAudio(b);
- }
-
- public boolean isSendingVideo() {
- if (activeCall != null)
- return activeCall.isSendingVideo();
- return false;
- }
-
- public boolean isSendingAudio() {
- if (activeCall != null)
- return activeCall.isSendingAudio();
- return false;
- }
-
- public boolean isReceivingVideo() {
- if (activeCall != null)
- return activeCall.isReceivingVideo();
- return false;
- }
-
- public boolean isReceivingAudio() {
- if (activeCall != null)
- return activeCall.isReceivingAudio();
- return false;
- }
-
- public boolean isScreenSharing() {
- if (activeCall != null) {
- return activeCall.isRemoteSendingSharing();
- }
- return false;
- }
-
- public void enableAudioBNR(boolean enable) {
- if (phone != null) {
- phone.enableAudioBNR(enable);
- }
- }
-
- public boolean isAudioBNREnable() {
- if (phone != null) {
- return phone.isAudioBNREnable();
- }
- return false;
- }
-
- public void setAudioBNRMode(Phone.AudioBRNMode mode) {
- if (phone != null) {
- phone.setAudioBNRMode(mode);
- }
- }
-
- public Phone.AudioBRNMode getAudioBNRMode() {
- if (phone != null) {
- return phone.getAudioBNRMode();
- }
- return null;
- }
-
- public void setVideoStreamMode(Phone.VideoStreamMode mode) {
- if (phone != null) {
- phone.setVideoStreamMode(mode);
- }
- }
-
- public Phone.VideoStreamMode getVideoStreamMode() {
- if (phone != null) {
- return phone.getVideoStreamMode();
- }
- return null;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AddCallHistoryAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AddCallHistoryAction.java
deleted file mode 100644
index ed23142..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AddCallHistoryAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.models.CallHistory;
-import com.ciscowebex.androidsdk.kitchensink.models.CallHistoryDao;
-import com.ciscowebex.androidsdk.kitchensink.models.DaoSession;
-import com.ciscowebex.androidsdk.people.Person;
-import com.ciscowebex.androidsdk.kitchensink.KitchenSinkApp;
-
-import java.util.Date;
-import java.util.List;
-
-import static com.ciscowebex.androidsdk.kitchensink.KitchenSinkApp.getApplication;
-
-/**
- * Created on 22/09/2017.
- */
-
-public class AddCallHistoryAction implements IAction {
- CallHistory history;
- CallHistoryDao dao;
-
- public AddCallHistoryAction(String email, String direction) {
- DaoSession daoSession = getApplication().getDaoSession();
- dao = daoSession.getCallHistoryDao();
-
- history = new CallHistory();
- history.setEmail(email);
- history.setDirection(direction);
- history.setDate(new Date());
- }
-
- @Override
- public void execute() {
- WebexAgent agent = WebexAgent.getInstance();
- agent.getWebex().people().list(history.getEmail(), null, 1, result -> {
- if (result.isSuccessful()) {
- List personList = result.getData();
- if (personList.size() > 0) {
- history.setPerson(personList.get(0).toString());
- dao.update(history);
- }
- }
- });
- dao.insert(history);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AppIdLoginAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AppIdLoginAction.java
deleted file mode 100644
index 1d00ef4..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/AppIdLoginAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.Webex;
-import com.ciscowebex.androidsdk.auth.JWTAuthenticator;
-import com.ciscowebex.androidsdk.kitchensink.KitchenSinkApp;
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-
-/**
- * Created on 19/09/2017.
- */
-
-public class AppIdLoginAction implements IAction {
- private String jwt;
-
- public AppIdLoginAction(String jwt) {
- this.jwt = jwt;
- }
-
- @Override
- public void execute() {
- JWTAuthenticator jwtAuthenticator = new JWTAuthenticator();
- Webex webex = new Webex(KitchenSinkApp.getApplication(), jwtAuthenticator);
- WebexAgent.getInstance().setWebex(webex);
- jwtAuthenticator.authorize(jwt);
- new RegisterAction(jwtAuthenticator).execute();
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/LogoutAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/LogoutAction.java
deleted file mode 100644
index 1c5098f..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/LogoutAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.WebexError;
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.LogoutEvent;
-
-/**
- * Created on 19/09/2017.
- */
-
-public class LogoutAction implements IAction {
- @Override
- public void execute() {
- WebexAgent agent = WebexAgent.getInstance();
- agent.getPhone().deregister(r -> {
- if (r.isSuccessful() || (r.getError()!= null && r.getError().getErrorCode() == WebexError.ErrorCode.NETWORK_ERROR.getCode()))
- agent.getWebex().getAuthenticator().deauthorize();
- new LogoutEvent(r).post();
- });
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RegisterAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RegisterAction.java
deleted file mode 100644
index 39a488c..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RegisterAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.auth.Authenticator;
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-
-/**
- * Created on 26/09/2017.
- */
-
-public class RegisterAction implements IAction {
- Authenticator authenticator;
-
- public RegisterAction(Authenticator auth) {
- this.authenticator = auth;
- }
-
- @Override
- public void execute() {
- WebexAgent.getInstance().register();
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RequirePermissionAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RequirePermissionAction.java
deleted file mode 100644
index 5a5705e..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/RequirePermissionAction.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.pm.PackageManager;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.content.ContextCompat;
-
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.PermissionAcquiredEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.WebexAgentEvent;
-
-/**
- * Created on 30/09/2017.
- */
-
-public class RequirePermissionAction implements IAction {
- Activity activity;
-
- public RequirePermissionAction(Activity activity) {
- this.activity = activity;
- }
-
- @Override
- public void execute() {
- String[] permissions = {
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Manifest.permission.CAMERA
- };
- for (String permission : permissions) {
- int permissionCheck = ContextCompat.checkSelfPermission(activity, permission);
- if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(activity, permissions, 0);
- return;
- }
- }
- WebexAgentEvent.postEvent(new PermissionAcquiredEvent());
- }
-
- public static void PermissionsRequired(int requestCode, int[] grantResults) {
- if (requestCode == 0) {
- for (int grant : grantResults) {
- if (grant != PackageManager.PERMISSION_GRANTED) {
- return;
- }
- }
- WebexAgentEvent.postEvent(new PermissionAcquiredEvent());
- }
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchPeopleAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchPeopleAction.java
deleted file mode 100644
index 14a2b7a..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchPeopleAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.SearchPersonCompleteEvent;
-
-/**
- * Created on 19/09/2017.
- */
-
-public class SearchPeopleAction implements IAction {
- private String email;
- private String name;
-
- public SearchPeopleAction(String email, String name) {
- this.email = email;
- this.name = name;
- }
-
- @Override
- public void execute() {
- WebexAgent agent = WebexAgent.getInstance();
- agent.getWebex().people().list(email, name, 10,
- result -> new SearchPersonCompleteEvent(result).post());
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchSpaceAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchSpaceAction.java
deleted file mode 100644
index 836e705..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/SearchSpaceAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.SearchActiveSpaceCompleteEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.SearchSpaceCompleteEvent;
-import com.ciscowebex.androidsdk.space.SpaceClient;
-
-
-public class SearchSpaceAction implements IAction {
- @Override
- public void execute() {
- WebexAgent agent = WebexAgent.getInstance();
- agent.getWebex().spaces().list(null, 0, null, SpaceClient.SortBy.LASTACTIVITY, result -> {
- new SearchSpaceCompleteEvent(result).post();
- agent.getWebex().spaces().listWithActiveCalls(r ->
- new SearchActiveSpaceCompleteEvent(r).post());
- });
-
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/ToggleSpeakerAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/ToggleSpeakerAction.java
deleted file mode 100644
index 5d62646..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/ToggleSpeakerAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import android.bluetooth.BluetoothAdapter;
-import android.content.Context;
-
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.phone.Call;
-import com.ciscowebex.androidsdk.phone.internal.CallImpl;
-
-
-/**
- * Created on 19/09/2017.
- */
-
-public class ToggleSpeakerAction implements IAction {
- private boolean on;
- private Context context;
- private CallImpl call;
-
- public ToggleSpeakerAction(Context context, CallImpl call, boolean on) {
- this.context = context;
- this.on = on;
- this.call = call;
- }
-
- @Override
- public void execute() {
- if (call != null) {
- android.media.AudioManager am = (android.media.AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
- if (on) {
- call.switchAudioOutput(Call.AudioOutputMode.SPEAKER);
- } else {
- if (isBluetoothHeadsetConnected()) {
- call.switchAudioOutput(Call.AudioOutputMode.BLUETOOTH_HEADSET);
- } else if (am.isWiredHeadsetOn()) {
- call.switchAudioOutput(Call.AudioOutputMode.HEADSET);
- } else {
- call.switchAudioOutput(Call.AudioOutputMode.PHONE);
- }
- }
- }
-
- WebexAgent.getInstance().setSpeakerPhoneOn(on);
- }
-
- private boolean isBluetoothHeadsetConnected() {
- return BluetoothAdapter.getDefaultAdapter().getProfileConnectionState(android.bluetooth.BluetoothProfile.HEADSET)
- != android.bluetooth.BluetoothProfile.STATE_DISCONNECTED;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/WebexIdLoginAction.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/WebexIdLoginAction.java
deleted file mode 100644
index 4d031ed..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/commands/WebexIdLoginAction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.commands;
-
-import android.webkit.WebView;
-
-import com.ciscowebex.androidsdk.Webex;
-import com.ciscowebex.androidsdk.auth.OAuthWebViewAuthenticator;
-import com.ciscowebex.androidsdk.kitchensink.BuildConfig;
-import com.ciscowebex.androidsdk.kitchensink.actions.IAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.LoginEvent;
-import com.ciscowebex.androidsdk.kitchensink.KitchenSinkApp;
-
-/**
- * Created on 19/09/2017.
- */
-
-public class WebexIdLoginAction implements IAction {
-
- private WebView view;
-
- private static final String clientId = BuildConfig.CLIENT_ID;
-
- private static final String clientSec = BuildConfig.CLIENT_SEC;
-
- private static final String redirect = BuildConfig.REDIRECT_URL;
-
- private static final String scope = BuildConfig.SCOPE;
-
-
- public WebexIdLoginAction(WebView view) {
- this.view = view;
- }
-
- @Override
- public void execute() {
- OAuthWebViewAuthenticator oAuth2;
- oAuth2 = new OAuthWebViewAuthenticator(clientId, clientSec, scope, redirect);
- Webex webex = new Webex(KitchenSinkApp.getApplication(), oAuth2);
- WebexAgent.getInstance().setWebex(webex);
- if (oAuth2.isAuthorized()) {
- new RegisterAction(oAuth2).execute();
- } else {
- oAuth2.authorize(view, result -> {
- if (result.isSuccessful()) {
- new RegisterAction(oAuth2).execute();
- } else {
- new LoginEvent(result).post();
- }
- });
- }
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/AnswerEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/AnswerEvent.java
deleted file mode 100644
index 55eb6cc..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/AnswerEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-public class AnswerEvent extends WebexAgentEvent {
- public AnswerEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/DialEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/DialEvent.java
deleted file mode 100644
index 8d15d5c..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/DialEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class DialEvent extends WebexAgentEvent {
- public DialEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/HangupEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/HangupEvent.java
deleted file mode 100644
index 13cf387..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/HangupEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class HangupEvent extends WebexAgentEvent {
- public HangupEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LoginEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LoginEvent.java
deleted file mode 100644
index f178e39..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LoginEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class LoginEvent extends WebexAgentEvent {
-
- public LoginEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LogoutEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LogoutEvent.java
deleted file mode 100644
index ce879a4..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/LogoutEvent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class LogoutEvent extends WebexAgentEvent {
-
- public LogoutEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnAuxStreamEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnAuxStreamEvent.java
deleted file mode 100644
index 2300a73..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnAuxStreamEvent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.MultiStreamObserver;
-
-/**
- * Created by qimdeng on 8/10/18.
- */
-
-public class OnAuxStreamEvent {
- public MultiStreamObserver.AuxStreamChangedEvent callEvent;
-
- public OnAuxStreamEvent(MultiStreamObserver.AuxStreamChangedEvent event) {
- this.callEvent = event;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnCallMembershipEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnCallMembershipEvent.java
deleted file mode 100644
index fb04672..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnCallMembershipEvent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.CallObserver;
-
-/**
- * Created by qimdeng on 3/13/18.
- */
-
-public class OnCallMembershipEvent {
- public CallObserver.CallMembershipChangedEvent callEvent;
-
- public OnCallMembershipEvent(CallObserver.CallMembershipChangedEvent event) {
- this.callEvent = event;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnConnectEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnConnectEvent.java
deleted file mode 100644
index 06abc3d..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnConnectEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnConnectEvent {
- public Call call;
-
- public OnConnectEvent(Call call) {
- this.call = call;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnDisconnectEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnDisconnectEvent.java
deleted file mode 100644
index cecf648..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnDisconnectEvent.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-import com.ciscowebex.androidsdk.phone.CallObserver.CallDisconnectedEvent;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnDisconnectEvent {
- CallDisconnectedEvent callEvent;
-
- public OnDisconnectEvent(CallDisconnectedEvent event) {
- this.callEvent = event;
- }
-
- public Call getCall() {
- return callEvent != null ? callEvent.getCall() : null;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnErrorEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnErrorEvent.java
deleted file mode 100644
index 00a7e10..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnErrorEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.WebexError;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnErrorEvent {
- public OnErrorEvent(WebexError e) {
-
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnIncomingCallEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnIncomingCallEvent.java
deleted file mode 100644
index 0efa5d0..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnIncomingCallEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnIncomingCallEvent {
- public Call call;
-
- public OnIncomingCallEvent(Call call) {
- this.call = call;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnMediaChangeEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnMediaChangeEvent.java
deleted file mode 100644
index 882dc70..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnMediaChangeEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.CallObserver.MediaChangedEvent;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnMediaChangeEvent {
- public MediaChangedEvent callEvent;
-
- public OnMediaChangeEvent(MediaChangedEvent event) {
- this.callEvent = event;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnRingingEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnRingingEvent.java
deleted file mode 100644
index 0b72cdc..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnRingingEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnRingingEvent {
- public Call call;
-
- public OnRingingEvent(Call call) {
- this.call = call;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnScheduleChangedEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnScheduleChangedEvent.java
deleted file mode 100644
index 44a16b5..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnScheduleChangedEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2021 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-
-/**
- * Created on 24/09/2020.
- */
-
-public class OnScheduleChangedEvent {
- public Call call;
-
- public OnScheduleChangedEvent(Call call) {
- this.call = call;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnWaitingEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnWaitingEvent.java
deleted file mode 100644
index 32da969..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/OnWaitingEvent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.phone.Call;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class OnWaitingEvent {
- public Call call;
- public Call.WaitReason waitReason;
-
- public OnWaitingEvent(Call call, Call.WaitReason waitReason) {
- this.call = call;
- this.waitReason = waitReason;
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/PermissionAcquiredEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/PermissionAcquiredEvent.java
deleted file mode 100644
index e522b67..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/PermissionAcquiredEvent.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-/**
- * Created on 30/09/2017.
- */
-
-public class PermissionAcquiredEvent {
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/RejectEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/RejectEvent.java
deleted file mode 100644
index e59d915..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/RejectEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 15/09/2017.
- */
-
-public class RejectEvent extends WebexAgentEvent {
- public RejectEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchActiveSpaceCompleteEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchActiveSpaceCompleteEvent.java
deleted file mode 100644
index 6fe91c3..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchActiveSpaceCompleteEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2016-2021 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-public class SearchActiveSpaceCompleteEvent extends WebexAgentEvent {
- public SearchActiveSpaceCompleteEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchPersonCompleteEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchPersonCompleteEvent.java
deleted file mode 100644
index 63187ac..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchPersonCompleteEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-/**
- * Created on 18/09/2017.
- */
-
-public class SearchPersonCompleteEvent extends WebexAgentEvent {
- public SearchPersonCompleteEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchSpaceCompleteEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchSpaceCompleteEvent.java
deleted file mode 100644
index a34b9aa..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/SearchSpaceCompleteEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-import com.ciscowebex.androidsdk.Result;
-
-public class SearchSpaceCompleteEvent extends WebexAgentEvent {
- public SearchSpaceCompleteEvent(Result result) {
- super(result);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/WebexAgentEvent.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/WebexAgentEvent.java
deleted file mode 100644
index 1ae0b3d..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/actions/events/WebexAgentEvent.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.actions.events;
-
-
-import com.ciscowebex.androidsdk.Result;
-import com.ciscowebex.androidsdk.WebexError;
-
-import org.greenrobot.eventbus.EventBus;
-
-
-/**
- * Created on 15/09/2017.
- */
-
-public class WebexAgentEvent {
- Result result;
-
- public WebexAgentEvent(Result result) {
- this.result = result;
- }
-
- public boolean isSuccessful() {
- return result.isSuccessful();
- }
-
- public WebexError getError() {
- return result.getError();
- }
-
- public Result getResult() {
- return result;
- }
-
- public static void postEvent(Object event) {
- EventBus.getDefault().post(event);
- }
-
- public void post() {
- postEvent(this);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/LauncherActivity.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/LauncherActivity.java
deleted file mode 100644
index 9637490..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/LauncherActivity.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher;
-
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.NotificationManager;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.widget.Switch;
-import android.widget.Toast;
-
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.RequirePermissionAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnCallMembershipEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnMediaChangeEvent;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.CallFragment;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.LauncherFragment;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-import com.ciscowebex.androidsdk.phone.CallObserver;
-import com.github.benoitdion.ln.Ln;
-
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-
-import java.util.List;
-
-
-public class LauncherActivity extends Activity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_launcher);
- BaseFragment fragment = new LauncherFragment();
- replace(fragment);
- EventBus.getDefault().register(this);
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- EventBus.getDefault().unregister(this);
- }
-
- @Override
- public void onBackPressed() {
- goBackStack();
- }
-
- public void goBackStack() {
- FragmentManager manager = getFragmentManager();
- BaseFragment fm = (BaseFragment) getFragment();
- fm.onBackPressed();
- if (manager.getBackStackEntryCount() == 1) {
- manager.popBackStackImmediate();
- super.onBackPressed();
- } else {
- //manager.popBackStackImmediate();
- startActivity(new Intent(this, LauncherActivity.class));
- finish();
- }
- }
-
- public void replace(BaseFragment fragment) {
- fragment.replace(this, R.id.launcher);
- }
-
- public Fragment getFragment() {
- return getFragmentManager().findFragmentById(R.id.launcher);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- }
-
- @Override
- public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
- RequirePermissionAction.PermissionsRequired(requestCode, grantResults);
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnMediaChangeEvent event) {
- Ln.d("OnMediaChangeEvent: " + event.callEvent);
- if (event.callEvent instanceof CallObserver.SendingSharingEvent) {
- Ln.d("Activity SendingSharingEvent: " + ((CallObserver.SendingSharingEvent) event.callEvent).isSending());
- if (!((CallObserver.SendingSharingEvent) event.callEvent).isSending()) {
- cancelNotification();
- moveToFront();
- updateSharingSwitch(false);
- Toast.makeText(this, "Stop to share content", Toast.LENGTH_SHORT).show();
- }
- }
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnCallMembershipEvent event) {
- if (event.callEvent instanceof CallObserver.MembershipSendingSharingEvent) {
- Ln.d("Activity CallMembership displayName: " + event.callEvent.getCallMembership().getDisplayName() +
- " isSendingSharing: " + event.callEvent.getCallMembership().isSendingSharing());
- }
- }
-
- protected void moveToFront() {
- final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
- final List recentTasks = activityManager.getRunningTasks(Integer.MAX_VALUE);
-
- for (int i = 0; i < recentTasks.size(); i++) {
- // bring to front
- if (recentTasks.get(i).baseActivity.toShortString().indexOf("com.ciscowebex.androidsdk.kitchensink") > -1) {
- activityManager.moveTaskToFront(recentTasks.get(i).id, ActivityManager.MOVE_TASK_WITH_HOME);
- }
- }
- }
-
- private void cancelNotification() {
- NotificationManager notifyManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
- notifyManager.cancel(1);
- }
-
- private void updateSharingSwitch(boolean flag) {
- Switch shareSwitch = (Switch) findViewById(R.id.switchShareContent);
- if (shareSwitch != null && shareSwitch.isChecked())
- shareSwitch.setChecked(flag);
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFeedbackFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFeedbackFragment.java
deleted file mode 100644
index cd11c48..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFeedbackFragment.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.launcher.LauncherActivity;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-
-import butterknife.OnClick;
-
-/**
- * A simple {@link BaseFragment} subclass.
- */
-public class CallFeedbackFragment extends BaseFragment {
-
-
- public CallFeedbackFragment() {
- // Required empty public constructor
- setLayout(R.layout.fragment_call_feedback);
- }
-
- @OnClick(R.id.sendFeedback)
- public void sendFeedback() {
- ((LauncherActivity) getActivity()).goBackStack();
- }
-
- @OnClick(R.id.cancelFeedback)
- public void cancelFeedback() {
- ((LauncherActivity) getActivity()).goBackStack();
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFragment.java
deleted file mode 100644
index d3ff202..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/CallFragment.java
+++ /dev/null
@@ -1,1070 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-
-import android.app.AlertDialog;
-import android.app.AppOpsManager;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.app.PictureInPictureParams;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.content.pm.PackageManager;
-import android.content.res.Configuration;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Binder;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.provider.Settings;
-import android.support.annotation.RequiresApi;
-import android.support.constraint.ConstraintLayout;
-import android.support.design.widget.Snackbar;
-import android.support.v4.app.NotificationCompat;
-import android.support.v7.widget.RecyclerView;
-import android.text.TextUtils;
-import android.util.Pair;
-import android.util.Rational;
-import android.view.LayoutInflater;
-import android.view.SurfaceView;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.GridLayout;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.RadioButton;
-import android.widget.Switch;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.ciscowebex.androidsdk.WebexError;
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.AddCallHistoryAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.RequirePermissionAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.ToggleSpeakerAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.AnswerEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.DialEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.HangupEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnAuxStreamEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnCallMembershipEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnConnectEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnDisconnectEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnMediaChangeEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnRingingEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.OnWaitingEvent;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.PermissionAcquiredEvent;
-import com.ciscowebex.androidsdk.kitchensink.launcher.LauncherActivity;
-import com.ciscowebex.androidsdk.kitchensink.service.AwakeService;
-import com.ciscowebex.androidsdk.kitchensink.service.FloatWindowService;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-import com.ciscowebex.androidsdk.kitchensink.ui.FullScreenSwitcher;
-import com.ciscowebex.androidsdk.kitchensink.ui.ParticipantsAdapter;
-import com.ciscowebex.androidsdk.people.Person;
-import com.ciscowebex.androidsdk.phone.AuxStream;
-import com.ciscowebex.androidsdk.phone.CallMembership;
-import com.ciscowebex.androidsdk.phone.CallObserver;
-import com.ciscowebex.androidsdk.phone.MediaRenderView;
-import com.ciscowebex.androidsdk.phone.MultiStreamObserver;
-import com.ciscowebex.androidsdk.phone.internal.CallImpl;
-import com.github.benoitdion.ln.Ln;
-import com.squareup.picasso.Picasso;
-
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-
-import butterknife.BindView;
-import butterknife.OnCheckedChanged;
-import butterknife.OnClick;
-
-import static com.ciscowebex.androidsdk.kitchensink.actions.events.WebexAgentEvent.postEvent;
-import static com.ciscowebex.androidsdk.phone.CallObserver.RemoteSendingSharingEvent;
-import static com.ciscowebex.androidsdk.phone.CallObserver.SendingSharingEvent;
-
-/**
- * A simple {@link BaseFragment} subclass.
- */
-public class CallFragment extends BaseFragment {
- protected static final int MEDIA_PROJECTION_REQUEST = 2;
- private static final String CALLEE = "callee";
- private static final String INCOMING_CALL = "incoming";
- private WebexAgent agent;
- private FullScreenSwitcher screenSwitcher;
- private boolean isConnected = false;
- private HashMap mAuxStreamViewMap = new HashMap<>();
- private HashMap mIdPersonMap = new HashMap<>();
- private boolean isFloatingBind = false;
-
- @BindView(R.id.localView)
- View localView;
-
- @BindView(R.id.remoteView)
- View remoteView;
-
- @BindView(R.id.viewRemoteAvatar)
- ImageView remoteAvatar;
-
- @BindView(R.id.screenShare)
- View screenShare;
-
- @BindView(R.id.view_call_control)
- View viewCallControl;
-
- @BindView(R.id.view_aux_videos_container)
- View viewAuxVideosContainer;
-
- @BindView(R.id.view_aux_videos)
- GridLayout viewAuxVideos;
-
- @BindView(R.id.view_participants)
- RecyclerView viewParticipants;
-
- @BindView(R.id.buttonHangup)
- Button buttonHangup;
-
- @BindView(R.id.buttonDTMF)
- Button buttonDTMF;
-
- @BindView(R.id.switchLoudSpeaker)
- Switch switchLoudSpeaker;
-
- @BindView(R.id.switchSendVideo)
- Switch switchSendingVideo;
-
- @BindView(R.id.switchSendAudio)
- Switch switchSendingAudio;
-
- @BindView(R.id.switchReceiveVideo)
- Switch switchReceiveVideo;
-
- @BindView(R.id.switchReceiveAudio)
- Switch switchReceiveAudio;
-
- @BindView(R.id.radioFrontCam)
- RadioButton radioFrontCam;
-
- @BindView(R.id.radioBackCam)
- RadioButton radioBackCam;
-
- @BindView(R.id.call_layout)
- ConstraintLayout layout;
-
- @BindView(R.id.switchShareContent)
- Switch switchShareContent;
-
- @BindView(R.id.keypad)
- View keypad;
-
- @BindView(R.id.floatButton)
- ImageView floatButton;
-
- @BindView(R.id.tab_callcontrol)
- TextView tabCallControl;
-
- @BindView(R.id.tab_aux_video)
- TextView tabAuxVideo;
-
- @BindView(R.id.tab_participants)
- TextView tabParticipants;
-
- private ParticipantsAdapter participantsAdapter;
- private Snackbar snackbar;
-
- // Required empty public constructor
-
- class AuxStreamViewHolder {
- View item;
- MediaRenderView mediaRenderView;
- ImageView viewAvatar;
- TextView textView;
-
- AuxStreamViewHolder(View item) {
- this.item = item;
- this.mediaRenderView = item.findViewById(R.id.view_video);
- this.viewAvatar = item.findViewById(R.id.view_avatar);
- this.textView = item.findViewById(R.id.name);
- }
- }
-
- public CallFragment() {
- }
-
- public static CallFragment newAnswerCallInstance() {
- return CallFragment.newInstance(INCOMING_CALL);
- }
-
- public static CallFragment newInstance(String id) {
- CallFragment fragment = new CallFragment();
- Bundle args = new Bundle();
- args.putInt(LAYOUT, R.layout.fragment_call);
- args.putString(CALLEE, id);
- fragment.setArguments(args);
- return fragment;
- }
-
- @Override
- public void onStart() {
- super.onStart();
- Drawable drawableCallControl = getResources().getDrawable(R.drawable.ic_file_word, null);
- Drawable drawableAuxVideo = getResources().getDrawable(R.drawable.ic_file_excel, null);
- Drawable drawableParticipants = getResources().getDrawable(R.drawable.ic_file_zip, null);
- Rect bounds = new Rect(0, 0, 120, 120);
- drawableCallControl.setBounds(bounds);
- drawableAuxVideo.setBounds(bounds);
- drawableParticipants.setBounds(bounds);
- tabCallControl.setCompoundDrawables(null, drawableCallControl, null, null);
- tabAuxVideo.setCompoundDrawables(null, drawableAuxVideo, null, null);
- tabParticipants.setCompoundDrawables(null, drawableParticipants, null, null);
-
- agent = WebexAgent.getInstance();
- screenSwitcher = new FullScreenSwitcher(getActivity(), layout, remoteView);
- updateScreenShareView();
- if (participantsAdapter == null) {
- participantsAdapter = new ParticipantsAdapter(null);
- participantsAdapter.setOnLetInClickListener(new ParticipantsAdapter.OnLetInClickListener() {
- @Override
- public void onLetInClick(ParticipantsAdapter.CallMembershipEntity entity) {
- for (CallMembership callMembership : agent.getActiveCall().getMemberships()) {
- if (callMembership.getPersonId().equals(entity.getPersonId())) {
- agent.getActiveCall().letIn(callMembership);
- break;
- }
- }
-
- }
- });
- viewParticipants.setAdapter(participantsAdapter);
- }
- if (!isConnected) {
- setViewAndChildrenEnabled(layout, false);
- ((SurfaceView) localView).setZOrderMediaOverlay(true);
- ((SurfaceView) screenShare).setZOrderMediaOverlay(true);
- requirePermission();
- }
- }
-
- private static void setViewAndChildrenEnabled(View view, boolean enabled) {
- view.setEnabled(enabled);
- if (view instanceof ViewGroup) {
- ViewGroup viewGroup = (ViewGroup) view;
- for (int i = 0; i < viewGroup.getChildCount(); i++) {
- View child = viewGroup.getChildAt(i);
- setViewAndChildrenEnabled(child, enabled);
- }
- }
- }
-
- private void setupWidgetStates() {
- switch (agent.getDefaultCamera()) {
- case FRONT:
- radioFrontCam.setChecked(true);
- break;
- case BACK:
- radioBackCam.setChecked(true);
- break;
- case CLOSE:
- localView.setVisibility(View.GONE);
- break;
- }
- switchLoudSpeaker.setChecked(agent.getSpeakerPhoneOn());
- switchSendingVideo.setChecked(agent.isSendingVideo());
- switchSendingAudio.setChecked(agent.isSendingAudio());
- switchReceiveVideo.setChecked(agent.isReceivingVideo());
- switchReceiveAudio.setChecked(agent.isReceivingAudio());
-
- updateScreenShareView();
- }
-
- private void updateScreenShareView() {
- screenShare.setVisibility(agent.isScreenSharing() ? View.VISIBLE : View.INVISIBLE);
- }
-
- private void requirePermission() {
- new RequirePermissionAction(getActivity()).execute();
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(PermissionAcquiredEvent event) {
- makeCall();
- }
-
- @Override
- public void onStop() {
- super.onStop();
- }
-
- private void setButtonsEnable(boolean enable) {
- buttonHangup.setEnabled(enable);
- buttonDTMF.setEnabled(false);
- }
-
- @OnClick(R.id.buttonHangup)
- public void onHangup() {
- agent.hangup();
- ((LauncherActivity) getActivity()).goBackStack();
- }
-
- @OnClick(R.id.buttonDTMF)
- public void onDTMF() {
- if (isConnected)
- keypad.setVisibility(keypad.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
- }
-
- @OnClick({R.id.digit_0, R.id.digit_1, R.id.digit_2,
- R.id.digit_3, R.id.digit_4, R.id.digit_5,
- R.id.digit_6, R.id.digit_7, R.id.digit_8,
- R.id.digit_9, R.id.digit_hash,
- R.id.digit_asterisk})
- public void sendDTMF(View view) {
- if (isConnected) {
- String keyPressed = (String) view.getTag();
- agent.getActiveCall().sendDTMF(keyPressed, result -> {
- });
- }
- }
-
- @OnClick(R.id.remoteView)
- public void onRemoteViewClicked() {
- if (remoteAvatar.getVisibility() == View.VISIBLE) return;
- screenSwitcher.toggleFullScreen();
- updateFullScreenLayout();
- }
-
- private void updateFullScreenLayout() {
- updateScreenShareView();
- ((SurfaceView) remoteView).setZOrderMediaOverlay(screenSwitcher.isFullScreen());
- localView.setVisibility(screenSwitcher.isFullScreen() ? View.GONE : View.VISIBLE);
- }
-
- @OnCheckedChanged({R.id.switchSendVideo, R.id.switchSendAudio,
- R.id.switchReceiveVideo, R.id.switchReceiveAudio, R.id.switchShareContent})
- public void onSwitchCallAbility(Switch s) {
- switch (s.getId()) {
- case R.id.switchSendVideo:
- if (radioBackCam.isChecked())
- agent.setBackCamera();
- else {
- radioFrontCam.setChecked(true);
- agent.setFrontCamera();
- }
- agent.sendVideo(s.isChecked());
- break;
- case R.id.switchSendAudio:
- agent.sendAudio(s.isChecked());
- break;
- case R.id.switchReceiveVideo:
- agent.receiveVideo(s.isChecked());
- break;
- case R.id.switchReceiveAudio:
- agent.receiveAudio(s.isChecked());
- break;
- case R.id.switchShareContent:
- if (s.isChecked()) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- NotificationChannel mChannel = new NotificationChannel("screen_share_notification_channel", "screen_share_notification_channel", NotificationManager.IMPORTANCE_HIGH);
- NotificationManager notifyManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
- notifyManager.createNotificationChannel(mChannel);
- }
- Notification notification = new NotificationCompat.Builder(getActivity(), "screen_share_notification_channel")
- .setSmallIcon(R.mipmap.ic_launcher)
- .setContentTitle("Cisco Kitchensink")
- .setContentText("Sharing screen to others")
- .setTicker("Screen Sharing")
- .setPriority(NotificationCompat.PRIORITY_DEFAULT)
- .setDefaults(Notification.DEFAULT_SOUND)
- .build();
-
- agent.getActiveCall().startSharing(notification, 0xabcde, r -> {
- Ln.d("startSharing result: " + r);
- if (!r.isSuccessful()) {
- switchShareContent.setChecked(false);
- }
- });
- } else
- agent.getActiveCall().stopSharing(r -> {
- Ln.d("stopSharing result: " + r);
- });
- break;
-
- }
- }
-
- @OnCheckedChanged(R.id.switchLoudSpeaker)
- public void onSwitchLoudSpeakerChanged(Switch s) {
- new ToggleSpeakerAction(getActivity(), (CallImpl) agent.getActiveCall(), s.isChecked()).execute();
- }
-
- @OnClick(R.id.radioBackCam)
- public void onBackCamRadioClicked() {
- agent.setBackCamera();
- }
-
- @OnClick(R.id.radioFrontCam)
- public void onFrontCamRadioClicked() {
- agent.setFrontCamera();
- }
-
- @OnClick({R.id.tab_callcontrol, R.id.tab_aux_video, R.id.tab_participants})
- public void onTabClick(View view) {
- switch (view.getId()) {
- case R.id.tab_callcontrol:
- viewCallControl.setVisibility(View.VISIBLE);
- viewAuxVideosContainer.setVisibility(View.GONE);
- viewParticipants.setVisibility(View.GONE);
- break;
- case R.id.tab_aux_video:
- viewCallControl.setVisibility(View.GONE);
- viewAuxVideosContainer.setVisibility(View.VISIBLE);
- viewParticipants.setVisibility(View.GONE);
- break;
- case R.id.tab_participants:
- viewCallControl.setVisibility(View.GONE);
- viewAuxVideosContainer.setVisibility(View.GONE);
- viewParticipants.setVisibility(View.VISIBLE);
- break;
- default:
- break;
- }
- }
-
- @OnClick(R.id.floatButton)
- void showFloatingWindow() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
- && getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
- enterPicInPic();
- } else if (checkFloatPermission(getActivity())) {
- startFloating();
- } else
- requestSettingCanDrawOverlays();
- }
-
- @RequiresApi(api = Build.VERSION_CODES.O)
- private void enterPicInPic() {
- PictureInPictureParams.Builder builder = new PictureInPictureParams.Builder();
- Rational aspectRatio = new Rational(remoteView.getWidth(), remoteView.getHeight());
- builder.setAspectRatio(aspectRatio);
- getActivity().enterPictureInPictureMode(builder.build());
- }
-
- @Override
- public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig) {
- super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);
- floatButton.setVisibility(isInPictureInPictureMode ? View.GONE : View.VISIBLE);
- localView.setVisibility(isInPictureInPictureMode ? View.GONE : View.VISIBLE);
- }
-
- private ServiceConnection floatingConnection = new ServiceConnection() {
- @Override
- public void onServiceConnected(ComponentName name, IBinder binder) {
- FloatWindowService.MyBinder myBinder = (FloatWindowService.MyBinder) binder;
- FloatWindowService service = myBinder.getService();
- service.setAgent(agent);
- }
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
-
- }
- };
-
- private void startFloating() {
- if (!isFloatingBind) {
- Intent intent = new Intent(getActivity(), FloatWindowService.class);
- isFloatingBind = getActivity().getApplicationContext().bindService(intent, floatingConnection, Context.BIND_AUTO_CREATE);
- getActivity().moveTaskToBack(true);
- }
- }
-
- private void stopFloating() {
- if (isFloatingBind) {
- getActivity().getApplicationContext().unbindService(floatingConnection);
- isFloatingBind = false;
- new Handler().postDelayed(() -> agent.setVideoRenderViews(new Pair<>(localView, remoteView)), 500);
- }
- }
-
- @Override
- public void onResume() {
- super.onResume();
- stopFloating();
- }
-
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- screenSwitcher.updateOnRotation();
- updateScreenShareView();
- }
-
- @Override
- public void onBackPressed() {
- if (isConnected)
- agent.hangup();
- }
-
- private void makeCall() {
- String callee = getCallee();
- if (callee.isEmpty())
- return;
-
- if (callee.equals(INCOMING_CALL)) {
- setButtonsEnable(false);
- agent.answer(localView, remoteView, screenShare, false, null);
- return;
- }
- agent.startPreview(localView);
- agent.dial(callee, localView, remoteView, screenShare, false, null);
- new AddCallHistoryAction(callee, "out").execute();
- setButtonsEnable(true);
- }
-
- private String getCallee() {
- Bundle bundle = getArguments();
- return bundle != null ? bundle.getString(CALLEE) : "";
- }
-
- private void feedback() {
- BaseFragment fm = new CallFeedbackFragment();
- ((LauncherActivity) getActivity()).replace(fm);
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(DialEvent event) {
- if (!event.isSuccessful()) {
- if (event.getError() != null && event.getError().getErrorCode() == WebexError.ErrorCode.HOST_PIN_OR_MEETING_PASSWORD_REQUIRED.getCode()) {
- showPasswordDialog();
- } else if (event.getError() != null && event.getError().getErrorCode() == WebexError.ErrorCode.VIEW_H264_LICENSE.getCode()) {
- Toast.makeText(getActivity(), "View license, stop dial", Toast.LENGTH_SHORT).show();
- feedback();
- } else {
- Toast.makeText(getActivity(), "Dial failed!", Toast.LENGTH_SHORT).show();
- feedback();
- }
- }
- }
-
- private void showPasswordDialog() {
- EditText etKey = new EditText(getActivity());
- etKey.setHint("Host Key");
- EditText etPassword = new EditText(getActivity());
- etPassword.setHint("Meeting Password");
- LinearLayout layout = new LinearLayout(getActivity());
- layout.setOrientation(LinearLayout.VERTICAL);
- layout.addView(etKey);
- layout.addView(etPassword);
- new AlertDialog.Builder(getActivity())
- .setTitle("Are you the host?")
- .setMessage("If you are the host, please enter host key. Otherwise, enter the meeting password.")
- .setView(layout)
- .setPositiveButton("Confirm", (dialog, which) -> {
- String key = etKey.getText().toString();
- String password = etPassword.getText().toString();
- if (TextUtils.isEmpty(key) && TextUtils.isEmpty(password)) {
- Toast.makeText(getActivity(), "Please enter key or password.", Toast.LENGTH_SHORT).show();
- return;
- }
- if (!TextUtils.isEmpty(key) && !TextUtils.isEmpty(password)) {
- Toast.makeText(getActivity(), "Please only enter key or password", Toast.LENGTH_SHORT).show();
- return;
- }
- boolean isModerator;
- String PIN;
- if (!TextUtils.isEmpty(key)) {
- isModerator = true;
- PIN = key;
- } else {
- isModerator = false;
- PIN = password;
- }
- String callee = getCallee();
- if (callee.isEmpty())
- return;
- if (callee.equals(INCOMING_CALL)) {
- setButtonsEnable(false);
- agent.answer(localView, remoteView, screenShare, isModerator, PIN);
- return;
- }
- agent.dial(callee, localView, remoteView, screenShare, isModerator, PIN);
- })
- .setNegativeButton("Cancel", (dialog, which) -> {
- Toast.makeText(getActivity(), "Dial failed!", Toast.LENGTH_SHORT).show();
- feedback();
- })
- .show();
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(AnswerEvent event) {
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(HangupEvent event) {
- setButtonsEnable(false);
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnRingingEvent event) {
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnWaitingEvent event) {
- String text = "Waiting in lobby:" + event.waitReason.name();
- if (snackbar != null) {
- snackbar.setText(text);
- } else
- snackbar = Snackbar.make(layout, text, Snackbar.LENGTH_INDEFINITE);
- snackbar.show();
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnConnectEvent event) {
- isConnected = true;
- startAwakeService();
- floatButton.setVisibility(View.VISIBLE);
- setViewAndChildrenEnabled(layout, true);
- if (agent.getDefaultCamera().equals(WebexAgent.CameraCap.CLOSE))
- agent.sendVideo(false);
- setupWidgetStates();
- updateParticipants();
- event.call.setMultiStreamObserver(new MultiStreamObserver() {
- @Override
- public void onAuxStreamChanged(AuxStreamChangedEvent event) {
- postEvent(new OnAuxStreamEvent(event));
- }
-
- @Override
- public View onAuxStreamAvailable() {
- Ln.d("onAuxStreamAvailable");
- View auxStreamView = LayoutInflater.from(getActivity()).inflate(R.layout.remote_video_view, null);
- AuxStreamViewHolder auxStreamViewHolder = new AuxStreamViewHolder(auxStreamView);
- mAuxStreamViewMap.put(auxStreamViewHolder.mediaRenderView, auxStreamViewHolder);
- return auxStreamViewHolder.mediaRenderView;
- }
-
- @Override
- public View onAuxStreamUnavailable() {
- Ln.d("onAuxStreamUnavailable");
- return null;
- }
- });
- if (snackbar != null)
- snackbar.dismiss();
- }
-
- private void updateParticipants() {
- if (agent == null || agent.getActiveCall() == null) return;
- List callMemberships = agent.getActiveCall().getMemberships();
- if (callMemberships == null) return;
- Ln.d("updateParticipants: " + callMemberships.size());
- for (CallMembership membership : callMemberships) {
- String personId = membership.getPersonId();
- if (/*membership.getState() != CallMembership.State.JOINED || */personId == null || personId.isEmpty() || membership.getDisplayName() == null || membership.getDisplayName().isEmpty())
- continue;
- participantsAdapter.addOrUpdateItem(new ParticipantsAdapter.CallMembershipEntity(personId, membership.getDisplayName(), "", membership.isSendingAudio(), membership.isSendingVideo(), membership.getState()));
- agent.getWebex().people().get(personId, r -> {
- if (r == null || !r.isSuccessful() || r.getData() == null) return;
- mIdPersonMap.put(personId, r.getData());
- updatePersonInfoForParticipants(personId, r.getData());
- });
- }
- }
-
- private void updatePersonInfoForParticipants(String personId, Person person) {
- participantsAdapter.updateName(personId, person.getDisplayName());
- participantsAdapter.updateAvatar(personId, person.getAvatar());
- }
-
- private void updatePersonInfoForActiveSpeaker(String personId, Person person) {
- if (participantsAdapter.getActiveSpeaker() == null || person == null || !participantsAdapter.getActiveSpeaker().equals(personId))
- return;
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- remoteAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(remoteAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(remoteAvatar);
- }
- }
-
- private void updatePersonInfoForAuxStream(String personId, Person person, AuxStreamViewHolder auxStreamViewHolder) {
- if (personId == null || personId.isEmpty() || person == null || auxStreamViewHolder == null)
- return;
- auxStreamViewHolder.textView.setText(person.getDisplayName());
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- auxStreamViewHolder.viewAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(auxStreamViewHolder.viewAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(auxStreamViewHolder.viewAvatar);
- }
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnDisconnectEvent event) {
- isConnected = false;
- if (isFloatingBind)
- return;
- keypad.setVisibility(View.GONE);
- stopAwakeService();
- floatButton.setVisibility(View.GONE);
- if (agent.getActiveCall() == null || event.getCall().equals(agent.getActiveCall())) {
- mAuxStreamViewMap.clear();
- mIdPersonMap.clear();
- feedback();
- }
- if (snackbar != null)
- snackbar.dismiss();
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
- public void onEventMainThread(OnMediaChangeEvent event) {
- if (event.callEvent instanceof CallObserver.RemoteSendingVideoEvent) {
- Ln.d("RemoteSendingVideoEvent: " + ((CallObserver.RemoteSendingVideoEvent) event.callEvent).isSending());
- } else if (event.callEvent instanceof RemoteSendingSharingEvent) {
- Ln.d("RemoteSendingSharingEvent: " + ((RemoteSendingSharingEvent) event.callEvent).isSending());
- if (((RemoteSendingSharingEvent) event.callEvent).isSending()) {
- event.callEvent.getCall().setVideoRenderViews(new Pair<>(localView, screenShare));
- event.callEvent.getCall().setSharingRenderView(remoteView);
- } else {
- event.callEvent.getCall().setSharingRenderView(null);
- event.callEvent.getCall().setVideoRenderViews(new Pair<>(localView, remoteView));
- }
- updateScreenShareView();
- } else if (event.callEvent instanceof SendingSharingEvent) {
- Ln.d("SendingSharingEvent: " + ((SendingSharingEvent) event.callEvent).isSending());
- if (((SendingSharingEvent) event.callEvent).isSending()) {
-// sendNotification();
- backToHome();
- }
- } else if (event.callEvent instanceof CallObserver.ActiveSpeakerChangedEvent) {
- CallMembership membership = ((CallObserver.ActiveSpeakerChangedEvent) event.callEvent).to();
- Ln.d("ActiveSpeakerChangedEvent: " + membership);
- if (membership != null && membership.getPersonId() != null && !membership.getPersonId().isEmpty()) {
- String personId = membership.getPersonId();
- participantsAdapter.updateActiveSpeaker(personId);
- if (membership.isSendingVideo()) {
- remoteAvatar.setVisibility(View.GONE);
- } else {
- remoteAvatar.setVisibility(View.VISIBLE);
- Person person = mIdPersonMap.get(personId);
- if (person == null) {
- remoteAvatar.setImageResource(R.drawable.google_contacts_android);
- agent.getWebex().people().get(personId, r -> {
- if (!r.isSuccessful() || r.getData() == null) return;
- mIdPersonMap.put(personId, r.getData());
- updatePersonInfoForActiveSpeaker(personId, r.getData());
- });
- } else {
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- remoteAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(remoteAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(remoteAvatar);
- }
- }
- }
- } else {
- remoteAvatar.setVisibility(View.VISIBLE);
- remoteAvatar.setImageResource(android.R.color.darker_gray);
- }
- }
- }
-
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnAuxStreamEvent event) {
- Ln.d("OnAuxStreamEvent: " + event.callEvent.getAuxStream());
- AuxStream auxStream = event.callEvent.getAuxStream();
- if (event.callEvent instanceof MultiStreamObserver.AuxStreamOpenedEvent) {
- MultiStreamObserver.AuxStreamOpenedEvent openEvent = (MultiStreamObserver.AuxStreamOpenedEvent) event.callEvent;
- if (openEvent.isSuccessful()) {
- Ln.d("AuxStreamOpenedEvent successful");
- viewAuxVideos.addView(mAuxStreamViewMap.get(openEvent.getRenderView()).item);
- } else {
- Ln.d("AuxStreamOpenedEvent failed: " + openEvent.getError());
- mAuxStreamViewMap.remove(openEvent.getRenderView());
- }
- } else if (event.callEvent instanceof MultiStreamObserver.AuxStreamClosedEvent) {
- MultiStreamObserver.AuxStreamClosedEvent closeEvent = (MultiStreamObserver.AuxStreamClosedEvent) event.callEvent;
- if (closeEvent.isSuccessful()) {
- Ln.d("AuxStreamClosedEvent successful");
- AuxStreamViewHolder auxStreamViewHolder = mAuxStreamViewMap.get(closeEvent.getRenderView());
- mAuxStreamViewMap.remove(closeEvent.getRenderView());
- viewAuxVideos.removeView(auxStreamViewHolder.item);
- } else {
- Ln.d("AuxStreamClosedEvent failed: " + closeEvent.getError());
- }
- } else if (event.callEvent instanceof MultiStreamObserver.AuxStreamSendingVideoEvent) {
- Ln.d("AuxStreamSendingVideoEvent: " + auxStream.isSendingVideo());
- AuxStreamViewHolder auxStreamViewHolder = mAuxStreamViewMap.get(auxStream.getRenderView());
- if (auxStreamViewHolder == null) return;
- if (auxStream.isSendingVideo()) {
- auxStreamViewHolder.viewAvatar.setVisibility(View.GONE);
- } else {
- CallMembership membership = auxStream.getPerson();
- if (membership == null || membership.getPersonId() == null || membership.getPersonId().isEmpty())
- return;
- String personId = membership.getPersonId();
- auxStreamViewHolder.viewAvatar.setVisibility(View.VISIBLE);
- Person person = mIdPersonMap.get(personId);
- if (person == null) {
- auxStreamViewHolder.viewAvatar.setImageResource(R.drawable.google_contacts_android);
- agent.getWebex().people().get(personId, r -> {
- if (!r.isSuccessful() || r.getData() == null) return;
- mIdPersonMap.put(personId, r.getData());
- updatePersonInfoForAuxStream(personId, r.getData(), auxStreamViewHolder);
- });
- } else {
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- auxStreamViewHolder.viewAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(auxStreamViewHolder.viewAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(auxStreamViewHolder.viewAvatar);
- }
- }
- }
- } else if (event.callEvent instanceof MultiStreamObserver.AuxStreamPersonChangedEvent) {
- Ln.d("AuxStreamPersonChangedEvent: " + auxStream.getPerson());
- AuxStreamViewHolder auxStreamViewHolder = mAuxStreamViewMap.get(auxStream.getRenderView());
- if (auxStream.getPerson() == null) {
- mAuxStreamViewMap.remove(auxStream.getRenderView());
- viewAuxVideos.removeView(auxStreamViewHolder.item);
- } else {
- CallMembership membership = auxStream.getPerson();
- if (membership == null || membership.getPersonId() == null || membership.getPersonId().isEmpty())
- return;
- String personId = membership.getPersonId();
- participantsAdapter.updateSendingAudioStatus(personId, membership.isSendingAudio());
- participantsAdapter.updateSendingVideoStatus(personId, membership.isSendingVideo());
- Person person = mIdPersonMap.get(personId);
- auxStreamViewHolder.viewAvatar.setVisibility(membership.isSendingVideo() ? View.GONE : View.VISIBLE);
- if (person == null) {
- auxStreamViewHolder.textView.setText(membership.getDisplayName());
- auxStreamViewHolder.viewAvatar.setImageResource(R.drawable.google_contacts_android);
- agent.getWebex().people().get(personId, r -> {
- if (!r.isSuccessful() || r.getData() == null) return;
- mIdPersonMap.put(personId, r.getData());
- updatePersonInfoForAuxStream(personId, r.getData(), auxStreamViewHolder);
- });
- } else {
- auxStreamViewHolder.textView.setText(person.getDisplayName());
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- auxStreamViewHolder.viewAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(auxStreamViewHolder.viewAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(auxStreamViewHolder.viewAvatar);
- }
- }
- }
- }
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(OnCallMembershipEvent event) {
- CallMembership membership = event.callEvent.getCallMembership();
- Ln.d("OnCallMembershipEvent: " + membership);
- if (membership == null || membership.getPersonId() == null || membership.getPersonId().isEmpty())
- return;
- String personId = membership.getPersonId();
- if (event.callEvent instanceof CallObserver.MembershipJoinedEvent) {
- Ln.d("MembershipJoinedEvent: ");
- if (membership.getState() != CallMembership.State.JOINED || personId == null || personId.isEmpty() || membership.getDisplayName() == null || membership.getDisplayName().isEmpty())
- return;
- participantsAdapter.addOrUpdateItem(new ParticipantsAdapter.CallMembershipEntity(personId, membership.getDisplayName(), "", membership.isSendingAudio(), membership.isSendingVideo(), membership.getState()));
- agent.getWebex().people().get(personId, r -> {
- if (r == null || !r.isSuccessful() || r.getData() == null) return;
- updatePersonInfoForParticipants(personId, r.getData());
- });
- } else if (event.callEvent instanceof CallObserver.MembershipLeftEvent) {
- Ln.d("MembershipLeftEvent: ");
- participantsAdapter.removeItem(personId);
- } else if (event.callEvent instanceof CallObserver.MembershipSendingAudioEvent) {
- Ln.d("MembershipSendingAudioEvent: " + membership.isSendingAudio());
- participantsAdapter.updateSendingAudioStatus(personId, membership.isSendingAudio());
- } else if (event.callEvent instanceof CallObserver.MembershipSendingVideoEvent) {
- Ln.d("MembershipSendingVideoEvent: " + membership.isSendingVideo());
- participantsAdapter.updateSendingVideoStatus(personId, membership.isSendingVideo());
- if (participantsAdapter.getActiveSpeaker() != null && participantsAdapter.getActiveSpeaker().equals(personId)) {
- if (membership.isSendingVideo()) {
- remoteAvatar.setVisibility(View.GONE);
- } else {
- remoteAvatar.setVisibility(View.VISIBLE);
- Person person = mIdPersonMap.get(personId);
- if (person == null) {
- remoteAvatar.setImageResource(R.drawable.google_contacts_android);
- agent.getWebex().people().get(personId, r -> {
- if (!r.isSuccessful() || r.getData() == null) return;
- mIdPersonMap.put(personId, r.getData());
- updatePersonInfoForActiveSpeaker(personId, r.getData());
- });
- } else {
- String avatar = person.getAvatar();
- if (avatar == null || avatar.isEmpty()) {
- remoteAvatar.setImageResource(R.drawable.google_contacts_android);
- } else {
- Picasso.with(getActivity()).cancelRequest(remoteAvatar);
- Picasso.with(getActivity()).load(avatar).fit().into(remoteAvatar);
- }
- }
- }
- }
- } else if (event.callEvent instanceof CallObserver.MembershipWaitingEvent) {
- Ln.d("MembershipJoinedLobbyEvent: ");
- if (membership.getState() != CallMembership.State.WAITING || personId == null || personId.isEmpty() || membership.getDisplayName() == null || membership.getDisplayName().isEmpty())
- return;
- participantsAdapter.addOrUpdateItem(new ParticipantsAdapter.CallMembershipEntity(personId, membership.getDisplayName(), "", membership.isSendingAudio(), membership.isSendingVideo(), membership.getState()));
- agent.getWebex().people().get(personId, r -> {
- if (r == null || !r.isSuccessful() || r.getData() == null) return;
- Ln.d("people: " + r.getData());
- updatePersonInfoForParticipants(personId, r.getData());
- });
- } else if (event.callEvent instanceof CallObserver.MembershipAudioMutedControlledEvent) {
- Ln.d("MembershipAudioMutedControlledEvent: ");
- Ln.d(membership.getPersonId() + (membership.isAudioMutedControlled() ? " muted by " : " unmuted by ") + membership.audioModifiedBy());
- if (membership.audioModifiedBy() != null) {
- String text = membership.getDisplayName() + (membership.isAudioMutedControlled() ? " muted" : " unmuted") + " by others";
- toast(text);
- }
- }
- }
-
- private void backToHome() {
- Intent intent = new Intent(Intent.ACTION_MAIN);
- intent.addCategory(Intent.CATEGORY_HOME);
- this.startActivity(intent);
- }
-
- private void sendNotification() {
- Intent appIntent = new Intent(getActivity(), LauncherActivity.class);
- appIntent.setAction(Intent.ACTION_MAIN);
- appIntent.addCategory(Intent.CATEGORY_LAUNCHER);
- appIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
- PendingIntent contentIntent = PendingIntent.getActivity(getActivity(), 0, appIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-
- NotificationManager notifyManager = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(getActivity())
- .setSmallIcon(R.mipmap.ic_launcher)
- .setContentTitle("Cisco Kichensink")
- .setContentText("I'm sharing content")
- .setContentIntent(contentIntent);
- notifyManager.notify(1, builder.build());
- }
-
- private void startAwakeService() {
- getActivity().startService(new Intent(getActivity(), AwakeService.class));
- }
-
- private void stopAwakeService() {
- getActivity().stopService(new Intent(getActivity(), AwakeService.class));
- }
-
- @Override
- public void onDestroy() {
- stopAwakeService();
- stopFloating();
- super.onDestroy();
- }
-
- public static boolean checkFloatPermission(Context context) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
- try {
- Class cls = Class.forName("android.content.Context");
- Field declaredField = cls.getDeclaredField("APP_OPS_SERVICE");
- declaredField.setAccessible(true);
- Object obj = declaredField.get(cls);
- if (!(obj instanceof String)) {
- return false;
- }
- String str2 = (String) obj;
- obj = cls.getMethod("getSystemService", String.class).invoke(context, str2);
- cls = Class.forName("android.app.AppOpsManager");
- Field declaredField2 = cls.getDeclaredField("MODE_ALLOWED");
- declaredField2.setAccessible(true);
- Method checkOp = cls.getMethod("checkOp", Integer.TYPE, Integer.TYPE, String.class);
- int result = (Integer) checkOp.invoke(obj, 24, Binder.getCallingUid(), context.getPackageName());
- return result == declaredField2.getInt(cls);
- } catch (Exception e) {
- return false;
- }
- } else {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- AppOpsManager appOpsMgr = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
- if (appOpsMgr == null)
- return false;
- int mode = appOpsMgr.checkOpNoThrow("android:system_alert_window", android.os.Process.myUid(), context
- .getPackageName());
- return Settings.canDrawOverlays(context) || mode == AppOpsManager.MODE_ALLOWED || mode == AppOpsManager.MODE_IGNORED;
- } else {
- return Settings.canDrawOverlays(context);
- }
- }
- }
-
- private void requestSettingCanDrawOverlays() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
- intent.setData(Uri.parse("package:" + getActivity().getPackageName()));
- startActivityForResult(intent, 0x101);
- }
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (requestCode == 0x101)
- if (checkFloatPermission(getActivity())) {
- startFloating();
- } else
- Toast.makeText(getActivity(), "No float window permission", Toast.LENGTH_SHORT).show();
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/DialPagersFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/DialPagersFragment.java
deleted file mode 100644
index d137950..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/DialPagersFragment.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-import android.app.Fragment;
-import android.os.Bundle;
-import android.support.design.widget.TabLayout;
-import android.support.v4.view.ViewPager;
-
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.pagers.DialFragment;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.pagers.HistoryFragment;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.pagers.PeopleFragment;
-import com.ciscowebex.androidsdk.kitchensink.launcher.fragments.pagers.SpaceFragment;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-import com.ciscowebex.androidsdk.kitchensink.ui.ListPageAdapter;
-
-import butterknife.BindView;
-
-import static android.R.drawable.ic_menu_call;
-import static android.R.drawable.ic_menu_myplaces;
-import static android.R.drawable.ic_menu_recent_history;
-import static android.R.drawable.ic_menu_search;
-
-public class DialPagersFragment extends BaseFragment {
-
- @BindView(R.id.dialViewPager)
- ViewPager pager;
-
- @BindView(R.id.dialTabs)
- TabLayout tabs;
-
- public DialPagersFragment() {
- // Required empty public constructor
- setLayout(R.layout.fragment_dial_pagers);
- }
-
- @Override
- public void onActivityCreated(Bundle saved) {
- super.onActivityCreated(saved);
- setupAdapter();
- tabs.setupWithViewPager(pager);
- setupTabIcons();
- }
-
- public void gotoDialPage(String dialString) {
- pager.setCurrentItem(2);
- Fragment fm = ((ListPageAdapter) pager.getAdapter()).getItem(2);
- ((DialFragment) fm).setDialString(dialString);
- }
-
- private void setupAdapter() {
- ListPageAdapter adapter;
- adapter = new ListPageAdapter(getFragmentManager());
- adapter.add(new HistoryFragment());
- adapter.add(new PeopleFragment());
- adapter.add(new DialFragment());
- adapter.add(new SpaceFragment());
- pager.setAdapter(adapter);
- }
-
- private void setupTabIcons() {
- tabs.getTabAt(0).setIcon(ic_menu_recent_history);
- tabs.getTabAt(1).setIcon(ic_menu_search);
- tabs.getTabAt(2).setIcon(ic_menu_call);
- tabs.getTabAt(3).setIcon(ic_menu_myplaces);
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/FeedbackFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/FeedbackFragment.java
deleted file mode 100644
index 2ce7a3b..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/FeedbackFragment.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-
-import android.content.Intent;
-import android.net.Uri;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-import butterknife.OnItemSelected;
-import butterknife.OnTouch;
-
-/**
- * A simple {@link BaseFragment} subclass.
- */
-public class FeedbackFragment extends BaseFragment {
- public static final int PICK_IMAGE = 1;
-
- @BindView(R.id.spinnerTopic)
- Spinner topic;
-
- @BindView(R.id.imageName)
- TextView imageUri;
-
- @BindView(R.id.comment)
- EditText comment;
-
- Uri attachment;
-
- public FeedbackFragment() {
- // Required empty public constructor
- setLayout(R.layout.fragment_feedback);
- }
-
- @OnItemSelected(R.id.spinnerTopic)
- public void pickUpTopic(int position) {
- }
-
- @OnTouch(R.id.pickImage)
- public boolean pickUpImage(View v, MotionEvent event) {
- if (event.getAction() == MotionEvent.ACTION_UP) {
- Intent intent = new Intent();
- intent.setType("image/*");
- intent.setAction(Intent.ACTION_GET_CONTENT);
- startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
- }
- return true;
- }
-
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (requestCode == PICK_IMAGE) {
- if (data == null) {
- return;
- }
- attachment = data.getData();
- imageUri.setText(attachment.getLastPathSegment());
- }
- }
-
- @OnClick(R.id.sendButton)
- public void sendEmail() {
- Intent intent = new Intent(Intent.ACTION_SENDTO);
- intent.setData(Uri.parse("mailto:"));
- intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"devsupport@ciscospark.com"});
- intent.putExtra(Intent.EXTRA_SUBJECT, topic.getSelectedItem().toString());
- intent.putExtra(Intent.EXTRA_TEXT, comment.getText());
- if (attachment != null)
- intent.putExtra(Intent.EXTRA_STREAM, attachment);
- startActivity(Intent.createChooser(intent, "Pick an Email provider"));
- }
-
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/LauncherFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/LauncherFragment.java
deleted file mode 100644
index 6d2758c..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/LauncherFragment.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2016-2017 Cisco Systems Inc
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-import android.content.Intent;
-
-import com.ciscowebex.androidsdk.WebexError;
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.LogoutAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.LogoutEvent;
-import com.ciscowebex.androidsdk.kitchensink.launcher.LauncherActivity;
-import com.ciscowebex.androidsdk.kitchensink.login.LoginActivity;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-
-import butterknife.OnClick;
-
-import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
-
-/**
- * A simple {@link BaseFragment} subclass.
- */
-public class LauncherFragment extends BaseFragment {
-
- private BaseFragment setupFragment;
- private BaseFragment dialFragment;
- private BaseFragment waitingCallFragment;
- private BaseFragment feedbackFragment;
-
- public LauncherFragment() {
- // Required empty public constructor
- setLayout(R.layout.fragment_launcher);
- setupFragment = new SetupFragment();
- dialFragment = new DialPagersFragment();
- waitingCallFragment = new WaitingCallFragment();
- feedbackFragment = new FeedbackFragment();
- }
-
- @OnClick(R.id.buttonSetup)
- public void setup() {
- ((LauncherActivity) getActivity()).replace(setupFragment);
- }
-
- @OnClick({R.id.buttonDial, R.id.buttonMessaging})
- public void dial() {
- ((LauncherActivity) getActivity()).replace(dialFragment);
- }
-
- @OnClick(R.id.buttonWaitingCall)
- public void waitingCall() {
- ((LauncherActivity) getActivity()).replace(waitingCallFragment);
- }
-
- @OnClick(R.id.buttonFeedback)
- public void sendFeedback() {
- ((LauncherActivity) getActivity()).replace(feedbackFragment);
- }
-
- @OnClick(R.id.buttonLogout)
- public void logout() {
- showBusyIndicator("Logout", "Wait for logout ...");
- new LogoutAction().execute();
- }
-
- @SuppressWarnings("unused")
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onMessageEvent(LogoutEvent event) {
- dismissBusyIndicator();
- if (event.isSuccessful() || (event.getError()!= null && event.getError().getErrorCode() == WebexError.ErrorCode.NETWORK_ERROR.getCode())) {
- toast("Logout success");
- Intent i = new Intent(getActivity(), LoginActivity.class);
- i.setFlags(FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(i);
- getActivity().finish();
- } else {
- toast("Logout fail");
- }
- }
-}
diff --git a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/MessageFragment.java b/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/MessageFragment.java
deleted file mode 100644
index 53070c2..0000000
--- a/app/src/main/java/com/ciscowebex/androidsdk/kitchensink/launcher/fragments/MessageFragment.java
+++ /dev/null
@@ -1,865 +0,0 @@
-package com.ciscowebex.androidsdk.kitchensink.launcher.fragments;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.provider.DocumentsContract;
-import android.provider.MediaStore;
-import android.provider.OpenableColumns;
-import android.support.annotation.NonNull;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.text.TextUtils;
-import android.util.Pair;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-
-import com.ciscowebex.androidsdk.kitchensink.R;
-import com.ciscowebex.androidsdk.kitchensink.actions.WebexAgent;
-import com.ciscowebex.androidsdk.kitchensink.actions.commands.RequirePermissionAction;
-import com.ciscowebex.androidsdk.kitchensink.actions.events.PermissionAcquiredEvent;
-import com.ciscowebex.androidsdk.kitchensink.ui.BaseFragment;
-import com.ciscowebex.androidsdk.membership.Membership;
-import com.ciscowebex.androidsdk.membership.MembershipClient;
-import com.ciscowebex.androidsdk.message.LocalFile;
-import com.ciscowebex.androidsdk.message.Mention;
-import com.ciscowebex.androidsdk.message.Message;
-import com.ciscowebex.androidsdk.message.MessageClient;
-import com.ciscowebex.androidsdk.message.MessageObserver;
-import com.ciscowebex.androidsdk.message.RemoteFile;
-import com.ciscowebex.androidsdk.space.SpaceClient;
-import com.ciscowebex.androidsdk.utils.MimeUtils;
-import com.github.benoitdion.ln.Ln;
-
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.OnClick;
-
-import static android.app.Activity.RESULT_OK;
-
-
-public class MessageFragment extends BaseFragment {
- private static final String TARGET_ID = "target_id";
- private static final int FILE_SELECT_REQUEST = 1;
-
- @BindView(R.id.message_text)
- EditText textMessage;
-
- @BindView(R.id.message_view)
- RecyclerView recyclerMessage;
-
- @BindView(R.id.message_mention)
- ImageButton btnMention;
-
- @BindView(R.id.message_status)
- TextView textStatus;
-
- @BindView(R.id.membership_recyclerview)
- RecyclerView recyclerMembership;
-
- @BindView(R.id.send_button)
- Button btnSend;
-
- MessageAdapter adapterMessage;
-
- MembershipAdapter adapterMembership;
-
- WebexAgent agent = WebexAgent.getInstance();
-
- MessageClient messageClient = agent.getMessageClient();
-
- MembershipClient membershipClient = agent.getMembershipClient();
-
- SpaceClient spaceClient = agent.getSpaceClient();
-
- ArrayList selectedFile;
-
- ArrayList