[HangOn] Handset intent implementation + submodule linphone updated
This commit is contained in:
parent
fce3238022
commit
e0ea1bc98b
9 changed files with 143 additions and 113 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest package="org.linphone"
|
||||||
package="org.linphone"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="3253"
|
android:versionCode="3253"
|
||||||
android:versionName="3.2.5">
|
android:versionName="3.2.5">
|
||||||
|
@ -10,8 +10,9 @@
|
||||||
android:targetSdkVersion="23"/>
|
android:targetSdkVersion="23"/>
|
||||||
|
|
||||||
<!-- Permissions for Push Notification -->
|
<!-- Permissions for Push Notification -->
|
||||||
<!--<uses-permission android:name="org.linphone.permission.C2D_MESSAGE"/> GCM permission--> <!-- Change package ! -->
|
<!-- <uses-permission android:name="org.linphone.permission.C2D_MESSAGE"/> GCM permission -->
|
||||||
<!--<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> GCM permission-->
|
<!-- Change package ! -->
|
||||||
|
<!-- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> GCM permission -->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||||
|
@ -133,7 +134,6 @@
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".PhoneStateChangedReceiver">
|
<receiver android:name=".PhoneStateChangedReceiver">
|
||||||
<intent-filter>
|
<intent-filter android:priority="999">
|
||||||
<action android:name="android.intent.action.PHONE_STATE"/>
|
<action android:name="android.intent.action.PHONE_STATE"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
@ -237,19 +237,30 @@
|
||||||
<!-- This one needs to be registered from application -->
|
<!-- This one needs to be registered from application -->
|
||||||
<receiver android:name=".KeepAliveReceiver"/>
|
<receiver android:name=".KeepAliveReceiver"/>
|
||||||
|
|
||||||
|
<receiver android:name=".HookReceiver" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.base.module.phone.HOOKEVENT" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<!-- Needed for push notification -->
|
<!-- Needed for push notification -->
|
||||||
<!--<receiver
|
<!--
|
||||||
|
<receiver
|
||||||
android:name=".gcm.GCMReceiver"
|
android:name=".gcm.GCMReceiver"
|
||||||
android:permission="com.google.android.c2dm.permission.SEND">
|
android:permission="com.google.android.c2dm.permission.SEND">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
|
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
|
||||||
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
|
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
|
||||||
|
|
||||||
<category android:name="org.linphone"/>--> <!-- Change package ! -->
|
<category android:name="org.linphone"/>
|
||||||
<!--</intent-filter>
|
-->
|
||||||
|
<!-- Change package ! -->
|
||||||
|
<!--
|
||||||
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<service android:name=".gcm.GCMService"/>-->
|
<service android:name=".gcm.GCMService"/>
|
||||||
|
-->
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".AccountEnableReceiver"
|
android:name=".AccountEnableReceiver"
|
||||||
|
@ -264,9 +275,7 @@
|
||||||
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
|
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
<service android:name=".firebase.FirebaseMessaging">
|
||||||
<service
|
|
||||||
android:name=".firebase.FirebaseMessaging">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
@ -318,4 +327,4 @@
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -18,7 +18,7 @@ buildscript {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.3.0'
|
classpath 'com.android.tools.build:gradle:2.2.2'
|
||||||
if (googleFile.exists()) {
|
if (googleFile.exists()) {
|
||||||
classpath 'com.google.gms:google-services:3.0.0'
|
classpath 'com.google.gms:google-services:3.0.0'
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@ android {
|
||||||
debug.setRoot('build-types/debug')
|
debug.setRoot('build-types/debug')
|
||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
}
|
}
|
||||||
|
buildToolsVersion '25.0.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////// Task /////////////
|
///////////// Task /////////////
|
||||||
|
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Fri Feb 24 09:27:36 CET 2017
|
#Wed Mar 22 15:25:45 CET 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||||
|
|
|
@ -18,7 +18,7 @@ buildscript {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.3.0'
|
classpath 'com.android.tools.build:gradle:2.2.2'
|
||||||
if (googleFile.exists()) {
|
if (googleFile.exists()) {
|
||||||
classpath 'com.google.gms:google-services:3.0.0'
|
classpath 'com.google.gms:google-services:3.0.0'
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,32 +17,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import org.linphone.core.CallDirection;
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
|
||||||
import org.linphone.core.LinphoneCall;
|
|
||||||
import org.linphone.core.LinphoneCall.State;
|
|
||||||
import org.linphone.core.LinphoneCallParams;
|
|
||||||
import org.linphone.core.LinphoneCallStats;
|
|
||||||
import org.linphone.core.LinphoneCallStats.LinphoneAddressFamily;
|
|
||||||
import org.linphone.core.LinphoneChatMessage;
|
|
||||||
import org.linphone.core.LinphoneChatRoom;
|
|
||||||
import org.linphone.core.LinphoneCore;
|
|
||||||
import org.linphone.core.LinphoneCoreException;
|
|
||||||
import org.linphone.core.LinphoneCoreListenerBase;
|
|
||||||
import org.linphone.core.LinphonePlayer;
|
|
||||||
import org.linphone.core.PayloadType;
|
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
|
||||||
import org.linphone.ui.Numpad;
|
|
||||||
import org.linphone.mediastream.Factory;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
@ -86,6 +60,30 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.linphone.core.LinphoneAddress;
|
||||||
|
import org.linphone.core.LinphoneCall;
|
||||||
|
import org.linphone.core.LinphoneCall.State;
|
||||||
|
import org.linphone.core.LinphoneCallParams;
|
||||||
|
import org.linphone.core.LinphoneCallStats;
|
||||||
|
import org.linphone.core.LinphoneCallStats.LinphoneAddressFamily;
|
||||||
|
import org.linphone.core.LinphoneChatMessage;
|
||||||
|
import org.linphone.core.LinphoneChatRoom;
|
||||||
|
import org.linphone.core.LinphoneCore;
|
||||||
|
import org.linphone.core.LinphoneCoreException;
|
||||||
|
import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
|
import org.linphone.core.LinphonePlayer;
|
||||||
|
import org.linphone.core.PayloadType;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
|
import org.linphone.ui.Numpad;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
|
@ -273,7 +271,6 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
enableAndRefreshInCallActions();
|
enableAndRefreshInCallActions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
// Fragment already created, no need to create it again (else it will generate a memory leak with duplicated fragments)
|
// Fragment already created, no need to create it again (else it will generate a memory leak with duplicated fragments)
|
||||||
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
|
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
|
||||||
|
@ -403,11 +400,6 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||||
avatar_layout = (RelativeLayout) findViewById(R.id.avatar_layout);
|
avatar_layout = (RelativeLayout) findViewById(R.id.avatar_layout);
|
||||||
|
|
||||||
/*if(isTablet()){
|
|
||||||
speaker.setEnabled(false);
|
|
||||||
}
|
|
||||||
speaker.setEnabled(false);*/
|
|
||||||
|
|
||||||
//Options
|
//Options
|
||||||
addCall = (ImageView) findViewById(R.id.add_call);
|
addCall = (ImageView) findViewById(R.id.add_call);
|
||||||
addCall.setOnClickListener(this);
|
addCall.setOnClickListener(this);
|
||||||
|
@ -534,7 +526,11 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
displayMissedChats();
|
displayMissedChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshInCallActions() {
|
protected void setSpeakerEnabled(boolean enabled){
|
||||||
|
isSpeakerEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void refreshInCallActions() {
|
||||||
if (!LinphonePreferences.instance().isVideoEnabled() || isConferenceRunning) {
|
if (!LinphonePreferences.instance().isVideoEnabled() || isConferenceRunning) {
|
||||||
enabledVideoButton(false);
|
enabledVideoButton(false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -921,7 +917,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleSpeaker() {
|
protected void toggleSpeaker() {
|
||||||
isSpeakerEnabled = !isSpeakerEnabled;
|
isSpeakerEnabled = !isSpeakerEnabled;
|
||||||
if (isSpeakerEnabled) {
|
if (isSpeakerEnabled) {
|
||||||
LinphoneManager.getInstance().routeAudioToSpeaker();
|
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||||
|
@ -1200,6 +1196,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
@ -1207,6 +1204,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
if (lc != null) {
|
if (lc != null) {
|
||||||
lc.addListener(mListener);
|
lc.addListener(mListener);
|
||||||
}
|
}
|
||||||
|
isSpeakerEnabled = LinphoneManager.getLc().isSpeakerEnabled();
|
||||||
|
|
||||||
refreshIncallUi();
|
refreshIncallUi();
|
||||||
handleViewIntent();
|
handleViewIntent();
|
||||||
|
|
|
@ -18,18 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
|
||||||
import org.linphone.core.LinphoneCall;
|
|
||||||
import org.linphone.core.LinphoneCall.State;
|
|
||||||
import org.linphone.core.LinphoneCallParams;
|
|
||||||
import org.linphone.core.LinphoneCore;
|
|
||||||
import org.linphone.core.LinphoneCoreListenerBase;
|
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
import org.linphone.ui.LinphoneSliders.LinphoneSliderTriggered;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
@ -44,6 +32,18 @@ import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.linphone.core.LinphoneAddress;
|
||||||
|
import org.linphone.core.LinphoneCall;
|
||||||
|
import org.linphone.core.LinphoneCall.State;
|
||||||
|
import org.linphone.core.LinphoneCallParams;
|
||||||
|
import org.linphone.core.LinphoneCore;
|
||||||
|
import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
import org.linphone.ui.LinphoneSliders.LinphoneSliderTriggered;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CallIncomingActivity extends LinphoneGenericActivity implements LinphoneSliderTriggered {
|
public class CallIncomingActivity extends LinphoneGenericActivity implements LinphoneSliderTriggered {
|
||||||
private static CallIncomingActivity instance;
|
private static CallIncomingActivity instance;
|
||||||
|
|
||||||
|
@ -179,6 +179,7 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
if (state == State.StreamsRunning) {
|
if (state == State.StreamsRunning) {
|
||||||
|
Log.e("CallIncommingActivity - onCreate - State.StreamsRunning - speaker = "+LinphoneManager.getLc().isSpeakerEnabled());
|
||||||
// The following should not be needed except some devices need it (e.g. Galaxy S).
|
// The following should not be needed except some devices need it (e.g. Galaxy S).
|
||||||
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled());
|
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1634,7 +1634,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
//LinphoneChatMessage Listener
|
//LinphoneChatMessage Listener
|
||||||
@Override
|
@Override
|
||||||
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
|
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
|
||||||
Log.e(" =======>>>>>>> onLinphoneChatMessageStateChanged - state = "+state.toString());
|
|
||||||
redrawMessageList();
|
redrawMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,23 +18,35 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import static android.media.AudioManager.MODE_RINGTONE;
|
import android.annotation.SuppressLint;
|
||||||
import static android.media.AudioManager.STREAM_RING;
|
import android.annotation.TargetApi;
|
||||||
import static android.media.AudioManager.STREAM_VOICE_CALL;
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
import java.io.File;
|
import android.app.ProgressDialog;
|
||||||
import java.io.FileInputStream;
|
import android.content.BroadcastReceiver;
|
||||||
import java.io.FileOutputStream;
|
import android.content.ContentResolver;
|
||||||
import java.io.IOException;
|
import android.content.Context;
|
||||||
import java.io.InputStream;
|
import android.content.Intent;
|
||||||
import java.net.InetAddress;
|
import android.content.IntentFilter;
|
||||||
import java.nio.ByteBuffer;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import java.sql.Timestamp;
|
import android.content.res.Resources;
|
||||||
import java.util.ArrayList;
|
import android.media.AudioManager;
|
||||||
import java.util.Date;
|
import android.media.MediaPlayer;
|
||||||
import java.util.List;
|
import android.net.ConnectivityManager;
|
||||||
import java.util.Timer;
|
import android.net.NetworkInfo;
|
||||||
import java.util.TimerTask;
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.os.PowerManager.WakeLock;
|
||||||
|
import android.os.Vibrator;
|
||||||
|
import android.preference.CheckBoxPreference;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.provider.Settings.SettingNotFoundException;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.linphone.assistant.AssistantActivity;
|
import org.linphone.assistant.AssistantActivity;
|
||||||
import org.linphone.core.CallDirection;
|
import org.linphone.core.CallDirection;
|
||||||
|
@ -79,35 +91,23 @@ import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
||||||
import org.linphone.tools.H264Helper;
|
import org.linphone.tools.H264Helper;
|
||||||
import org.linphone.tools.OpenH264DownloadHelper;
|
import org.linphone.tools.OpenH264DownloadHelper;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import java.io.File;
|
||||||
import android.annotation.TargetApi;
|
import java.io.FileInputStream;
|
||||||
import android.app.AlertDialog;
|
import java.io.FileOutputStream;
|
||||||
import android.app.Dialog;
|
import java.io.IOException;
|
||||||
import android.app.ProgressDialog;
|
import java.io.InputStream;
|
||||||
import android.content.BroadcastReceiver;
|
import java.net.InetAddress;
|
||||||
import android.content.ContentResolver;
|
import java.nio.ByteBuffer;
|
||||||
import android.content.Context;
|
import java.sql.Timestamp;
|
||||||
import android.content.Intent;
|
import java.util.ArrayList;
|
||||||
import android.content.IntentFilter;
|
import java.util.Date;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import java.util.List;
|
||||||
import android.content.res.Resources;
|
import java.util.Timer;
|
||||||
import android.media.AudioManager;
|
import java.util.TimerTask;
|
||||||
import android.media.MediaPlayer;
|
|
||||||
import android.net.ConnectivityManager;
|
import static android.media.AudioManager.MODE_RINGTONE;
|
||||||
import android.net.NetworkInfo;
|
import static android.media.AudioManager.STREAM_RING;
|
||||||
import android.net.Uri;
|
import static android.media.AudioManager.STREAM_VOICE_CALL;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.PowerManager;
|
|
||||||
import android.os.PowerManager.WakeLock;
|
|
||||||
import android.os.Vibrator;
|
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.provider.Settings.SettingNotFoundException;
|
|
||||||
import android.telephony.TelephonyManager;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -145,8 +145,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
private ConnectivityManager mConnectivityManager;
|
private ConnectivityManager mConnectivityManager;
|
||||||
private BroadcastReceiver mKeepAliveReceiver;
|
private BroadcastReceiver mKeepAliveReceiver;
|
||||||
private BroadcastReceiver mDozeReceiver;
|
private BroadcastReceiver mDozeReceiver;
|
||||||
|
private BroadcastReceiver mHookReceiver;
|
||||||
private IntentFilter mKeepAliveIntentFilter;
|
private IntentFilter mKeepAliveIntentFilter;
|
||||||
private IntentFilter mDozeIntentFilter;
|
private IntentFilter mDozeIntentFilter;
|
||||||
|
private IntentFilter mHookIntentFilter;
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
private WakeLock mIncallWakeLock;
|
private WakeLock mIncallWakeLock;
|
||||||
private LinphoneAccountCreator accountCreator;
|
private LinphoneAccountCreator accountCreator;
|
||||||
|
@ -822,6 +824,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
mServiceContext.registerReceiver(mDozeReceiver, mDozeIntentFilter);
|
mServiceContext.registerReceiver(mDozeReceiver, mDozeIntentFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mHookIntentFilter = new IntentFilter("com.base.module.phone.HOOKEVENT");
|
||||||
|
mHookIntentFilter.setPriority(999);
|
||||||
|
mHookReceiver = new HookReceiver();
|
||||||
|
mServiceContext.registerReceiver(mHookReceiver, mHookIntentFilter);
|
||||||
|
|
||||||
|
|
||||||
updateNetworkReachability();
|
updateNetworkReachability();
|
||||||
|
|
||||||
resetCameraFromPreferences();
|
resetCameraFromPreferences();
|
||||||
|
@ -831,6 +839,20 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
accountCreator.setListener(this);
|
accountCreator.setListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setHandsetMode(Boolean on){
|
||||||
|
if(mLc.isInComingInvitePending() && on){
|
||||||
|
try {
|
||||||
|
mLc.acceptCall(mLc.getCurrentCall());
|
||||||
|
LinphoneActivity.instance().startIncallActivity(mLc.getCurrentCall());
|
||||||
|
}catch(LinphoneCoreException e){}
|
||||||
|
}else if(on && CallActivity.isInstanciated()){
|
||||||
|
CallActivity.instance().setSpeakerEnabled(true);
|
||||||
|
CallActivity.instance().refreshInCallActions();
|
||||||
|
}else if (!on){
|
||||||
|
LinphoneManager.getInstance().terminateCall();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void copyAssetsFromPackage() throws IOException {
|
private void copyAssetsFromPackage() throws IOException {
|
||||||
copyIfNotExist(R.raw.notes_of_the_optimistic, mRingSoundFile);
|
copyIfNotExist(R.raw.notes_of_the_optimistic, mRingSoundFile);
|
||||||
copyIfNotExist(R.raw.ringback, mRingbackSoundFile);
|
copyIfNotExist(R.raw.ringback, mRingbackSoundFile);
|
||||||
|
@ -1192,7 +1214,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.IncomingReceived && LinphonePreferences.instance().isAutoAnswerEnabled()) {
|
if (state == State.IncomingReceived && (LinphonePreferences.instance().isAutoAnswerEnabled())) {
|
||||||
try {
|
try {
|
||||||
mLc.acceptCall(call);
|
mLc.acceptCall(call);
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c1434a3f7c029fb69f557fca2b5fa1682786da5f
|
Subproject commit 91c0fc4a174ba25fb5335f5abfb3e07aec086168
|
Loading…
Reference in a new issue