Prevent app from making too many connections to wizard.php script for phone number link purposes
This commit is contained in:
parent
f6115014d8
commit
d1820168dd
1 changed files with 17 additions and 16 deletions
|
@ -1471,27 +1471,14 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
}
|
}
|
||||||
|
|
||||||
public void isAccountWithAlias() {
|
public void isAccountWithAlias() {
|
||||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
|
||||||
long now = new Timestamp(new Date().getTime()).getTime();
|
|
||||||
if (mAccountCreator != null && LinphonePreferences.instance().getLinkPopupTime() == null
|
|
||||||
|| Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) < now) {
|
|
||||||
mAccountCreator.setUsername(
|
|
||||||
LinphonePreferences.instance()
|
|
||||||
.getAccountUsername(
|
|
||||||
LinphonePreferences.instance().getDefaultAccountIndex()));
|
|
||||||
mAccountCreator.isAccountExist();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LinphonePreferences.instance().setLinkPopupTime(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void askLinkWithPhoneNumber() {
|
|
||||||
if (!LinphonePreferences.instance().isLinkPopupEnabled()) return;
|
if (!LinphonePreferences.instance().isLinkPopupEnabled()) return;
|
||||||
|
|
||||||
|
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||||
|
|
||||||
long now = new Timestamp(new Date().getTime()).getTime();
|
long now = new Timestamp(new Date().getTime()).getTime();
|
||||||
if (LinphonePreferences.instance().getLinkPopupTime() != null
|
if (LinphonePreferences.instance().getLinkPopupTime() != null
|
||||||
&& Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) >= now) return;
|
&& Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) >= now)
|
||||||
|
return;
|
||||||
|
|
||||||
long future =
|
long future =
|
||||||
new Timestamp(
|
new Timestamp(
|
||||||
|
@ -1501,7 +1488,21 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
.getTime();
|
.getTime();
|
||||||
long newDate = now + future;
|
long newDate = now + future;
|
||||||
|
|
||||||
|
if (mAccountCreator != null) {
|
||||||
|
mAccountCreator.setUsername(
|
||||||
|
LinphonePreferences.instance()
|
||||||
|
.getAccountUsername(
|
||||||
|
LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||||
|
mAccountCreator.isAccountExist();
|
||||||
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
|
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LinphonePreferences.instance().setLinkPopupTime(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void askLinkWithPhoneNumber() {
|
||||||
|
if (!LinphonePreferences.instance().isLinkPopupEnabled()) return;
|
||||||
|
|
||||||
final Dialog dialog =
|
final Dialog dialog =
|
||||||
LinphoneActivity.instance()
|
LinphoneActivity.instance()
|
||||||
|
|
Loading…
Reference in a new issue