Fix battery optimizations check

This commit is contained in:
CappielloAntonio 2020-07-19 12:22:28 +02:00
commit f2f1db576e

View file

@ -51,7 +51,11 @@ public class SplashActivity extends AbsBaseActivity {
credentialProvider = new AndroidCredentialProvider(jsonSerializer, this, logger); credentialProvider = new AndroidCredentialProvider(jsonSerializer, this, logger);
connectionManager = App.getConnectionManager(this, jsonSerializer, logger, httpClient); connectionManager = App.getConnectionManager(this, jsonSerializer, logger, httpClient);
}
@Override
protected void onResume() {
super.onResume();
if (detectBatteryOptimization()) { if (detectBatteryOptimization()) {
showBatteryOptimizationDialog(); showBatteryOptimizationDialog();
} else { } else {
@ -79,7 +83,6 @@ public class SplashActivity extends AbsBaseActivity {
}) })
.setPositiveButton(R.string.action_go_to_optimization_settings, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.action_go_to_optimization_settings, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
login();
openPowerSettings(SplashActivity.this); openPowerSettings(SplashActivity.this);
} }
}) })