Fix issue with status bar
This commit is contained in:
parent
d38965b693
commit
bde8fdff1a
3 changed files with 15 additions and 13 deletions
|
@ -353,11 +353,16 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
|
||||
public void updateStatusFragment(StatusFragment fragment) {
|
||||
statusFragment = fragment;
|
||||
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
statusFragment.registrationStateChanged(LinphoneManager.getLc().getDefaultProxyConfig().getState());
|
||||
}
|
||||
}
|
||||
|
||||
public StatusFragment getStatusFragment() {
|
||||
return statusFragment;
|
||||
}
|
||||
|
||||
public ArrayList<String> getChatList() {
|
||||
if (chatStorage != null) {
|
||||
return chatStorage.getChatList();
|
||||
|
@ -470,8 +475,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
changeCurrentFragment(FragmentsAvailable.DIALER, null);
|
||||
}
|
||||
|
||||
public void onRegistrationStateChanged(RegistrationState state,
|
||||
String message) {
|
||||
public void onRegistrationStateChanged(RegistrationState state, String message) {
|
||||
if (statusFragment != null) {
|
||||
statusFragment.registrationStateChanged(state);
|
||||
}
|
||||
|
|
|
@ -471,14 +471,13 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_register_failure);
|
||||
}
|
||||
|
||||
if (state == RegistrationState.RegistrationOk || state == RegistrationState.RegistrationFailed) {
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
if (LinphoneActivity.isInstanciated())
|
||||
LinphoneActivity.instance().onRegistrationStateChanged(state, message);
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().onRegistrationStateChanged(state, message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setActivityToLaunchOnIncomingReceived(Class<? extends Activity> activity) {
|
||||
|
|
|
@ -67,6 +67,7 @@ public class StatusFragment extends Fragment {
|
|||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
isAttached = true;
|
||||
|
||||
if (activity instanceof LinphoneActivity) {
|
||||
((LinphoneActivity) activity).updateStatusFragment(this);
|
||||
|
@ -75,8 +76,6 @@ public class StatusFragment extends Fragment {
|
|||
((InCallActivity) activity).updateStatusFragment(this);
|
||||
isInCall = true;
|
||||
}
|
||||
|
||||
isAttached = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +92,7 @@ public class StatusFragment extends Fragment {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (state == RegistrationState.RegistrationOk) {
|
||||
if (state == RegistrationState.RegistrationOk && LinphoneManager.getLc().getDefaultProxyConfig().isRegistered()) {
|
||||
statusLed.setImageResource(R.drawable.connected_led);
|
||||
statusText.setText(getString(R.string.status_connected));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue