Incall/conference activities handle finish by themselves
Should avoid all cases where empty activities are shown
This commit is contained in:
parent
c4a81663cf
commit
ea894d9c6e
4 changed files with 17 additions and 20 deletions
|
@ -99,21 +99,22 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
|
|||
@Override
|
||||
protected void onResume() {
|
||||
mSpecificCalls = updateSpecificCallsList();
|
||||
if (!finishOnEmptySpecificCallsWhileResuming() || mSpecificCalls.size() != 0) {
|
||||
if (shouldFinishCalleeActivity()) {
|
||||
finish();
|
||||
} else {
|
||||
setActive(true);
|
||||
updateUI();
|
||||
mSpeakerButton.setChecked(LinphoneManager.getInstance().isSpeakerOn());
|
||||
mMuteMicButton.setChecked(LinphoneManager.getLc().isMicMuted());
|
||||
LinphoneManager.addListener(this);
|
||||
LinphoneManager.startProximitySensorForActivity(this);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
protected boolean finishOnEmptySpecificCallsWhileResuming() {
|
||||
return false;
|
||||
// Hook
|
||||
protected boolean shouldFinishCalleeActivity() {
|
||||
return mSpecificCalls.size() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,8 +133,12 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
|
|||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
mSpecificCalls = updateSpecificCallsList();
|
||||
if (shouldFinishCalleeActivity()) {
|
||||
finish();
|
||||
} else {
|
||||
updateUI();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -55,11 +55,6 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity {
|
|||
return new ConfListAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean finishOnEmptySpecificCallsWhileResuming() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private class ConfListAdapter extends CalleeListAdapter {
|
||||
@Override
|
||||
public View getView(int position, View v, ViewGroup parent) {
|
||||
|
|
|
@ -119,7 +119,10 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean shouldFinishCalleeActivity() {
|
||||
return lc().getCallsNb() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CalleeListAdapter createCalleeListAdapter() {
|
||||
|
|
|
@ -161,8 +161,6 @@ public class LinphoneActivity extends TabActivity implements
|
|||
stopService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||
}
|
||||
break;
|
||||
case incall_activity:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -456,11 +454,8 @@ public class LinphoneActivity extends TabActivity implements
|
|||
if (IncallActivity.active) {
|
||||
return;
|
||||
}
|
||||
startActivityForResult(new Intent().setClass(
|
||||
LinphoneActivity.this,
|
||||
IncallActivity.class),
|
||||
incall_activity);
|
||||
IncallActivity.active = true;
|
||||
Intent intent = new Intent().setClass(this, IncallActivity.class);
|
||||
startActivityForResult(intent, incall_activity);
|
||||
}
|
||||
|
||||
public void startIncomingCallActivity(LinphoneCall pendingCall) {
|
||||
|
@ -532,7 +527,6 @@ public class LinphoneActivity extends TabActivity implements
|
|||
|
||||
|
||||
private void exitIncallActivity() {
|
||||
finishActivity(incall_activity);
|
||||
setVolumeControlStream(AudioManager.USE_DEFAULT_STREAM_TYPE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue