Merge branch 'master' of git.linphone.org:linphone-android

This commit is contained in:
Jehan Monnier 2012-07-03 15:29:37 +02:00
commit 89093384a4
27 changed files with 884 additions and 592 deletions

3
.gitignore vendored
View file

@ -3,3 +3,6 @@ obj
gen gen
bin bin
doc doc
ant.properties
local.properties
project.properties

View file

@ -1,9 +1,27 @@
<?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 xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone" package="org.linphone"
android:versionCode="1310" android:versionName="1.3.1" android:installLocation="auto"> android:versionCode="1320" android:versionName="1.3.2" android:installLocation="auto">
<uses-sdk android:minSdkVersion="4"/> <uses-sdk android:minSdkVersion="4"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
<!-- Don't remove the space after android:debuggable: it prevents ndk-build to try including gdbserver and crash gcc --> <!-- Don't remove the space after android:debuggable: it prevents ndk-build to try including gdbserver and crash gcc -->
<application android:label="@string/app_name" android:debuggable ="true" android:icon="@drawable/logo_linphone_57x57"> <application android:label="@string/app_name" android:debuggable ="true" android:icon="@drawable/logo_linphone_57x57">
@ -197,23 +215,4 @@
</activity> </activity>
</application> </application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
</manifest> </manifest>

View file

@ -49,7 +49,6 @@ prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-sr
generate-libs: generate-libs:
$(NDK_PATH)/ndk-build BUILD_SILK=1 -j$(NUMCPUS) $(NDK_PATH)/ndk-build BUILD_SILK=1 -j$(NUMCPUS)
rm $(TOPDIR)/libs/armeabi/liblinphone.so
update-project: update-project:
$(SDK_PATH)/android update project --path . $(SDK_PATH)/android update project --path .

1080
build.xml

File diff suppressed because it is too large Load diff

View file

@ -116,8 +116,9 @@ ifeq ($(BUILD_SRTP), 1)
include $(linphone-root-dir)/submodules/externals/build/srtp/Android.mk include $(linphone-root-dir)/submodules/externals/build/srtp/Android.mk
endif endif
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk
endif
include $(linphone-root-dir)/submodules/linphone/build/android/Android-no-neon.mk include $(linphone-root-dir)/submodules/linphone/build/android/Android-no-neon.mk
_BUILD_AMR=0 _BUILD_AMR=0

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:linphone="http://schemas.android.com/apk/res/org.linphone" xmlns:linphone="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="fill_parent" android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">

View file

@ -259,6 +259,8 @@
<string name="wizard_confirmation">Confirmation</string> <string name="wizard_confirmation">Confirmation</string>
<string name="wizard_verify_account">Check</string> <string name="wizard_verify_account">Check</string>
<string name="pref_help_proxy">Redirect registrar packets to this server</string> <string name="pref_help_proxy">SIP proxy hostname or ip address (optional)</string>
<string name="pref_help_outbound_proxy">Redirect all traffic to proxy server</string> <string name="pref_help_outbound_proxy">Route all calls through SIP proxy</string>
<string name="pref_help_username">Example: john if your account is john@sip.linphone.org</string>
<string name="pref_help_domain">sip.linphone.org if your account is john@sip.linphone.org</string>
</resources> </resources>

View file

@ -268,19 +268,16 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { int id = v.getId();
case R.id.toggleMuteMic: if (id == R.id.toggleMuteMic) {
lc().muteMic(((Checkable) v).isChecked()); lc().muteMic(((Checkable) v).isChecked());
break; }
case R.id.toggleSpeaker: else if (id == R.id.toggleSpeaker) {
if (((Checkable) v).isChecked()) { if (((Checkable) v).isChecked()) {
LinphoneManager.getInstance().routeAudioToSpeaker(); LinphoneManager.getInstance().routeAudioToSpeaker();
} else { } else {
LinphoneManager.getInstance().routeAudioToReceiver(); LinphoneManager.getInstance().routeAudioToReceiver();
} }
break;
default:
break;
} }
} }

View file

@ -119,17 +119,17 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity {
this.dialog = dialog; this.dialog = dialog;
} }
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { int id = v.getId();
case R.id.terminate_call: if (id == R.id.terminate_call) {
lc().terminateCall(call); lc().terminateCall(call);
break; }
case R.id.remove_from_conference: else if (id == R.id.remove_from_conference) {
lc().removeFromConference(call); lc().removeFromConference(call);
if (LinphoneUtils.countConferenceCalls(lc()) == 0) { if (LinphoneUtils.countConferenceCalls(lc()) == 0) {
finish(); finish();
} }
break; }
default: else {
throw new RuntimeException("unknown id " + v.getId()); throw new RuntimeException("unknown id " + v.getId());
} }
if (dialog != null) dialog.dismiss(); if (dialog != null) dialog.dismiss();

View file

@ -95,15 +95,13 @@ public class HistoryActivity extends ListActivity {
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { int id = item.getItemId();
case R.id.menu_clear_history: if (id == R.id.menu_clear_history) {
LinphoneManager.getLc().clearCallLogs(); LinphoneManager.getLc().clearCallLogs();
setListAdapter(new CallHistoryAdapter(this)); setListAdapter(new CallHistoryAdapter(this));
}
break; else {
default:
Log.e("Unknown menu item [",item,"]"); Log.e("Unknown menu item [",item,"]");
break;
} }
return false; return false;

View file

@ -332,29 +332,29 @@ public class IncallActivity extends AbstractCalleesActivity implements
} }
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { int id = v.getId();
case R.id.addCall: if (id == R.id.addCall) {
finish(); finish();
break; }
case R.id.incallHang: else if (id == R.id.incallHang) {
terminateCurrentCallOrConferenceOrAll(); terminateCurrentCallOrConferenceOrAll();
break; }
case R.id.conf_header: else if (id == R.id.conf_header) {
boolean enterConf = !lc().isInConference(); boolean enterConf = !lc().isInConference();
enterConferenceAndVirtualConfView(enterConf); enterConferenceAndVirtualConfView(enterConf);
break; }
case R.id.conf_header_details: else if (id == R.id.conf_header_details) {
onLongClick(v); onLongClick(v);
break; }
case R.id.incallNumpadShow: else if (id == R.id.incallNumpadShow) {
showDialog(numpadDialogId); showDialog(numpadDialogId);
break; }
case R.id.conf_simple_merge: else if (id == R.id.conf_simple_merge) {
if (!lc().soundResourcesLocked()) { if (!lc().soundResourcesLocked()) {
lc().addAllToConference(); lc().addAllToConference();
} }
break; }
case R.id.conf_simple_pause: else if (id == R.id.conf_simple_pause) {
LinphoneCall call = lc().getCurrentCall(); LinphoneCall call = lc().getCurrentCall();
if (call != null) { if (call != null) {
lc().pauseCall(call); lc().pauseCall(call);
@ -366,8 +366,8 @@ public class IncallActivity extends AbstractCalleesActivity implements
lc().resumeCall(callToResume); lc().resumeCall(callToResume);
} }
} }
break; }
case R.id.conf_simple_video: else if (id == R.id.conf_simple_video) {
LinphoneCall vCall = lc().getCurrentCall(); LinphoneCall vCall = lc().getCurrentCall();
if (vCall != null) { if (vCall != null) {
if (!vCall.cameraEnabled() && vCall.getCurrentParamsCopy().getVideoEnabled()) { if (!vCall.cameraEnabled() && vCall.getCurrentParamsCopy().getVideoEnabled()) {
@ -378,8 +378,8 @@ public class IncallActivity extends AbstractCalleesActivity implements
LinphoneActivity.instance().startVideoActivity(vCall, 0); LinphoneActivity.instance().startVideoActivity(vCall, 0);
} }
} }
break; }
default: else {
// mic, speaker // mic, speaker
super.onClick(v); super.onClick(v);
} }
@ -431,21 +431,21 @@ public class IncallActivity extends AbstractCalleesActivity implements
this.dialog = dialog; this.dialog = dialog;
} }
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { int id =v.getId();
case R.id.merge_to_conference: if (id == R.id.merge_to_conference) {
lc().addToConference(call); lc().addToConference(call);
break; }
case R.id.terminate_call: else if (id == R.id.terminate_call) {
lc().terminateCall(call); lc().terminateCall(call);
break; }
case R.id.transfer_existing: else if (id == R.id.transfer_existing) {
prepareForTransferingExistingOrNewCall(call); prepareForTransferingExistingOrNewCall(call);
break; }
case R.id.transfer_new: else if (id == R.id.transfer_new) {
openUriPicker(UriPickerActivity.EXTRA_PICKER_TYPE_TRANSFER, transferCallId); openUriPicker(UriPickerActivity.EXTRA_PICKER_TYPE_TRANSFER, transferCallId);
mCallToTransfer = call; mCallToTransfer = call;
break; }
case R.id.addVideo: else if (id == R.id.addVideo) {
if (!call.cameraEnabled() && call.getCurrentParamsCopy().getVideoEnabled()) { if (!call.cameraEnabled() && call.getCurrentParamsCopy().getVideoEnabled()) {
// NoWebcam mode, we let it this way // NoWebcam mode, we let it this way
LinphoneActivity.instance().startVideoActivity(call, 0); LinphoneActivity.instance().startVideoActivity(call, 0);
@ -453,17 +453,17 @@ public class IncallActivity extends AbstractCalleesActivity implements
else if (!LinphoneManager.getInstance().addVideo()) { else if (!LinphoneManager.getInstance().addVideo()) {
LinphoneActivity.instance().startVideoActivity(call, 0); LinphoneActivity.instance().startVideoActivity(call, 0);
} }
break; }
case R.id.set_auth_token_verified: else if (id == R.id.set_auth_token_verified) {
call.setAuthenticationTokenVerified(true); call.setAuthenticationTokenVerified(true);
break; }
case R.id.set_auth_token_not_verified: else if (id == R.id.set_auth_token_not_verified) {
call.setAuthenticationTokenVerified(false); call.setAuthenticationTokenVerified(false);
break; }
case R.id.encrypted: else if (id == R.id.encrypted) {
call.setAuthenticationTokenVerified(!call.isAuthenticationTokenVerified()); call.setAuthenticationTokenVerified(!call.isAuthenticationTokenVerified());
break; }
default: else {
throw new RuntimeException("unknown id " + v.getId()); throw new RuntimeException("unknown id " + v.getId());
} }
if (dialog != null) dialog.dismiss(); if (dialog != null) dialog.dismiss();

View file

@ -22,6 +22,7 @@ package org.linphone;
import static android.content.Intent.ACTION_MAIN; import static android.content.Intent.ACTION_MAIN;
import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore;
@ -101,7 +102,8 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
instance = this; instance = this;
setContentView(R.layout.main); setContentView(R.layout.main);
int rotation = getWindowManager().getDefaultDisplay().getRotation() * 90; @SuppressWarnings("deprecation")
int rotation = Compatibility.getRotation(getWindowManager().getDefaultDisplay());
// Inverse landscape rotation to initiate linphoneCore correctly // Inverse landscape rotation to initiate linphoneCore correctly
if (rotation == 270) if (rotation == 270)
rotation = 90; rotation = 90;
@ -263,21 +265,22 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { int id = item.getItemId();
case R.id.menu_settings: if (id == R.id.menu_settings) {
startprefActivity(); startprefActivity();
return true; return true;
case R.id.menu_exit: }
else if (id == R.id.menu_exit) {
finish(); finish();
stopService(new Intent(ACTION_MAIN) stopService(new Intent(ACTION_MAIN)
.setClass(this, LinphoneService.class)); .setClass(this, LinphoneService.class));
break; }
case R.id.menu_about: else if (id == R.id.menu_about) {
startActivity(new Intent(ACTION_MAIN) startActivity(new Intent(ACTION_MAIN)
.setClass(this, AboutActivity.class)); .setClass(this, AboutActivity.class));
default: }
else {
Log.e("Unknown menu item [",item,"]"); Log.e("Unknown menu item [",item,"]");
break;
} }
return false; return false;

View file

@ -52,7 +52,9 @@ public class LinphoneLauncherActivity extends Activity {
} }
} }
private void onServiceReady() { protected void onServiceReady() {
LinphoneService.instance().setActivityToLaunchOnIncomingReceived(LinphoneActivity.class);
startActivity(new Intent() startActivity(new Intent()
.setClass(this, LinphoneActivity.class) .setClass(this, LinphoneActivity.class)
.setData(getIntent().getData())); .setData(getIntent().getData()));

View file

@ -1050,11 +1050,21 @@ public final class LinphoneManager implements LinphoneCoreListener {
private boolean isRinging; private boolean isRinging;
private boolean disableRinging = false;
public void disableRinging() {
disableRinging = true;
}
private synchronized void startRinging() { private synchronized void startRinging() {
if (disableRinging ) {
return;
}
if (Hacks.needGalaxySAudioHack()) { if (Hacks.needGalaxySAudioHack()) {
mAudioManager.setMode(MODE_RINGTONE); mAudioManager.setMode(MODE_RINGTONE);
} }
try { try {
if (mAudioManager.shouldVibrate(VIBRATE_TYPE_RINGER) && mVibrator !=null) { if (mAudioManager.shouldVibrate(VIBRATE_TYPE_RINGER) && mVibrator !=null) {
long[] patern = {0,1000,1000}; long[] patern = {0,1000,1000};
@ -1428,4 +1438,10 @@ public final class LinphoneManager implements LinphoneCoreListener {
super(throwable); super(throwable);
} }
} }
@Override
public void notifyReceived(LinphoneCore lc, LinphoneCall call,
LinphoneAddress from, byte[] event) {
}
} }

View file

@ -57,7 +57,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
username.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); username.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
username.setTitle(getString(R.string.pref_username)); username.setTitle(getString(R.string.pref_username));
username.setPersistent(true); username.setPersistent(true);
username.setDialogMessage("Example: toto if your account is toto@sip.linphone.org"); username.setDialogMessage(getString(R.string.pref_help_username));
username.setKey(getString(R.string.pref_username_key) + getAccountNumber(n)); username.setKey(getString(R.string.pref_username_key) + getAccountNumber(n));
username.setOnPreferenceChangeListener(preferenceChangedListener); username.setOnPreferenceChangeListener(preferenceChangedListener);
@ -71,7 +71,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
domain.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); domain.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
domain.setTitle(getString(R.string.pref_domain)); domain.setTitle(getString(R.string.pref_domain));
domain.setPersistent(true); domain.setPersistent(true);
domain.setDialogMessage("Example: sip.linphone.org if your account is toto@sip.linphone.org"); domain.setDialogMessage(getString(R.string.pref_help_domain));
domain.setKey(getString(R.string.pref_domain_key) + getAccountNumber(n)); domain.setKey(getString(R.string.pref_domain_key) + getAccountNumber(n));
domain.setOnPreferenceChangeListener(preferenceChangedListener); domain.setOnPreferenceChangeListener(preferenceChangedListener);

View file

@ -35,6 +35,7 @@ import org.linphone.core.Log;
import org.linphone.core.OnlineStatus; import org.linphone.core.OnlineStatus;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
import android.app.Activity;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
@ -86,7 +87,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
/** /**
* @throws RuntimeException service not instantiated * @throws RuntimeException service not instantiated
*/ */
static LinphoneService instance() { public static LinphoneService instance() {
if (isReady()) return instance; if (isReady()) return instance;
throw new RuntimeException("LinphoneService not instantiated yet"); throw new RuntimeException("LinphoneService not instantiated yet");
@ -242,6 +243,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
private Object[] mSetForegroundArgs = new Object[1]; private Object[] mSetForegroundArgs = new Object[1];
private Object[] mStartForegroundArgs = new Object[2]; private Object[] mStartForegroundArgs = new Object[2];
private Object[] mStopForegroundArgs = new Object[1]; private Object[] mStopForegroundArgs = new Object[1];
private Class<? extends Activity> incomingReceivedActivity = LinphoneActivity.class;
void invokeMethod(Method method, Object[] args) { void invokeMethod(Method method, Object[] args) {
try { try {
@ -438,7 +440,21 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
}); });
} }
} }
public void setActivityToLaunchOnIncomingReceived(Class<? extends Activity> activity) {
incomingReceivedActivity = activity;
Intent notifIntent = new Intent(this, incomingReceivedActivity);
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, 0);
mNotif.setLatestEventInfo(this, mNotificationTitle,"", mNotifContentIntent);
}
protected void onIncomingReceived() {
//wakeup linphone
startActivity(new Intent()
.setClass(this, incomingReceivedActivity)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
public void onCallStateChanged(final LinphoneCall call, final State state, final String message) { public void onCallStateChanged(final LinphoneCall call, final State state, final String message) {
if (instance == null) { if (instance == null) {
@ -446,10 +462,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
return; return;
} }
if (state == LinphoneCall.State.IncomingReceived) { if (state == LinphoneCall.State.IncomingReceived) {
//wakeup linphone onIncomingReceived();
startActivity(new Intent()
.setClass(this, LinphoneActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} }
if (state == State.CallUpdatedByRemote) { if (state == State.CallUpdatedByRemote) {

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package org.linphone; package org.linphone;
import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCallParams; import org.linphone.core.LinphoneCallParams;
@ -260,12 +261,12 @@ public class VideoCallActivity extends Activity implements
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { int id = item.getItemId();
case R.id.videocall_menu_back_to_dialer: if (id == R.id.videocall_menu_back_to_dialer) {
finish(); finish();
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
break; }
case R.id.videocall_menu_change_resolution: else if (id == R.id.videocall_menu_change_resolution) {
LinphoneManager.getInstance().changeResolution(); LinphoneManager.getInstance().changeResolution();
// previous call will cause graph reconstruction -> regive preview // previous call will cause graph reconstruction -> regive preview
// window // window
@ -273,11 +274,11 @@ public class VideoCallActivity extends Activity implements
LinphoneManager.getLc() LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady); .setPreviewWindow(mVideoCaptureViewReady);
rewriteChangeResolutionItem(item); rewriteChangeResolutionItem(item);
break; }
case R.id.videocall_menu_terminate_call: else if (id == R.id.videocall_menu_terminate_call) {
LinphoneManager.getInstance().terminateCall(); LinphoneManager.getInstance().terminateCall();
break; }
case R.id.videocall_menu_toggle_camera: else if (id == R.id.videocall_menu_toggle_camera) {
boolean camEnabled = LinphoneManager.getInstance() boolean camEnabled = LinphoneManager.getInstance()
.toggleEnableCamera(); .toggleEnableCamera();
updatePreview(camEnabled); updatePreview(camEnabled);
@ -291,21 +292,20 @@ public class VideoCallActivity extends Activity implements
mVideoCaptureViewReady); mVideoCaptureViewReady);
} else } else
LinphoneManager.getLc().setPreviewWindow(null); LinphoneManager.getLc().setPreviewWindow(null);
break; }
case R.id.videocall_menu_switch_camera: else if (id == R.id.videocall_menu_switch_camera) {
int id = LinphoneManager.getLc().getVideoDevice(); int videoDeviceId = LinphoneManager.getLc().getVideoDevice();
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length; videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length;
LinphoneManager.getLc().setVideoDevice(id); LinphoneManager.getLc().setVideoDevice(videoDeviceId);
CallManager.getInstance().updateCall(); CallManager.getInstance().updateCall();
// previous call will cause graph reconstruction -> regive preview // previous call will cause graph reconstruction -> regive preview
// window // window
if (mVideoCaptureViewReady != null) if (mVideoCaptureViewReady != null)
LinphoneManager.getLc() LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady); .setPreviewWindow(mVideoCaptureViewReady);
break; }
default: else {
Log.e("Unknown menu item [", item, "]"); Log.e("Unknown menu item [", item, "]");
break;
} }
return true; return true;
} }
@ -457,7 +457,8 @@ public class VideoCallActivity extends Activity implements
private void resizePreview() { private void resizePreview() {
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)) Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay(); .getDefaultDisplay();
int rotation = display.getRotation();
int rotation = Compatibility.getRotation(display);
LayoutParams params; LayoutParams params;
int w, h; int w, h;
@ -500,48 +501,47 @@ public class VideoCallActivity extends Activity implements
public void onClick(View v) { public void onClick(View v) {
resetControlsLayoutExpiration(); resetControlsLayoutExpiration();
switch (v.getId()) { int id = v.getId();
case R.id.incallHang: if (id == R.id.incallHang) {
terminateCurrentCallOrConferenceOrAll(); terminateCurrentCallOrConferenceOrAll();
break; }
case R.id.toggleSpeaker: else if (id == R.id.toggleSpeaker) {
if (((Checkable) v).isChecked()) { if (((Checkable) v).isChecked()) {
LinphoneManager.getInstance().routeAudioToSpeaker(); LinphoneManager.getInstance().routeAudioToSpeaker();
} else { } else {
LinphoneManager.getInstance().routeAudioToReceiver(); LinphoneManager.getInstance().routeAudioToReceiver();
} }
break; }
case R.id.incallNumpadShow: else if (id == R.id.incallNumpadShow) {
showDialog(numpadDialogId); showDialog(numpadDialogId);
break; }
case R.id.toggleMuteMic: else if (id == R.id.toggleMuteMic) {
LinphoneManager.getLc().muteMic(((Checkable) v).isChecked()); LinphoneManager.getLc().muteMic(((Checkable) v).isChecked());
break; }
case R.id.switch_camera: else if (id == R.id.switch_camera) {
int id = LinphoneManager.getLc().getVideoDevice(); int videoDeviceId = LinphoneManager.getLc().getVideoDevice();
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length; videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length;
LinphoneManager.getLc().setVideoDevice(id); LinphoneManager.getLc().setVideoDevice(videoDeviceId);
CallManager.getInstance().updateCall(); CallManager.getInstance().updateCall();
// previous call will cause graph reconstruction -> regive preview // previous call will cause graph reconstruction -> regive preview
// window // window
if (mVideoCaptureViewReady != null) if (mVideoCaptureViewReady != null)
LinphoneManager.getLc() LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady); .setPreviewWindow(mVideoCaptureViewReady);
break; }
case R.id.conf_simple_pause: else if (id == R.id.conf_simple_pause) {
finish(); finish();
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
LinphoneManager.getLc().pauseCall(videoCall); LinphoneManager.getLc().pauseCall(videoCall);
break; }
case R.id.conf_simple_video: else if (id == R.id.conf_simple_video) {
LinphoneCallParams params = videoCall.getCurrentParamsCopy(); LinphoneCallParams params = videoCall.getCurrentParamsCopy();
params.setVideoEnabled(false); params.setVideoEnabled(false);
LinphoneManager.getLc().updateCall(videoCall, params); LinphoneManager.getLc().updateCall(videoCall, params);
break; }
case R.id.back: else if (id == R.id.back) {
finish(); finish();
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
break;
} }
} }

View file

@ -0,0 +1,10 @@
package org.linphone.compatibility;
import android.view.Display;
public class API4Compatibility {
public static int getRotation(Display display) {
return display.getOrientation();
}
}

View file

@ -0,0 +1,10 @@
package org.linphone.compatibility;
import android.view.Display;
public class API8Compatibility {
public static int getRotation(Display display) {
return display.getRotation();
}
}

View file

@ -0,0 +1,17 @@
package org.linphone.compatibility;
import org.linphone.mediastream.Version;
import android.view.Display;
public class Compatibility {
public static int getRotation(Display display) {
if (Version.sdkStrictlyBelow(8)) {
return API4Compatibility.getRotation(display);
} else {
return API8Compatibility.getRotation(display);
}
}
}

View file

@ -155,4 +155,14 @@ class LinphoneCallImpl implements LinphoneCall {
public float getPlayVolume() { public float getPlayVolume() {
return getPlayVolume(nativePtr); return getPlayVolume(nativePtr);
} }
private native void takeSnapshot(long nativePtr, String path);
public void takeSnapshot(String path) {
takeSnapshot(nativePtr, path);
}
private native void zoomVideo(long nativePtr, float factor, float cx, float cy);
public void zoomVideo(float factor, float cx, float cy) {
zoomVideo(nativePtr, factor, cx, cy);
}
} }

View file

@ -45,5 +45,15 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
public CallStatus getStatus() { public CallStatus getStatus() {
throw new RuntimeException("not implemented yet"); throw new RuntimeException("not implemented yet");
} }
@Override
public String getStartDate() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getCallDuration() {
// TODO Auto-generated method stub
return 0;
}
} }

View file

@ -20,7 +20,6 @@ package org.linphone.core;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Vector;
class LinphoneCoreImpl implements LinphoneCore { class LinphoneCoreImpl implements LinphoneCore {
@ -704,4 +703,30 @@ class LinphoneCoreImpl implements LinphoneCore {
{ {
setCpuCountNative(count); setCpuCountNative(count);
} }
private native void tunnelSetHttpProxyNative(long nativePtr, String proxy_host, int port, String username, String password);
@Override
public void tunnelSetHttpProxy(String proxy_host, int port,
String username, String password) {
tunnelSetHttpProxyNative(nativePtr,proxy_host, port, username, password);
}
private native void removeCallLog(long nativePtr, LinphoneCallLog log);
public void removeCallLog(LinphoneCallLog log) {
removeCallLog(nativePtr, log);
}
private native int getMissedCallsCount(long nativePtr);
public int getMissedCallsCount() {
return getMissedCallsCount(nativePtr);
}
private native void resetMissedCallsCount(long nativePtr);
public void resetMissedCallsCount() {
resetMissedCallsCount(nativePtr);
}
private native void refreshRegisters(long nativePtr);
public void refreshRegisters() {
refreshRegisters(nativePtr);
}
} }

View file

@ -70,6 +70,7 @@ LOCAL_SRC_FILES = \
libavcodec/jrevdct.c \ libavcodec/jrevdct.c \
libavcodec/mjpeg.c.arm \ libavcodec/mjpeg.c.arm \
libavcodec/mjpegdec.c.arm \ libavcodec/mjpegdec.c.arm \
libavcodec/mjpegenc.c.arm \
libavcodec/motion_est.c.arm \ libavcodec/motion_est.c.arm \
libavcodec/mpeg12data.c \ libavcodec/mpeg12data.c \
libavcodec/mpeg4video.c.arm \ libavcodec/mpeg4video.c.arm \

View file

@ -515,7 +515,7 @@
#define CONFIG_HUFFYUV_ENCODER 0 #define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0 #define CONFIG_JPEGLS_ENCODER 0
#define CONFIG_LJPEG_ENCODER 0 #define CONFIG_LJPEG_ENCODER 0
#define CONFIG_MJPEG_ENCODER 0 #define CONFIG_MJPEG_ENCODER 1
#define CONFIG_MPEG1VIDEO_ENCODER 0 #define CONFIG_MPEG1VIDEO_ENCODER 0
#define CONFIG_MPEG2VIDEO_ENCODER 0 #define CONFIG_MPEG2VIDEO_ENCODER 0
#define CONFIG_MPEG4_ENCODER 1 #define CONFIG_MPEG4_ENCODER 1

@ -1 +1 @@
Subproject commit af32518af41f97caee07070234a3475409b9a27d Subproject commit a70714c2e8a1f6f9958450cb612e3dc9895981e7

@ -1 +1 @@
Subproject commit e2379a67051d30fb061ce738cf83e4d81f45bb14 Subproject commit 9f02a12f4641989a225ee77bf6f403cd1c57d9e6