Update status bar & notification when all accounts are removed

Conflicts:
	src/org/linphone/LinphoneManager.java
This commit is contained in:
Sylvain Berfini 2012-11-19 15:33:51 +01:00 committed by Sylvain Berfini
parent 97ac11bc47
commit be0f7fa3d7
4 changed files with 10 additions and 5 deletions

View file

@ -169,7 +169,7 @@
android:contentDescription="@string/content_description_led" android:contentDescription="@string/content_description_led"
android:id="@+id/statusLed" android:id="@+id/statusLed"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:src="@drawable/led_error" android:src="@drawable/led_disconnected"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -592,7 +592,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
copyIfNotExist(R.raw.ringback,mRingbackSoundFile); copyIfNotExist(R.raw.ringback,mRingbackSoundFile);
copyIfNotExist(R.raw.toy_mono,mPauseSoundFile); copyIfNotExist(R.raw.toy_mono,mPauseSoundFile);
copyFromPackage(R.raw.linphonerc, new File(mLinphoneInitialConfigFile).getName()); copyFromPackage(R.raw.linphonerc, new File(mLinphoneInitialConfigFile).getName());
copyIfNotExist(R.raw.lpconfig, new File(mLPConfigXsd).getName()); //copyIfNotExist(R.raw.lpconfig, new File(mLPConfigXsd).getName());
copyIfNotExist(R.raw.rootca, new File(mLinphoneRootCaFile).getName()); copyIfNotExist(R.raw.rootca, new File(mLinphoneRootCaFile).getName());
} }
private void copyIfNotExist(int ressourceId,String target) throws IOException { private void copyIfNotExist(int ressourceId,String target) throws IOException {
@ -665,7 +665,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
} }
LinphoneProxyConfig lDefaultProxyConfig = mLc.getDefaultProxyConfig(); LinphoneProxyConfig lDefaultProxyConfig = mLc.getDefaultProxyConfig();
if (lDefaultProxyConfig !=null) { if (lDefaultProxyConfig != null) {
//prefix //prefix
String lPrefix = getPrefString(R.string.pref_prefix_key, null); String lPrefix = getPrefString(R.string.pref_prefix_key, null);
if (lPrefix != null) { if (lPrefix != null) {
@ -673,6 +673,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
} }
//escape + //escape +
lDefaultProxyConfig.setDialEscapePlus(getPrefBoolean(R.string.pref_escape_plus_key, false)); lDefaultProxyConfig.setDialEscapePlus(getPrefBoolean(R.string.pref_escape_plus_key, false));
} else if (LinphoneService.isReady()) {
LinphoneService.instance().onRegistrationStateChanged(RegistrationState.RegistrationNone, null);
} }
} }

View file

@ -518,6 +518,9 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
if ((state == RegistrationState.RegistrationFailed || state == RegistrationState.RegistrationCleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !LinphoneManager.getLc().getDefaultProxyConfig().isRegistered())) { if ((state == RegistrationState.RegistrationFailed || state == RegistrationState.RegistrationCleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !LinphoneManager.getLc().getDefaultProxyConfig().isRegistered())) {
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_register_failure); sendNotification(IC_LEVEL_OFFLINE, R.string.notification_register_failure);
} }
if (state == RegistrationState.RegistrationNone) {
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_started);
}
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
public void run() { public void run() {

View file

@ -231,7 +231,7 @@ public class StatusFragment extends Fragment {
e.printStackTrace(); e.printStackTrace();
} }
return -1; return R.drawable.led_disconnected;
} }
private String getStatusIconText(LinphoneCore.RegistrationState state) { private String getStatusIconText(LinphoneCore.RegistrationState state) {
@ -253,7 +253,7 @@ public class StatusFragment extends Fragment {
e.printStackTrace(); e.printStackTrace();
} }
return null; return context.getString(R.string.status_not_connected);
} }
private void startCallQuality() { private void startCallQuality() {