mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 17:52:17 -05:00
show doze warning when push is running on prosody
This commit is contained in:
parent
1876b444fa
commit
8e025cbb9e
@ -21,4 +21,8 @@ public class PushManagementService {
|
|||||||
public boolean isStub() {
|
public boolean isStub() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean availableAndUseful(Account account) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1498,7 +1498,7 @@ public class ConversationActivity extends XmppActivity
|
|||||||
private boolean hasAccountWithoutPush() {
|
private boolean hasAccountWithoutPush() {
|
||||||
for(Account account : xmppConnectionService.getAccounts()) {
|
for(Account account : xmppConnectionService.getAccounts()) {
|
||||||
if (account.getStatus() != Account.State.DISABLED
|
if (account.getStatus() != Account.State.DISABLED
|
||||||
&& !xmppConnectionService.getPushManagementService().available(account)) {
|
&& !xmppConnectionService.getPushManagementService().availableAndUseful(account)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -836,7 +836,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
|||||||
if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) {
|
if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) {
|
||||||
Features features = this.mAccount.getXmppConnection().getFeatures();
|
Features features = this.mAccount.getXmppConnection().getFeatures();
|
||||||
this.mStats.setVisibility(View.VISIBLE);
|
this.mStats.setVisibility(View.VISIBLE);
|
||||||
boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().available(mAccount) && isOptimizingBattery();
|
boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().availableAndUseful(mAccount) && isOptimizingBattery();
|
||||||
boolean showDataSaverWarning = isAffectedByDataSaver();
|
boolean showDataSaverWarning = isAffectedByDataSaver();
|
||||||
showOsOptimizationWarning(showBatteryWarning,showDataSaverWarning);
|
showOsOptimizationWarning(showBatteryWarning,showDataSaverWarning);
|
||||||
this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection()
|
this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection()
|
||||||
|
@ -106,6 +106,10 @@ public class PushManagementService {
|
|||||||
return connection != null && connection.getFeatures().push() && playServicesAvailable();
|
return connection != null && connection.getFeatures().push() && playServicesAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean availableAndUseful(Account account) {
|
||||||
|
return account.getServerIdentity() == XmppConnection.Identity.EJABBERD && available(account);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean playServicesAvailable() {
|
private boolean playServicesAvailable() {
|
||||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
|
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user