forked from jens/Automation
profile delete bug fixed
This commit is contained in:
parent
e719114166
commit
4c9e61618b
@ -458,29 +458,17 @@ public class Profile implements Comparable<Profile>
|
||||
|
||||
public boolean delete(Context context)
|
||||
{
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.profileActive))
|
||||
Rule usingRule = this.isInUseByRules();
|
||||
if(usingRule != null)
|
||||
{
|
||||
for (Rule rule : Rule.findRuleCandidatesByTriggerProfile(this))
|
||||
{
|
||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), rule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), usingRule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(Rule.isAnyRuleUsing(Action_Enum.changeSoundProfile))
|
||||
{
|
||||
for (Rule rule : Rule.findRuleCandidatesByActionProfile(this))
|
||||
{
|
||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), rule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
profileCollection.remove(this);
|
||||
return XmlFileInterface.writeFile();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean plausibilityCheck()
|
||||
|
@ -7,3 +7,4 @@
|
||||
* Fixed: Service wouldn't always start after device has been powered on
|
||||
* Fixed: Set ringtones on Android 11 and above
|
||||
* Fixed: Permission read storage required for changing ringtones
|
||||
* Fixed: Profile that were not in use, could not be deleted.
|
Loading…
Reference in New Issue
Block a user