Prevent incall activity from launching twice
This commit is contained in:
parent
e124d9603d
commit
908849e1c9
2 changed files with 13 additions and 5 deletions
|
@ -85,8 +85,8 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
private static IncallActivity instance;
|
||||
private CountDownTimer timer;
|
||||
public static boolean active;
|
||||
@Override protected void setActive(boolean a) {active = a;}
|
||||
@Override protected boolean isActive() {return active;}
|
||||
@Override protected synchronized void setActive(boolean a) {active = a;}
|
||||
@Override protected synchronized boolean isActive() {return active;}
|
||||
|
||||
public static boolean isReady() {
|
||||
return instance!=null;
|
||||
|
@ -112,10 +112,12 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
private boolean mAllowTransfers;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (finishIfAutoRestartAfterACrash(savedInstanceState)) {
|
||||
return;
|
||||
}
|
||||
setActive(true);
|
||||
|
||||
if (!Version.isXLargeScreen(this))
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
|
||||
|
@ -147,6 +149,12 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
IncallActivity.active = false;
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldFinishCalleeActivity() {
|
||||
|
|
|
@ -420,13 +420,13 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
|
|||
if (IncallActivity.instance() != null && IncallActivity.instance().isActive()) {
|
||||
return;
|
||||
}
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
if (IncallActivity.instance() != null && IncallActivity.instance().isActive()) return;
|
||||
Intent intent = new Intent().setClass(LinphoneActivity.this, IncallActivity.class);
|
||||
startActivityForResult(intent, incall_activity);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
public void startIncomingCallActivity() {
|
||||
|
|
Loading…
Reference in a new issue