Show battery dialogue always
This commit is contained in:
parent
d8fd59394c
commit
b97e2deaa2
|
@ -221,8 +221,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openBatteryOptimizationDialogIfNeeded() {
|
private void openBatteryOptimizationDialogIfNeeded() {
|
||||||
if (hasAccountWithoutPush()
|
if (isOptimizingBattery()
|
||||||
&& isOptimizingBattery()
|
|
||||||
&& android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M
|
&& android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M
|
||||||
&& getPreferences().getBoolean(getBatteryOptimizationPreferenceKey(), true)) {
|
&& getPreferences().getBoolean(getBatteryOptimizationPreferenceKey(), true)) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
@ -245,15 +244,6 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasAccountWithoutPush() {
|
|
||||||
for (Account account : xmppConnectionService.getAccounts()) {
|
|
||||||
if (account.getStatus() == Account.State.ONLINE && !xmppConnectionService.getPushManagementService().available(account)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyFragmentOfBackendConnected(@IdRes int id) {
|
private void notifyFragmentOfBackendConnected(@IdRes int id) {
|
||||||
final Fragment fragment = getFragmentManager().findFragmentById(id);
|
final Fragment fragment = getFragmentManager().findFragmentById(id);
|
||||||
if (fragment instanceof OnBackendConnected) {
|
if (fragment instanceof OnBackendConnected) {
|
||||||
|
|
Loading…
Reference in a new issue