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() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean availableAndUseful(Account account) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1498,7 +1498,7 @@ public class ConversationActivity extends XmppActivity
|
|||
private boolean hasAccountWithoutPush() {
|
||||
for(Account account : xmppConnectionService.getAccounts()) {
|
||||
if (account.getStatus() != Account.State.DISABLED
|
||||
&& !xmppConnectionService.getPushManagementService().available(account)) {
|
||||
&& !xmppConnectionService.getPushManagementService().availableAndUseful(account)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -836,7 +836,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
|||
if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) {
|
||||
Features features = this.mAccount.getXmppConnection().getFeatures();
|
||||
this.mStats.setVisibility(View.VISIBLE);
|
||||
boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().available(mAccount) && isOptimizingBattery();
|
||||
boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().availableAndUseful(mAccount) && isOptimizingBattery();
|
||||
boolean showDataSaverWarning = isAffectedByDataSaver();
|
||||
showOsOptimizationWarning(showBatteryWarning,showDataSaverWarning);
|
||||
this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection()
|
||||
|
|
|
@ -106,6 +106,10 @@ public class PushManagementService {
|
|||
return connection != null && connection.getFeatures().push() && playServicesAvailable();
|
||||
}
|
||||
|
||||
public boolean availableAndUseful(Account account) {
|
||||
return account.getServerIdentity() == XmppConnection.Identity.EJABBERD && available(account);
|
||||
}
|
||||
|
||||
private boolean playServicesAvailable() {
|
||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue