Custom use of incallActivity and VideoCallActivity.
This commit is contained in:
parent
504a11d192
commit
64299fb661
5 changed files with 99 additions and 100 deletions
|
@ -11,7 +11,10 @@
|
||||||
<bool name="useFirstLoginActivity">false</bool>
|
<bool name="useFirstLoginActivity">false</bool>
|
||||||
<bool name="useMenuSettings">true</bool>
|
<bool name="useMenuSettings">true</bool>
|
||||||
<bool name="useMenuAbout">true</bool>
|
<bool name="useMenuAbout">true</bool>
|
||||||
|
<bool name="use_incall_activity">true</bool>
|
||||||
|
<bool name="use_video_activity">false</bool>
|
||||||
|
|
||||||
<string name="notification_title">Linphone</string>
|
<string name="notification_title">Linphone</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -82,6 +82,8 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private SharedPreferences mPref;
|
private SharedPreferences mPref;
|
||||||
private AddVideoButton mAddVideo;
|
private AddVideoButton mAddVideo;
|
||||||
|
private boolean useIncallActivity;
|
||||||
|
private boolean useVideoActivity;
|
||||||
|
|
||||||
private static final String CURRENT_ADDRESS = "org.linphone.current-address";
|
private static final String CURRENT_ADDRESS = "org.linphone.current-address";
|
||||||
private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
|
private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
|
||||||
|
@ -99,6 +101,8 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.dialer);
|
setContentView(R.layout.dialer);
|
||||||
|
|
||||||
|
useIncallActivity = getResources().getBoolean(R.bool.use_incall_activity);
|
||||||
|
useVideoActivity = getResources().getBoolean(R.bool.use_video_activity);
|
||||||
// Don't use Linphone Manager in the onCreate as it takes time in LinphoneService to initialize it.
|
// Don't use Linphone Manager in the onCreate as it takes time in LinphoneService to initialize it.
|
||||||
|
|
||||||
mPref = PreferenceManager.getDefaultSharedPreferences(this);
|
mPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
@ -111,10 +115,6 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
((EraseButton) findViewById(R.id.Erase)).setAddressView(mAddress);
|
((EraseButton) findViewById(R.id.Erase)).setAddressView(mAddress);
|
||||||
|
|
||||||
|
|
||||||
mAddVideo = (AddVideoButton) findViewById(R.id.AddVideo);
|
|
||||||
mAddVideo.setOnAlreadyInVideoCallListener(this);
|
|
||||||
|
|
||||||
|
|
||||||
mCall = (CallButton) findViewById(R.id.Call);
|
mCall = (CallButton) findViewById(R.id.Call);
|
||||||
mCall.setAddressWidget(mAddress);
|
mCall.setAddressWidget(mAddress);
|
||||||
|
|
||||||
|
@ -123,59 +123,49 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
mDecline.setEnabled(false);
|
mDecline.setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
mHangup = findViewById(R.id.HangUp);
|
|
||||||
|
|
||||||
|
|
||||||
mCallControlRow = findViewById(R.id.CallControlRow);
|
mCallControlRow = findViewById(R.id.CallControlRow);
|
||||||
mAddressLayout = findViewById(R.id.Addresslayout);
|
mAddressLayout = findViewById(R.id.Addresslayout);
|
||||||
|
|
||||||
mInCallControlRow = findViewById(R.id.IncallControlRow);
|
if (useIncallActivity) {
|
||||||
mInCallControlRow.setVisibility(View.GONE);
|
mHangup = findViewById(R.id.HangUp);
|
||||||
mInCallAddressLayout = findViewById(R.id.IncallAddressLayout);
|
|
||||||
mInCallAddressLayout.setVisibility(View.GONE);
|
mInCallControlRow = findViewById(R.id.IncallControlRow);
|
||||||
|
mInCallControlRow.setVisibility(View.GONE);
|
||||||
|
mInCallAddressLayout = findViewById(R.id.IncallAddressLayout);
|
||||||
|
mInCallAddressLayout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (useVideoActivity) {
|
||||||
|
mAddVideo = (AddVideoButton) findViewById(R.id.AddVideo);
|
||||||
|
mAddVideo.setOnAlreadyInVideoCallListener(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mMute = (MuteMicButton) findViewById(R.id.mic_mute_button);
|
mMute = (MuteMicButton) findViewById(R.id.mic_mute_button);
|
||||||
mSpeaker = (SpeakerButton) findViewById(R.id.speaker_button);
|
mSpeaker = (SpeakerButton) findViewById(R.id.speaker_button);
|
||||||
|
mStatus = (TextView) findViewById(R.id.status_label);
|
||||||
|
|
||||||
|
AddressAware numpad = (AddressAware) findViewById(R.id.Dialer);
|
||||||
|
if (numpad != null)
|
||||||
|
numpad.setAddressWidget(mAddress);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
outgoingCallIntentReceived();
|
outgoingCallIntentReceived();
|
||||||
|
|
||||||
if (LinphoneService.isReady()) {
|
if (LinphoneService.isReady()) {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
if (lc.isIncall()) {
|
if (lc.isIncall()) {
|
||||||
if(lc.isInComingInvitePending()) {
|
if(lc.isInComingInvitePending()) {
|
||||||
callPending(lc.getCurrentCall());
|
callPending(lc.getCurrentCall());
|
||||||
} else {
|
} else {
|
||||||
mCall.setEnabled(false);
|
enterIncallMode(lc);
|
||||||
mHangup.setEnabled(!mCall.isEnabled());
|
|
||||||
updateIncallVideoCallButton();
|
|
||||||
mCallControlRow.setVisibility(View.GONE);
|
|
||||||
mInCallControlRow.setVisibility(View.VISIBLE);
|
|
||||||
mAddressLayout.setVisibility(View.GONE);
|
|
||||||
mInCallAddressLayout.setVisibility(View.VISIBLE);
|
|
||||||
mDisplayNameView.setText(LinphoneManager.getInstance().extractADisplayName());
|
|
||||||
loadMicAndSpeakerUiStateFromManager();
|
|
||||||
LinphoneActivity.instance().startProxymitySensor();
|
|
||||||
mWakeLock.acquire();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
instance = this;
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(LinphoneManager.TAG,"Cannot start linphone",e);
|
Log.e(LinphoneManager.TAG,"Cannot start linphone",e);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
instance = this;
|
||||||
AddressAware numpad = (AddressAware) findViewById(R.id.Dialer);
|
|
||||||
if (numpad != null)
|
|
||||||
numpad.setAddressWidget(mAddress);
|
|
||||||
|
|
||||||
mStatus = (TextView) findViewById(R.id.status_label);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,13 +202,13 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
protected void onRestoreInstanceState(Bundle savedState) {
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
super.onRestoreInstanceState(savedState);
|
||||||
CharSequence lAddress = savedInstanceState.getCharSequence(CURRENT_ADDRESS);
|
CharSequence addr = savedState.getCharSequence(CURRENT_ADDRESS);
|
||||||
if (lAddress != null && mAddress != null) {
|
if (addr != null && mAddress != null) {
|
||||||
mAddress.setText(lAddress);
|
mAddress.setText(addr);
|
||||||
}
|
}
|
||||||
mAddress.setDisplayedName(savedInstanceState.getString(CURRENT_DISPLAYNAME));
|
mAddress.setDisplayedName(savedState.getString(CURRENT_DISPLAYNAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,41 +219,40 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
instance=null;
|
instance=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void startVideoView(int requestCode) {
|
private void startVideoView(int requestCode) {
|
||||||
|
if (!useVideoActivity) throw new RuntimeException("internal error");
|
||||||
Intent lIntent = new Intent().setClass(this, VideoCallActivity.class);
|
Intent lIntent = new Intent().setClass(this, VideoCallActivity.class);
|
||||||
startActivityForResult(lIntent,requestCode);
|
startActivityForResult(lIntent,requestCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void enterIncallMode(LinphoneCore lc) {
|
private void enterIncallMode(LinphoneCore lc) {
|
||||||
mCallControlRow.setVisibility(View.GONE);
|
|
||||||
mInCallControlRow.setVisibility(View.VISIBLE);
|
|
||||||
mAddressLayout.setVisibility(View.GONE);
|
|
||||||
mInCallAddressLayout.setVisibility(View.VISIBLE);
|
|
||||||
mCall.setEnabled(false);
|
|
||||||
updateIncallVideoCallButton();
|
|
||||||
mHangup.setEnabled(true);
|
|
||||||
mDisplayNameView.setText(LinphoneManager.getInstance().extractADisplayName());
|
mDisplayNameView.setText(LinphoneManager.getInstance().extractADisplayName());
|
||||||
|
|
||||||
loadMicAndSpeakerUiStateFromManager();
|
|
||||||
// setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
|
// setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
|
||||||
|
|
||||||
LinphoneActivity.instance().startProxymitySensor();
|
LinphoneActivity.instance().startProxymitySensor();
|
||||||
if (!mWakeLock.isHeld()) mWakeLock.acquire();
|
if (!mWakeLock.isHeld()) mWakeLock.acquire();
|
||||||
|
|
||||||
|
if (useIncallActivity) {
|
||||||
|
startIncallActivity(mDisplayNameView.getText());
|
||||||
|
} else {
|
||||||
|
loadMicAndSpeakerUiStateFromManager();
|
||||||
|
mCallControlRow.setVisibility(View.GONE);
|
||||||
|
mInCallControlRow.setVisibility(View.VISIBLE);
|
||||||
|
mAddressLayout.setVisibility(View.GONE);
|
||||||
|
mInCallAddressLayout.setVisibility(View.VISIBLE);
|
||||||
|
mCall.setEnabled(false);
|
||||||
|
updateIncallVideoCallButton();
|
||||||
|
mHangup.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void startIncallActivity(CharSequence callerName) {
|
private void startIncallActivity(CharSequence callerName) {
|
||||||
|
if (!useIncallActivity) throw new RuntimeException("Internal error");
|
||||||
startActivityForResult(new Intent()
|
startActivityForResult(new Intent()
|
||||||
.setClass(this, IncallActivity.class)
|
.setClass(this, IncallActivity.class)
|
||||||
.putExtra(IncallActivity.CONTACT_KEY, callerName),
|
.putExtra(IncallActivity.CONTACT_KEY, callerName),
|
||||||
|
@ -272,6 +261,8 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
|
|
||||||
|
|
||||||
private void updateIncallVideoCallButton() {
|
private void updateIncallVideoCallButton() {
|
||||||
|
if (useIncallActivity) throw new RuntimeException("Internal error");
|
||||||
|
|
||||||
boolean prefVideoEnabled = LinphoneManager.getInstance().isVideoEnabled();
|
boolean prefVideoEnabled = LinphoneManager.getInstance().isVideoEnabled();
|
||||||
if (prefVideoEnabled && !mCall.isEnabled()) {
|
if (prefVideoEnabled && !mCall.isEnabled()) {
|
||||||
mAddVideo.setVisibility(View.VISIBLE);
|
mAddVideo.setVisibility(View.VISIBLE);
|
||||||
|
@ -283,43 +274,53 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
|
|
||||||
|
|
||||||
private void loadMicAndSpeakerUiStateFromManager() {
|
private void loadMicAndSpeakerUiStateFromManager() {
|
||||||
|
if (useIncallActivity) throw new RuntimeException("Internal error"); // only dialer widgets are updated with this
|
||||||
|
|
||||||
mMute.setChecked(LinphoneManager.getLc().isMicMuted());
|
mMute.setChecked(LinphoneManager.getLc().isMicMuted());
|
||||||
mSpeaker.setSpeakerOn(LinphoneManager.getInstance().isSpeakerOn());
|
mSpeaker.setSpeakerOn(LinphoneManager.getInstance().isSpeakerOn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void exitCallMode() {
|
private void exitCallMode() {
|
||||||
mCallControlRow.setVisibility(View.VISIBLE);
|
if (!useIncallActivity) {
|
||||||
mInCallControlRow.setVisibility(View.GONE);
|
mCallControlRow.setVisibility(View.VISIBLE);
|
||||||
|
mInCallControlRow.setVisibility(View.GONE);
|
||||||
|
mInCallAddressLayout.setVisibility(View.GONE);
|
||||||
|
updateIncallVideoCallButton();
|
||||||
|
finishActivity(LinphoneActivity.INCALL_ACTIVITY);
|
||||||
|
}
|
||||||
|
|
||||||
mAddressLayout.setVisibility(View.VISIBLE);
|
mAddressLayout.setVisibility(View.VISIBLE);
|
||||||
mInCallAddressLayout.setVisibility(View.GONE);
|
|
||||||
mCall.setEnabled(true);
|
|
||||||
updateIncallVideoCallButton();
|
|
||||||
mHangup.setEnabled(false);
|
mHangup.setEnabled(false);
|
||||||
setVolumeControlStream(AudioManager.USE_DEFAULT_STREAM_TYPE);
|
|
||||||
mDecline.setEnabled(false);
|
mDecline.setEnabled(false);
|
||||||
mSpeaker.setSpeakerOn(false);
|
mSpeaker.setSpeakerOn(false);
|
||||||
|
|
||||||
if (LinphoneManager.getLc().isVideoEnabled()) {
|
|
||||||
|
if (useVideoActivity && LinphoneManager.getLc().isVideoEnabled()) {
|
||||||
finishActivity(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
finishActivity(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
||||||
|
BandwidthManager.getInstance().setUserRestriction(false);
|
||||||
|
LinphoneManager.getInstance().resetCameraFromPreferences();
|
||||||
}
|
}
|
||||||
finishActivity(LinphoneActivity.INCALL_ACTIVITY);
|
|
||||||
|
|
||||||
if (mWakeLock.isHeld())mWakeLock.release();
|
if (mWakeLock.isHeld())mWakeLock.release();
|
||||||
|
|
||||||
BandwidthManager.getInstance().setUserRestriction(false);
|
|
||||||
LinphoneManager.getInstance().resetCameraFromPreferences();
|
|
||||||
LinphoneActivity.instance().stopProxymitySensor();
|
LinphoneActivity.instance().stopProxymitySensor();
|
||||||
|
|
||||||
|
setVolumeControlStream(AudioManager.USE_DEFAULT_STREAM_TYPE);
|
||||||
|
mCall.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void callPending(LinphoneCall call) {
|
private void callPending(LinphoneCall call) {
|
||||||
mDecline.setEnabled(true);
|
mDecline.setEnabled(true);
|
||||||
|
|
||||||
// Privacy setting to not share the user camera by default
|
// Privacy setting to not share the user camera by default
|
||||||
boolean prefVideoEnable = LinphoneManager.getInstance().isVideoEnabled();
|
boolean prefVideoEnable = LinphoneManager.getInstance().isVideoEnabled();
|
||||||
boolean prefAutomaticallyShareMyCamera = mPref.getBoolean(getString(R.string.pref_video_automatically_share_my_video_key), false);
|
boolean prefAutoShareMyCamera = mPref.getBoolean(getString(R.string.pref_video_automatically_share_my_video_key), false);
|
||||||
AndroidCameraRecordManager.getInstance().setMuted(!(prefVideoEnable && prefAutomaticallyShareMyCamera));
|
boolean videoMuted = !(prefVideoEnable && prefAutoShareMyCamera);
|
||||||
call.enableCamera(prefAutomaticallyShareMyCamera);
|
AndroidCameraRecordManager.getInstance().setMuted(videoMuted);
|
||||||
|
|
||||||
|
call.enableCamera(prefAutoShareMyCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,7 +328,6 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
|
|
||||||
|
|
||||||
public void newOutgoingCall(Intent intent) {
|
public void newOutgoingCall(Intent intent) {
|
||||||
|
|
||||||
if (Intent.ACTION_CALL.equalsIgnoreCase(intent.getAction())) {
|
if (Intent.ACTION_CALL.equalsIgnoreCase(intent.getAction())) {
|
||||||
mAddress.setText(intent.getData().getSchemeSpecificPart());
|
mAddress.setText(intent.getData().getSchemeSpecificPart());
|
||||||
} else if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
|
} else if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
|
||||||
|
@ -357,29 +357,23 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAlreadyInVideoCall() {
|
public void onAlreadyInVideoCall() {
|
||||||
startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
if (useVideoActivity) {
|
||||||
|
startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAlreadyInCall() {
|
public void onAlreadyInCall() {
|
||||||
Toast toast = Toast.makeText(this,
|
showToast(R.string.warning_already_incall);
|
||||||
getString(R.string.warning_already_incall), Toast.LENGTH_LONG);
|
|
||||||
toast.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onCannotGetCallParameters() {
|
public void onCannotGetCallParameters() {
|
||||||
Toast toast = Toast.makeText(this
|
showToast(R.string.error_cannot_get_call_parameters,mAddress.getText());
|
||||||
,String.format(getString(R.string.error_cannot_get_call_parameters),mAddress.getText().toString())
|
|
||||||
,Toast.LENGTH_LONG);
|
|
||||||
toast.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onWrongDestinationAddress() {
|
public void onWrongDestinationAddress() {
|
||||||
Toast toast = Toast.makeText(this
|
showToast(R.string.warning_wrong_destination_address, mAddress.getText());
|
||||||
,String.format(getString(R.string.warning_wrong_destination_address),mAddress.getText().toString())
|
|
||||||
,Toast.LENGTH_LONG);
|
|
||||||
toast.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -387,38 +381,42 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
if (state == LinphoneCall.State.OutgoingInit) {
|
if (state == LinphoneCall.State.OutgoingInit) {
|
||||||
enterIncallMode(lc);
|
enterIncallMode(lc);
|
||||||
startIncallActivity(mDisplayNameView.getText());
|
|
||||||
} else if (state == LinphoneCall.State.IncomingReceived) {
|
} else if (state == LinphoneCall.State.IncomingReceived) {
|
||||||
LinphoneManager.getInstance().resetCameraFromPreferences();
|
LinphoneManager.getInstance().resetCameraFromPreferences();
|
||||||
callPending(call);
|
callPending(call);
|
||||||
} else if (state == LinphoneCall.State.Connected) {
|
} else if (state == LinphoneCall.State.Connected) {
|
||||||
if (call.getDirection() == CallDirection.Incoming) {
|
if (call.getDirection() == CallDirection.Incoming) {
|
||||||
enterIncallMode(lc);
|
enterIncallMode(lc);
|
||||||
startIncallActivity(mDisplayNameView.getText());
|
|
||||||
}
|
}
|
||||||
} else if (state == LinphoneCall.State.Error) {
|
} else if (state == LinphoneCall.State.Error) {
|
||||||
if (mWakeLock.isHeld()) mWakeLock.release();
|
if (mWakeLock.isHeld()) mWakeLock.release();
|
||||||
finishActivity(LinphoneActivity.INCALL_ACTIVITY);
|
finishActivity(LinphoneActivity.INCALL_ACTIVITY);
|
||||||
Toast toast = Toast.makeText(this
|
showToast(R.string.call_error, message);
|
||||||
,String.format(getString(R.string.call_error),message)
|
|
||||||
, Toast.LENGTH_LONG);
|
|
||||||
toast.show();
|
|
||||||
exitCallMode();
|
exitCallMode();
|
||||||
} else if (state == LinphoneCall.State.CallEnd) {
|
} else if (state == LinphoneCall.State.CallEnd) {
|
||||||
exitCallMode();
|
exitCallMode();
|
||||||
} else if (state == LinphoneCall.State.StreamsRunning) {
|
} else if (state == LinphoneCall.State.StreamsRunning) {
|
||||||
if (LinphoneManager.getLc().getCurrentCall().getCurrentParamsCopy().getVideoEnabled()) {
|
if (useVideoActivity && LinphoneManager.getLc().getCurrentCall().getCurrentParamsCopy().getVideoEnabled()) {
|
||||||
startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showToast(int id, String txt) {
|
||||||
|
final String msg = String.format(getString(id), txt);
|
||||||
|
Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
private void showToast(int id, CharSequence txt) {
|
||||||
|
showToast(id, txt.toString());
|
||||||
|
}
|
||||||
|
private void showToast(int id) {
|
||||||
|
Toast.makeText(this, getString(id), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
public void onGlobalStateChangedToOn(String message) {
|
public void onGlobalStateChangedToOn(String message) {
|
||||||
mCall.setEnabled(!LinphoneManager.getLc().isIncall());
|
mCall.setEnabled(!LinphoneManager.getLc().isIncall());
|
||||||
mHangup.setEnabled(!mCall.isEnabled());
|
mHangup.setEnabled(!mCall.isEnabled());
|
||||||
updateIncallVideoCallButton();
|
if (!useIncallActivity) updateIncallVideoCallButton();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
LinphoneManager.getInstance().initFromConf(this);
|
LinphoneManager.getInstance().initFromConf(this);
|
||||||
|
|
|
@ -101,6 +101,8 @@ public class HistoryActivity extends ListActivity {
|
||||||
|
|
||||||
class CallHistoryAdapter extends BaseAdapter {
|
class CallHistoryAdapter extends BaseAdapter {
|
||||||
final List<LinphoneCallLog> mLogs;
|
final List<LinphoneCallLog> mLogs;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
CallHistoryAdapter(Context aContext) {
|
CallHistoryAdapter(Context aContext) {
|
||||||
mLogs = LinphoneManager.getLc().getCallLogs();
|
mLogs = LinphoneManager.getLc().getCallLogs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.linphone.ui.AddVideoButton;
|
||||||
import org.linphone.ui.HangCallButton;
|
import org.linphone.ui.HangCallButton;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -125,7 +124,4 @@ public class IncallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showVideoCallActivity() {
|
|
||||||
startActivity(new Intent().setClass(this, VideoCallActivity.class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class VideoCallActivity extends Activity {
|
||||||
mVideoView = (SurfaceView) findViewById(R.id.video_surface);
|
mVideoView = (SurfaceView) findViewById(R.id.video_surface);
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
lc.setVideoWindow(mVideoView);
|
lc.setVideoWindow(mVideoView);
|
||||||
|
|
||||||
mVideoCaptureView = (SurfaceView) findViewById(R.id.video_capture_surface);
|
mVideoCaptureView = (SurfaceView) findViewById(R.id.video_capture_surface);
|
||||||
|
|
||||||
previousPhoneOrientation = AndroidCameraRecordManager.getInstance().getPhoneOrientation();
|
previousPhoneOrientation = AndroidCameraRecordManager.getInstance().getPhoneOrientation();
|
||||||
|
|
Loading…
Reference in a new issue