Fix issues/behaviour on smartphones + update linphone/ms2/ortp

This commit is contained in:
Sylvain Berfini 2012-04-27 15:42:35 +02:00
parent 0245c56776
commit 273b42d72c
5 changed files with 286 additions and 169 deletions

View file

@ -518,9 +518,10 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
mCamera.startPreview(); mCamera.startPreview();
} else if (LinphoneManager.getLc().isIncall()) } else if (LinphoneManager.getLc().isIncall())
{ {
if (mInCallControls != null) if (mInCallControls != null) {
mInCallControls.setVisibility(View.VISIBLE); mInCallControls.setVisibility(View.VISIBLE);
mCall.setVisibility(View.GONE); mCall.setVisibility(View.GONE);
}
if (mSwitchCamera != null) if (mSwitchCamera != null)
mSwitchCamera.setVisibility(View.INVISIBLE); mSwitchCamera.setVisibility(View.INVISIBLE);

View file

@ -622,6 +622,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E
{ {
// Android without neon doesn't support H264 // Android without neon doesn't support H264
findPreference(R.string.pref_video_codec_h264_key).setEnabled(false); findPreference(R.string.pref_video_codec_h264_key).setEnabled(false);
findPreference(R.string.pref_video_codec_h264_key).setDefaultValue(false);
} }
addEchoPrefsListener(); addEchoPrefsListener();

View file

@ -18,8 +18,6 @@ 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.core.LinphoneCall; import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCall.State;
@ -44,6 +42,9 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock; import android.os.PowerManager.WakeLock;
import android.view.Display; import android.view.Display;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.Surface; import android.view.Surface;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
@ -60,10 +61,12 @@ import android.widget.RelativeLayout.LayoutParams;
/** /**
* For Android SDK >= 5 * For Android SDK >= 5
*
* @author Guillaume Beraudo * @author Guillaume Beraudo
* *
*/ */
public class VideoCallActivity extends Activity implements LinphoneOnCallStateChangedListener, OnClickListener { public class VideoCallActivity extends Activity implements
LinphoneOnCallStateChangedListener, OnClickListener {
private final static int DELAY_BEFORE_HIDING_CONTROLS = 2000; private final static int DELAY_BEFORE_HIDING_CONTROLS = 2000;
private static final int numpadDialogId = 1; private static final int numpadDialogId = 1;
@ -81,8 +84,10 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (!LinphoneManager.isInstanciated() || LinphoneManager.getLc().getCallsNb() == 0) { if (!LinphoneManager.isInstanciated()
Log.e("No service running: avoid crash by finishing ", getClass().getName()); || LinphoneManager.getLc().getCallsNb() == 0) {
Log.e("No service running: avoid crash by finishing ", getClass()
.getName());
// super.onCreate called earlier // super.onCreate called earlier
finish(); finish();
return; return;
@ -92,33 +97,42 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
SurfaceView videoView = (SurfaceView) findViewById(R.id.video_surface); SurfaceView videoView = (SurfaceView) findViewById(R.id.video_surface);
//((FrameLayout) findViewById(R.id.video_frame)).bringChildToFront(findViewById(R.id.imageView1)); // ((FrameLayout)
// findViewById(R.id.video_frame)).bringChildToFront(findViewById(R.id.imageView1));
SurfaceView captureView = (SurfaceView) findViewById(R.id.video_capture_surface); SurfaceView captureView = (SurfaceView) findViewById(R.id.video_capture_surface);
captureView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); captureView.getHolder()
.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
/* force surfaces Z ordering */ /* force surfaces Z ordering */
fixZOrder(videoView, captureView); fixZOrder(videoView, captureView);
androidVideoWindowImpl = new AndroidVideoWindowImpl(videoView, captureView); androidVideoWindowImpl = new AndroidVideoWindowImpl(videoView,
androidVideoWindowImpl.setListener(new AndroidVideoWindowImpl.VideoWindowListener() { captureView);
androidVideoWindowImpl
.setListener(new AndroidVideoWindowImpl.VideoWindowListener() {
public void onVideoRenderingSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface) { public void onVideoRenderingSurfaceReady(
AndroidVideoWindowImpl vw, SurfaceView surface) {
LinphoneManager.getLc().setVideoWindow(vw); LinphoneManager.getLc().setVideoWindow(vw);
mVideoViewReady = surface; mVideoViewReady = surface;
} }
public void onVideoRenderingSurfaceDestroyed(AndroidVideoWindowImpl vw) { public void onVideoRenderingSurfaceDestroyed(
AndroidVideoWindowImpl vw) {
Log.d("VIDEO WINDOW destroyed!\n"); Log.d("VIDEO WINDOW destroyed!\n");
LinphoneManager.getLc().setVideoWindow(null); LinphoneManager.getLc().setVideoWindow(null);
} }
public void onVideoPreviewSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface) { public void onVideoPreviewSurfaceReady(
AndroidVideoWindowImpl vw, SurfaceView surface) {
mVideoCaptureViewReady = surface; mVideoCaptureViewReady = surface;
LinphoneManager.getLc().setPreviewWindow(mVideoCaptureViewReady); LinphoneManager.getLc().setPreviewWindow(
mVideoCaptureViewReady);
} }
public void onVideoPreviewSurfaceDestroyed(AndroidVideoWindowImpl vw) { public void onVideoPreviewSurfaceDestroyed(
AndroidVideoWindowImpl vw) {
// Remove references kept in jni code and restart camera // Remove references kept in jni code and restart camera
LinphoneManager.getLc().setPreviewWindow(null); LinphoneManager.getLc().setPreviewWindow(null);
} }
@ -129,28 +143,30 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
videoCall = LinphoneManager.getLc().getCurrentCall(); videoCall = LinphoneManager.getLc().getCurrentCall();
if (videoCall != null) { if (videoCall != null) {
LinphoneManager lm = LinphoneManager.getInstance(); LinphoneManager lm = LinphoneManager.getInstance();
if (!lm.shareMyCamera() && !lm.isVideoInitiator() && videoCall.cameraEnabled()) { if (!lm.shareMyCamera() && !lm.isVideoInitiator()
&& videoCall.cameraEnabled()) {
lm.sendStaticImage(true); lm.sendStaticImage(true);
} }
updatePreview(videoCall.cameraEnabled()); updatePreview(videoCall.cameraEnabled());
} }
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,Log.TAG); mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, Log.TAG);
mWakeLock.acquire(); mWakeLock.acquire();
mControlsLayout = (LinearLayout) findViewById(R.id.incall_controls_layout); mControlsLayout = (LinearLayout) findViewById(R.id.incall_controls_layout);
videoView.setOnTouchListener(new OnTouchListener() { videoView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
if (mControlsLayout != null && mControlsLayout.getVisibility() == View.GONE) if (mControlsLayout != null
{ && mControlsLayout.getVisibility() == View.GONE) {
mControlsLayout.setVisibility(View.VISIBLE); mControlsLayout.setVisibility(View.VISIBLE);
controlsHandler.postDelayed(mControls = new Runnable(){ controlsHandler.postDelayed(mControls = new Runnable() {
public void run() { public void run() {
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
} }
},DELAY_BEFORE_HIDING_CONTROLS); }, DELAY_BEFORE_HIDING_CONTROLS);
return true; return true;
} }
@ -162,8 +178,7 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
findViewById(R.id.switch_camera).setVisibility(View.GONE); findViewById(R.id.switch_camera).setVisibility(View.GONE);
} }
if (Version.isXLargeScreen(this)) if (Version.isXLargeScreen(this)) {
{
findViewById(R.id.toggleMuteMic).setOnClickListener(this); findViewById(R.id.toggleMuteMic).setOnClickListener(this);
findViewById(R.id.toggleSpeaker).setOnClickListener(this); findViewById(R.id.toggleSpeaker).setOnClickListener(this);
findViewById(R.id.incallNumpadShow).setOnClickListener(this); findViewById(R.id.incallNumpadShow).setOnClickListener(this);
@ -173,8 +188,7 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
findViewById(R.id.conf_simple_pause).setOnClickListener(this); findViewById(R.id.conf_simple_pause).setOnClickListener(this);
findViewById(R.id.conf_simple_video).setOnClickListener(this); findViewById(R.id.conf_simple_video).setOnClickListener(this);
if (LinphoneManager.getInstance().isSpeakerOn()) if (LinphoneManager.getInstance().isSpeakerOn()) {
{
ToggleImageButton speaker = (ToggleImageButton) findViewById(R.id.toggleSpeaker); ToggleImageButton speaker = (ToggleImageButton) findViewById(R.id.toggleSpeaker);
speaker.setChecked(true); speaker.setChecked(true);
speaker.setEnabled(false); speaker.setEnabled(false);
@ -187,38 +201,128 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
LinphoneManager.getLc().getCurrentCall().enableCamera(false); LinphoneManager.getLc().getCurrentCall().enableCamera(false);
} }
void updateQualityOfSignalIcon(float quality) void updateQualityOfSignalIcon(float quality) {
{
ImageView qos = (ImageView) findViewById(R.id.QoS); ImageView qos = (ImageView) findViewById(R.id.QoS);
if (quality >= 4) // Good Quality if (quality >= 4) // Good Quality
{ {
qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_4)); qos.setImageDrawable(getResources().getDrawable(
} R.drawable.stat_sys_signal_4));
else if (quality >= 3) // Average quality } else if (quality >= 3) // Average quality
{ {
qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_3)); qos.setImageDrawable(getResources().getDrawable(
} R.drawable.stat_sys_signal_3));
else if (quality >= 2) // Low quality } else if (quality >= 2) // Low quality
{ {
qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_2)); qos.setImageDrawable(getResources().getDrawable(
} R.drawable.stat_sys_signal_2));
else if (quality >= 1) // Very low quality } else if (quality >= 1) // Very low quality
{ {
qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_1)); qos.setImageDrawable(getResources().getDrawable(
} R.drawable.stat_sys_signal_1));
else // Worst quality } else // Worst quality
{ {
qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_0)); qos.setImageDrawable(getResources().getDrawable(
R.drawable.stat_sys_signal_0));
} }
} }
private void rewriteToggleCameraItem(MenuItem item) {
if (LinphoneManager.getLc().getCurrentCall().cameraEnabled()) {
item.setTitle(getString(R.string.menu_videocall_toggle_camera_disable));
} else {
item.setTitle(getString(R.string.menu_videocall_toggle_camera_enable));
}
}
private void rewriteChangeResolutionItem(MenuItem item) {
if (BandwidthManager.getInstance().isUserRestriction()) {
item.setTitle(getString(R.string.menu_videocall_change_resolution_when_low_resolution));
} else {
item.setTitle(getString(R.string.menu_videocall_change_resolution_when_high_resolution));
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (Version.isXLargeScreen(this))
return false;
// Inflate the currently selected menu XML resource.
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.videocall_activity_menu, menu);
rewriteToggleCameraItem(menu
.findItem(R.id.videocall_menu_toggle_camera));
rewriteChangeResolutionItem(menu
.findItem(R.id.videocall_menu_change_resolution));
if (!AndroidCameraConfiguration.hasSeveralCameras()) {
menu.findItem(R.id.videocall_menu_switch_camera).setVisible(false);
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.videocall_menu_back_to_dialer:
finish();
LinphoneActivity.instance().startIncallActivity();
break;
case R.id.videocall_menu_change_resolution:
LinphoneManager.getInstance().changeResolution();
// previous call will cause graph reconstruction -> regive preview
// window
if (mVideoCaptureViewReady != null)
LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady);
rewriteChangeResolutionItem(item);
break;
case R.id.videocall_menu_terminate_call:
LinphoneManager.getInstance().terminateCall();
break;
case R.id.videocall_menu_toggle_camera:
boolean camEnabled = LinphoneManager.getInstance()
.toggleEnableCamera();
updatePreview(camEnabled);
Log.e("winwow camera enabled: " + camEnabled);
rewriteToggleCameraItem(item);
// previous call will cause graph reconstruction -> regive preview
// window
if (camEnabled) {
if (mVideoCaptureViewReady != null)
LinphoneManager.getLc().setPreviewWindow(
mVideoCaptureViewReady);
} else
LinphoneManager.getLc().setPreviewWindow(null);
break;
case R.id.videocall_menu_switch_camera:
int id = LinphoneManager.getLc().getVideoDevice();
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length;
LinphoneManager.getLc().setVideoDevice(id);
CallManager.getInstance().updateCall();
// previous call will cause graph reconstruction -> regive preview
// window
if (mVideoCaptureViewReady != null)
LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady);
break;
default:
Log.e("Unknown menu item [", item, "]");
break;
}
return true;
}
void updatePreview(boolean cameraCaptureEnabled) { void updatePreview(boolean cameraCaptureEnabled) {
mVideoCaptureViewReady = null; mVideoCaptureViewReady = null;
if (cameraCaptureEnabled) { if (cameraCaptureEnabled) {
findViewById(R.id.imageView1).setVisibility(View.INVISIBLE); findViewById(R.id.imageView1).setVisibility(View.INVISIBLE);
findViewById(R.id.video_capture_surface).setVisibility(View.VISIBLE); findViewById(R.id.video_capture_surface)
.setVisibility(View.VISIBLE);
} else { } else {
findViewById(R.id.video_capture_surface).setVisibility(View.INVISIBLE); findViewById(R.id.video_capture_surface).setVisibility(
View.INVISIBLE);
findViewById(R.id.imageView1).setVisibility(View.VISIBLE); findViewById(R.id.imageView1).setVisibility(View.VISIBLE);
} }
findViewById(R.id.video_frame).requestLayout(); findViewById(R.id.video_frame).requestLayout();
@ -229,35 +333,37 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
preview.setZOrderOnTop(true); preview.setZOrderOnTop(true);
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (mVideoViewReady != null) if (mVideoViewReady != null)
((GLSurfaceView)mVideoViewReady).onResume(); ((GLSurfaceView) mVideoViewReady).onResume();
synchronized (androidVideoWindowImpl) { synchronized (androidVideoWindowImpl) {
LinphoneManager.getLc().setVideoWindow(androidVideoWindowImpl); LinphoneManager.getLc().setVideoWindow(androidVideoWindowImpl);
} }
launched=true; launched = true;
LinphoneManager.addListener(this); LinphoneManager.addListener(this);
refreshHandler.postDelayed(mCallQualityUpdater=new Runnable(){ refreshHandler.postDelayed(mCallQualityUpdater = new Runnable() {
LinphoneCall mCurrentCall=LinphoneManager.getLc().getCurrentCall(); LinphoneCall mCurrentCall = LinphoneManager.getLc()
.getCurrentCall();
public void run() { public void run() {
if (mCurrentCall==null){ if (mCurrentCall == null) {
mCallQualityUpdater=null; mCallQualityUpdater = null;
return; return;
} }
int oldQuality = 0; int oldQuality = 0;
float newQuality = mCurrentCall.getCurrentQuality(); float newQuality = mCurrentCall.getCurrentQuality();
if ((int) newQuality != oldQuality){ if ((int) newQuality != oldQuality) {
updateQualityOfSignalIcon(newQuality); updateQualityOfSignalIcon(newQuality);
} }
if (launched){ if (launched) {
refreshHandler.postDelayed(this, 1000); refreshHandler.postDelayed(this, 1000);
}else mCallQualityUpdater=null; } else
mCallQualityUpdater = null;
} }
},1000); }, 1000);
if (mControlsLayout != null) if (mControlsLayout != null)
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
@ -269,14 +375,18 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
} }
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode)) return true; if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode))
if (LinphoneUtils.onKeyBackGoHome(this, keyCode, event)) return true; return true;
if (Version.isXLargeScreen(this) && LinphoneUtils.onKeyBackGoHome(this, keyCode, event))
return true;
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
if (androidVideoWindowImpl != null) { // Prevent linphone from crashing if correspondent hang up while you are rotating if (androidVideoWindowImpl != null) { // Prevent linphone from crashing
// if correspondent hang up
// while you are rotating
androidVideoWindowImpl.release(); androidVideoWindowImpl.release();
} }
super.onDestroy(); super.onDestroy();
@ -284,36 +394,40 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
@Override @Override
protected void onPause() { protected void onPause() {
Log.d("onPause VideoCallActivity (isFinishing:", isFinishing(), ", inCall:", LinphoneManager.getLc().isIncall(),")"); Log.d("onPause VideoCallActivity (isFinishing:", isFinishing(),
", inCall:", LinphoneManager.getLc().isIncall(), ")");
LinphoneManager.removeListener(this); LinphoneManager.removeListener(this);
if (isFinishing()) { if (isFinishing()) {
videoCall = null; // release reference videoCall = null; // release reference
} else { } else {
// Send NoWebcam since Android 4.0 can't get the video from the webcam if the activity is not in foreground // Send NoWebcam since Android 4.0 can't get the video from the
// webcam if the activity is not in foreground
shouldRestartVideoOnResume = true; shouldRestartVideoOnResume = true;
LinphoneManager.getLc().getCurrentCall().enableCamera(false); LinphoneManager.getLc().getCurrentCall().enableCamera(false);
} }
launched=false; launched = false;
synchronized (androidVideoWindowImpl) { synchronized (androidVideoWindowImpl) {
/* this call will destroy native opengl renderer /*
* which is used by androidVideoWindowImpl * this call will destroy native opengl renderer which is used by
* androidVideoWindowImpl
*/ */
LinphoneManager.getLc().setVideoWindow(null); LinphoneManager.getLc().setVideoWindow(null);
} }
if (mCallQualityUpdater!=null){ if (mCallQualityUpdater != null) {
refreshHandler.removeCallbacks(mCallQualityUpdater); refreshHandler.removeCallbacks(mCallQualityUpdater);
mCallQualityUpdater=null; mCallQualityUpdater = null;
} }
if (mControls != null) { if (mControls != null) {
controlsHandler.removeCallbacks(mControls); controlsHandler.removeCallbacks(mControls);
mControls = null; mControls = null;
} }
if (mWakeLock.isHeld()) mWakeLock.release(); if (mWakeLock.isHeld())
mWakeLock.release();
super.onPause(); super.onPause();
if (mVideoViewReady != null) if (mVideoViewReady != null)
((GLSurfaceView)mVideoViewReady).onPause(); ((GLSurfaceView) mVideoViewReady).onPause();
} }
@Override @Override
@ -327,7 +441,8 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
} }
private void resizePreview() { private void resizePreview() {
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
int rotation = display.getRotation(); int rotation = display.getRotation();
LayoutParams params; LayoutParams params;
@ -361,11 +476,11 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
controlsHandler.removeCallbacks(mControls); controlsHandler.removeCallbacks(mControls);
} }
controlsHandler.postDelayed(mControls = new Runnable(){ controlsHandler.postDelayed(mControls = new Runnable() {
public void run() { public void run() {
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
} }
},DELAY_BEFORE_HIDING_CONTROLS); }, DELAY_BEFORE_HIDING_CONTROLS);
} }
public void onClick(View v) { public void onClick(View v) {
@ -392,9 +507,11 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length; id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length;
LinphoneManager.getLc().setVideoDevice(id); LinphoneManager.getLc().setVideoDevice(id);
CallManager.getInstance().updateCall(); CallManager.getInstance().updateCall();
// previous call will cause graph reconstruction -> regive preview window // previous call will cause graph reconstruction -> regive preview
// window
if (mVideoCaptureViewReady != null) if (mVideoCaptureViewReady != null)
LinphoneManager.getLc().setPreviewWindow(mVideoCaptureViewReady); LinphoneManager.getLc()
.setPreviewWindow(mVideoCaptureViewReady);
break; break;
case R.id.conf_simple_pause: case R.id.conf_simple_pause:
finish(); finish();
@ -416,15 +533,15 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
switch (id) { switch (id) {
case numpadDialogId: case numpadDialogId:
Numpad numpad = new Numpad(this, true); Numpad numpad = new Numpad(this, true);
return new AlertDialog.Builder(this).setView(numpad) return new AlertDialog.Builder(this)
.setPositiveButton(R.string.close_button_text, new .setView(numpad)
DialogInterface.OnClickListener() { .setPositiveButton(R.string.close_button_text,
public void onClick(DialogInterface dialog, int whichButton) new DialogInterface.OnClickListener() {
{ public void onClick(DialogInterface dialog,
int whichButton) {
dismissDialog(id); dismissDialog(id);
} }
}) }).create();
.create();
default: default:
throw new IllegalArgumentException("unkown dialog id " + id); throw new IllegalArgumentException("unkown dialog id " + id);
} }

View file

@ -20,8 +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.ArrayList;
import java.util.List;
import java.util.Vector; import java.util.Vector;
@ -542,9 +540,9 @@ class LinphoneCoreImpl implements LinphoneCore {
terminateAllCalls(nativePtr); terminateAllCalls(nativePtr);
} }
private native Object getCall(long nativePtr, int position); private native Object getCall(long nativePtr, int position);
@SuppressWarnings("unchecked") public synchronized List getCalls() { @SuppressWarnings("unchecked") public synchronized Vector getCalls() {
int size = getCallsNb(nativePtr); int size = getCallsNb(nativePtr);
List<LinphoneCall> calls = new ArrayList<LinphoneCall>(size); Vector<LinphoneCall> calls = new Vector<LinphoneCall>(size);
for (int i=0; i < size; i++) { for (int i=0; i < size; i++) {
calls.add((LinphoneCall)getCall(nativePtr, i)); calls.add((LinphoneCall)getCall(nativePtr, i));
} }

@ -1 +1 @@
Subproject commit c0c9ebc214434556b50db8023e172048cf7a9866 Subproject commit 53d5f0c2bf8a5fbbfb04ce4126db81ff3da38916