diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 270986280..270d32c36 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -27,6 +27,11 @@
+
+
+
+
+
diff --git a/res/layout/first_login_view.xml b/res/layout/first_login_view.xml
new file mode 100644
index 000000000..0bfb393c5
--- /dev/null
+++ b/res/layout/first_login_view.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // Some moving widget
+
+
\ No newline at end of file
diff --git a/res/raw/linphonerc b/res/raw/linphonerc
index 44a810178..cafb92ac6 100644
--- a/res/raw/linphonerc
+++ b/res/raw/linphonerc
@@ -40,7 +40,6 @@ el_transmit_thres=1.7
ng_floorgain=0.01
-
[video]
size=qvga-portrait
diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml
index 6e678442f..8a196b479 100644
--- a/res/values/non_localizable_strings.xml
+++ b/res/values/non_localizable_strings.xml
@@ -6,5 +6,28 @@
pref_passwd_key
pref_username_key
pref_debug_key
-
+ first_launch_suceeded_once_key
+
+ pref_video_use_front_camera_key
+ pref_video_codec_h263_key
+ pref_video_codec_mpeg4_key
+ pref_video_codec_h264_key
+ pref_video_automatically_share_my_video_key
+ pref_video_initiate_call_with_video_key
+ pref_video_enable_key
+ pref_escape_plus_key
+ pref_echo_cancellation_key
+ pref_autostart_key
+ Outbound proxy
+ pref_codec_pcma_key
+ pref_codec_pcmu_key
+ pref_codec_gsm_key
+ pref_codec_ilbc_key
+ pref_codec_speex8_key
+ pref_codec_speex16_key
+ pref_codec_speex32_key
+ pref_codecs_key
+ pref_stun_server_key
+
+ test.linphone.org
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9e353027e..9e6862f72 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3,15 +3,11 @@
pref_echo_canceller_calibration_key
Echo calibration
Use front camera
- pref_video_use_front_camera_key
Video
Preferences
H263
- pref_video_codec_h263_key
MPEG4
- pref_video_codec_mpeg4_key
H264
- pref_video_codec_h264_key
Codecs
pref_video_codecs_key
Display dialer
@@ -24,40 +20,25 @@
Enable camera
Terminate call
Video settings
- pref_video_automatically_share_my_video_key
Share my camera
Automatically send my camera on incoming calls
- pref_video_initiate_call_with_video_key
Initiate video calls
Always send my camera on outgoing calls
- pref_video_enable_key
Enable Video
Replace + by 00
- pref_escape_plus_key
iLBC might be unavailable depending on ARM processor and Android OS version.
Echo cancellation
- pref_echo_cancellation_key
Start at boot time
- pref_autostart_key
Cellular
Choose application to call %s
Outbound proxy
- Outbound proxy
pcma
- pref_codec_pcma_key
pcmu
- pref_codec_pcmu_key
gsm
- pref_codec_gsm_key
ilbc
- pref_codec_ilbc_key
speex 8 Khz
- pref_codec_speex8_key
speex 16 Khz
- pref_codec_speex16_key
- pref_codec_speex32_key
Codecs
- pref_codecs_key
Place a call
Debug
Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2\n http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
@@ -102,8 +83,13 @@
started
Removes the echo heard by other end
Stun server
-pref_stun_server_key
Calibrating...
Calibrated [%s ms]
failed
+Enter your username and password to connect to the service.
+Username
+Password
+Connect
+Please enter your login and password
+Couldn\'t connect; check your login and password and start again
diff --git a/src/org/linphone/DialerActivity.java b/src/org/linphone/DialerActivity.java
index 723011bf5..b4f111698 100644
--- a/src/org/linphone/DialerActivity.java
+++ b/src/org/linphone/DialerActivity.java
@@ -88,9 +88,8 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
private static final String PREF_CHECK_CONFIG = "pref_check_config";
public static final String PREF_FIRST_LAUNCH = "pref_first_launch";
- private static String CURRENT_ADDRESS = "org.linphone.current-address";
- private static String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
- static int VIDEO_VIEW_ACTIVITY = 100;
+ private static final String CURRENT_ADDRESS = "org.linphone.current-address";
+ private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
private static boolean checkAccount = true;
@@ -115,8 +114,6 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,"Linphone");
-
-
mAddress = (AddressText) findViewById(R.id.SipUri);
mDisplayNameView = (TextView) findViewById(R.id.DisplayNameView);
((EraseButton) findViewById(R.id.Erase)).setAddressView(mAddress);
@@ -317,8 +314,6 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
-
-
private void startVideoView(int requestCode) {
@@ -346,10 +341,11 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
}
- private void openIncallActivity(CharSequence callerName) {
- startActivity(new Intent()
+ private void startIncallActivity(CharSequence callerName) {
+ startActivityForResult(new Intent()
.setClass(this, IncallActivity.class)
- .putExtra(IncallActivity.CONTACT_KEY, callerName));
+ .putExtra(IncallActivity.CONTACT_KEY, callerName),
+ LinphoneActivity.INCALL_ACTIVITY);
}
@@ -381,7 +377,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
setVolumeControlStream(AudioManager.USE_DEFAULT_STREAM_TYPE);
mDecline.setEnabled(false);
if (LinphoneManager.getLc().isVideoEnabled()) {
- finishActivity(VIDEO_VIEW_ACTIVITY);
+ finishActivity(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
}
if (mWakeLock.isHeld())mWakeLock.release();
mSpeaker.setSpeakerOn(false);
@@ -430,7 +426,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
}
public void onAlreadyInVideoCall() {
- startVideoView(VIDEO_VIEW_ACTIVITY);
+ startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
}
public void onAlreadyInCall() {
@@ -460,17 +456,18 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
LinphoneCore lc = LinphoneManager.getLc();
if (state == LinphoneCall.State.OutgoingInit) {
enterIncallMode(lc);
- openIncallActivity(mDisplayNameView.getText());
+ startIncallActivity(mDisplayNameView.getText());
} else if (state == LinphoneCall.State.IncomingReceived) {
LinphoneManager.getInstance().resetCameraFromPreferences();
callPending(call);
} else if (state == LinphoneCall.State.Connected) {
if (call.getDirection() == CallDirection.Incoming) {
enterIncallMode(lc);
- openIncallActivity(mDisplayNameView.getText());
+ startIncallActivity(mDisplayNameView.getText());
}
} else if (state == LinphoneCall.State.Error) {
if (mWakeLock.isHeld()) mWakeLock.release();
+ finishActivity(LinphoneActivity.INCALL_ACTIVITY);
Toast toast = Toast.makeText(this
,String.format(getString(R.string.call_error),message)
, Toast.LENGTH_LONG);
@@ -480,12 +477,13 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
exitCallMode();
} else if (state == LinphoneCall.State.StreamsRunning) {
if (LinphoneManager.getLc().getCurrentCall().getCurrentParamsCopy().getVideoEnabled()) {
- startVideoView(VIDEO_VIEW_ACTIVITY);
+ startVideoView(LinphoneActivity.VIDEO_VIEW_ACTIVITY);
}
}
}
+
public void onGlobalStateChangedToOn(String message) {
mCall.setEnabled(!LinphoneManager.getLc().isIncall());
mHangup.setEnabled(!mCall.isEnabled());
@@ -503,4 +501,6 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
outgoingCallIntentReceived();
}
}
+
+
}
diff --git a/src/org/linphone/FirstLoginActivity.java b/src/org/linphone/FirstLoginActivity.java
new file mode 100644
index 000000000..0b501a8a2
--- /dev/null
+++ b/src/org/linphone/FirstLoginActivity.java
@@ -0,0 +1,114 @@
+/*
+IncallActivity.java
+Copyright (C) 2011 Belledonne Communications, Grenoble, France
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+package org.linphone;
+
+import org.linphone.core.LinphoneCore.RegistrationState;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class FirstLoginActivity extends Activity implements OnClickListener {
+
+ private TextView login;
+ private TextView password;
+ private SharedPreferences mPref;
+ static FirstLoginActivity instance;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.first_login_view);
+ mPref = PreferenceManager.getDefaultSharedPreferences(this);
+ setDefaultDomain(getString(R.string.default_domain));
+
+ login = (TextView) findViewById(R.id.login);
+ login.setText(mPref.getString(getString(R.string.pref_username_key), ""));
+ password = (TextView) findViewById(R.id.password);
+
+ findViewById(R.id.connect).setOnClickListener(this);
+ instance = this;
+ }
+
+ private void setDefaultDomain(String string) {
+ String domain = mPref.getString(getString(R.string.pref_domain_key), "");
+ if (domain.length() != 0) return;
+
+ writePreference(R.string.pref_domain_key, getString(R.string.default_domain));
+ }
+
+ public void onClick(View v) {
+ if (login.getText() == null || login.length() == 0
+ || password.getText() == null || password.length() == 0) {
+ toast(R.string.first_launch_no_login_password);
+ return;
+ }
+
+ writePreference(R.string.pref_username_key, login.getText().toString());
+ writePreference(R.string.pref_passwd_key, password.getText().toString());
+
+ try {
+ LinphoneManager.getInstance().initFromConf(getApplicationContext());
+ } catch (Throwable e) {
+ Log.e(LinphoneManager.TAG, "Error while initializing from config in first login activity", e);
+ }
+ }
+
+
+
+ private void writePreference(int key, String value) {
+ mPref.edit().putString(getString(key), value).commit();
+ }
+
+ @Override
+ protected void onDestroy() {
+ instance = null;
+ super.onDestroy();
+ }
+
+ public void onRegistrationStateChanged(RegistrationState state) {
+ if (RegistrationState.RegistrationOk == state) {
+ mPref.edit().putBoolean(getString(R.string.first_launch_suceeded_once_key), true).commit();
+ finish();
+ } else if (RegistrationState.RegistrationFailed == state) {
+ toast(R.string.first_launch_bad_login_password);
+ }
+ }
+
+ private void toast(int key) {
+ Toast.makeText(instance, instance.getString(key), Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
+ // Forbid user to press back button
+ return true;
+ }
+
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java
index 79cb0d972..f027d6cb8 100644
--- a/src/org/linphone/IncallActivity.java
+++ b/src/org/linphone/IncallActivity.java
@@ -23,7 +23,6 @@ import java.util.TimerTask;
import org.linphone.ui.AddVideoButton;
import org.linphone.ui.HangCallButton;
-import org.linphone.ui.AddVideoButton.AlreadyInVideoCallListener;
import android.app.Activity;
import android.content.Intent;
diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java
index 0ebe1dffb..b7a98d6eb 100644
--- a/src/org/linphone/LinphoneActivity.java
+++ b/src/org/linphone/LinphoneActivity.java
@@ -24,12 +24,14 @@ import static android.media.AudioManager.*;
import java.util.List;
import org.linphone.core.Version;
+import org.linphone.core.LinphoneCore.RegistrationState;
import android.app.AlertDialog;
import android.app.TabActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
@@ -37,6 +39,7 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.AudioManager;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
@@ -56,8 +59,13 @@ public class LinphoneActivity extends TabActivity {
private static SensorEventListener mSensorEventListener;
private static final String SCREEN_IS_HIDDEN ="screen_is_hidden";
+ static final int VIDEO_VIEW_ACTIVITY = 100;
+ static final int FIRST_LOGIN_ACTIVITY = 101;
+ static final int INCALL_ACTIVITY = 102;
+
- protected static LinphoneActivity instance() {
+
+ static final LinphoneActivity instance() {
if (instance != null) return instance;
throw new RuntimeException("LinphoneActivity not instantiated yet");
@@ -81,8 +89,34 @@ public class LinphoneActivity extends TabActivity {
mMainFrame = (FrameLayout) findViewById(R.id.main_frame);
mAudioManager = ((AudioManager)getSystemService(Context.AUDIO_SERVICE));
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
+ if (pref.getBoolean(getString(R.string.first_launch_suceeded_once_key), false)) {
+ fillTabHost();
+ } else {
+ startActivityForResult(new Intent().setClass(this, FirstLoginActivity.class), FIRST_LOGIN_ACTIVITY);
+ }
+
+ if (savedInstanceState !=null && savedInstanceState.getBoolean(SCREEN_IS_HIDDEN,false)) {
+ hideScreen(true);
+ }
+ }
+
+
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+
+ if (requestCode == FIRST_LOGIN_ACTIVITY) {
+ fillTabHost();
+ }
+
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+
+
+ private void fillTabHost() {
TabHost lTabHost = getTabHost(); // The activity TabHost
TabHost.TabSpec spec; // Reusable TabSpec for each tab
Drawable tabDrawable; // Drawable for a tab
@@ -119,15 +153,9 @@ public class LinphoneActivity extends TabActivity {
lTabHost.addTab(spec);
-
lTabHost.setCurrentTabByTag("dialer");
-
-
- if (savedInstanceState !=null && savedInstanceState.getBoolean(SCREEN_IS_HIDDEN,false)) {
- hideScreen(true);
- }
}
-
+
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
@@ -256,6 +284,15 @@ public class LinphoneActivity extends TabActivity {
});
builder.create().show();
- }
+ }
+
+ public void onRegistrationStateChanged(RegistrationState state,
+ String message) {
+
+ if (FirstLoginActivity.instance != null) {
+ FirstLoginActivity.instance.onRegistrationStateChanged(state);
+ }
+ }
+
}
diff --git a/src/org/linphone/LinphonePreferencesActivity.java b/src/org/linphone/LinphonePreferencesActivity.java
index 9e0e8bdc3..1ae1a866c 100644
--- a/src/org/linphone/LinphonePreferencesActivity.java
+++ b/src/org/linphone/LinphonePreferencesActivity.java
@@ -20,8 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package org.linphone;
-
import static android.media.AudioManager.STREAM_VOICE_CALL;
+import static org.linphone.R.string.cont;
+import static org.linphone.R.string.ec_calibrating;
+import static org.linphone.R.string.ec_calibration_launch_message;
+import static org.linphone.R.string.pref_codec_ilbc_key;
+import static org.linphone.R.string.pref_codec_speex16_key;
+import static org.linphone.R.string.pref_codec_speex32_key;
+import static org.linphone.R.string.pref_echo_cancellation_key;
+import static org.linphone.R.string.pref_echo_canceller_calibration_key;
+import static org.linphone.R.string.pref_video_enable_key;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.Version;
@@ -51,13 +59,13 @@ public class LinphonePreferencesActivity extends PreferenceActivity {
// if not ilbc, we are on low end cpu.
enableIlbc = LinphoneManager.getLc().findPayloadType("iLBC", 8000)!=null?true:false;
mIsLowEndCpu=!enableIlbc;
- if (!mIsLowEndCpu && !getPreferenceManager().getSharedPreferences().contains(getString(R.string.pref_echo_cancellation_key))) {
- getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_echo_cancellation_key), true).commit();
+ if (!mIsLowEndCpu && !getPreferenceManager().getSharedPreferences().contains(getString(pref_echo_cancellation_key))) {
+ writeBoolean(pref_echo_cancellation_key, true);
}
if (mIsLowEndCpu) {
- getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_codec_ilbc_key), false).commit();
- getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_codec_speex16_key), false).commit();
- getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_codec_speex32_key), false).commit();
+ writeBoolean(pref_codec_ilbc_key, false);
+ writeBoolean(pref_codec_speex16_key, false);
+ writeBoolean(pref_codec_speex32_key, false);
}
}
@@ -65,11 +73,11 @@ public class LinphonePreferencesActivity extends PreferenceActivity {
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
if (!mIsLowEndCpu) {
- getPreferenceScreen().findPreference(getString(R.string.pref_codec_ilbc_key)).setEnabled(enableIlbc);
- getPreferenceScreen().findPreference(getString(R.string.pref_codec_speex16_key)).setEnabled(enableIlbc);
- //getPreferenceScreen().findPreference(getString(R.string.pref_codec_speex32_key)).setEnabled(enableIlbc);
+ findPreference(pref_codec_ilbc_key).setEnabled(enableIlbc);
+ findPreference(pref_codec_speex16_key).setEnabled(enableIlbc);
+ //findPreference(pref_codec_speex32_key)).setEnabled(enableIlbc);
}
- getPreferenceScreen().findPreference(getString(R.string.pref_echo_canceller_calibration_key))
+ findPreference(pref_echo_canceller_calibration_key)
.setOnPreferenceClickListener(new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
startEcCalibration(preference);
@@ -79,14 +87,14 @@ public class LinphonePreferencesActivity extends PreferenceActivity {
// Force disable video
if (Version.sdkStrictlyBelow(5) || !enableIlbc || !LinphoneManager.getInstance().hasCamera()) {
- disableCheckbox(R.string.pref_video_enable_key);
+ disableCheckbox(pref_video_enable_key);
}
if (getPreferenceManager().getSharedPreferences().getBoolean(DialerActivity.PREF_FIRST_LAUNCH,true)) {
if (!mIsLowEndCpu ) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.ec_calibration_launch_message).setCancelable(false).setPositiveButton(getString(R.string.cont), new OnClickListener() {
+ builder.setTitle(ec_calibration_launch_message).setCancelable(false).setPositiveButton(getString(cont), new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
- startEcCalibration(getPreferenceScreen().findPreference(getString(R.string.pref_echo_canceller_calibration_key)));
+ startEcCalibration(findPreference(pref_echo_canceller_calibration_key));
}
}).create().show();
@@ -105,20 +113,27 @@ public class LinphonePreferencesActivity extends PreferenceActivity {
mAudioManager.setStreamVolume(STREAM_VOICE_CALL, oldVolume, 0);
- preference.setSummary(R.string.ec_calibrating);
- preference.getEditor().putBoolean(getString(R.string.pref_echo_canceller_calibration_key), false).commit();
+ preference.setSummary(ec_calibrating);
+ preference.getEditor().putBoolean(getString(pref_echo_canceller_calibration_key), false).commit();
} catch (LinphoneCoreException e) {
Log.w(LinphoneManager.TAG, "Cannot calibrate EC",e);
}
}
private void disableCheckbox(int key) {
- getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(key), false).commit();
- CheckBoxPreference box = (CheckBoxPreference) getPreferenceScreen().findPreference(getString(key));
+ writeBoolean(key, false);
+ CheckBoxPreference box = (CheckBoxPreference) findPreference(key);
box.setEnabled(false);
box.setChecked(false);
}
+ private Preference findPreference(int key) {
+ return getPreferenceScreen().findPreference(getString(key));
+ }
+
+ private void writeBoolean(int key, boolean value) {
+ getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(key), value).commit();
+ }
@Override
protected void onPause() {
diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java
index f20875ca9..44f30a5e5 100644
--- a/src/org/linphone/LinphoneService.java
+++ b/src/org/linphone/LinphoneService.java
@@ -87,8 +87,8 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
private static final int IC_LEVEL_ORANGE=0;
- private static final int IC_LEVEL_GREEN=1;
- private static final int IC_LEVEL_RED=2;
+ /*private static final int IC_LEVEL_GREEN=1;
+ private static final int IC_LEVEL_RED=2;*/
private static final int IC_LEVEL_OFFLINE=3;
@@ -189,14 +189,23 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
}
- public void onRegistrationStateChanged(RegistrationState state,
- String message) {
- if (state == LinphoneCore.RegistrationState.RegistrationOk && LinphoneManager.getLc().getDefaultProxyConfig().isRegistered()) {
+ public void onRegistrationStateChanged(final RegistrationState state,
+ final String message) {
+ if (state == RegistrationState.RegistrationOk && LinphoneManager.getLc().getDefaultProxyConfig().isRegistered()) {
sendNotificationWithId(IC_LEVEL_ORANGE, R.string.notification_registered);
}
- if (state == LinphoneCore.RegistrationState.RegistrationFailed ) {
+
+ if (state == RegistrationState.RegistrationFailed) {
sendNotificationWithId(IC_LEVEL_OFFLINE, R.string.notification_register_failure);
}
+
+ if (state == RegistrationState.RegistrationOk || state == RegistrationState.RegistrationFailed) {
+ mHandler.post(new Runnable() {
+ public void run() {
+ LinphoneActivity.instance().onRegistrationStateChanged(state, message);
+ }
+ });
+ }
}