Battery charging type differentiation and other fixes

This commit is contained in:
2024-01-25 16:53:43 +01:00
parent 04fe674cf6
commit 6c31b67b14
17 changed files with 129 additions and 34 deletions

View File

@@ -526,15 +526,23 @@ public class ActivityMainScreen extends ActivityGeneric
{
if (Rule.getRuleCollection().size() > 0)
{
if(Rule.getAmountOfActivatedRules() == 0)
{
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStartNoActivatedRules), Toast.LENGTH_LONG).show();
activityMainScreenInstance.toggleService.setChecked(false);
return;
}
if (!AutomationService.isMyServiceRunning(context))
{
// if(myServiceIntent == null) //do we need that line?????
myServiceIntent = new Intent(context, AutomationService.class);
myServiceIntent.putExtra("startAtBoot", startAtBoot);
context.startService(myServiceIntent);
} else
}
else
Miscellaneous.logEvent("w", "Service", context.getResources().getString(R.string.logServiceAlreadyRunning), 3);
} else
}
else
{
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStart), Toast.LENGTH_LONG).show();
activityMainScreenInstance.toggleService.setChecked(false);