vibrateWhenRinging

This commit is contained in:
jens 2021-10-09 02:19:34 +02:00
parent d042b3f35a
commit 9e2f7c16f6
2 changed files with 12 additions and 11 deletions

View File

@ -492,17 +492,17 @@ public class Profile implements Comparable<Profile>
if(changeVibrateWhenRinging)
{
// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
// {
// android.provider.Settings.System.putInt(context.getContentResolver(), "vibrate_when_ringing", vibrateWhenRinging?1:0);
// }
// else
// {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
android.provider.Settings.System.putInt(context.getContentResolver(), "vibrate_when_ringing", vibrateWhenRinging?1:0);
}
else
{
if (vibrateWhenRinging)
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);
else
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
// }
}
}
if(changeNotificationRingtone)

View File

@ -170,9 +170,9 @@ public class XmlFileInterface
serializer.startTag(null, "changeVibrateWhenRinging");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeVibrateWhenRinging()));
serializer.endTag(null, "changeVibrateWhenRinging");//
serializer.startTag(null, "changeVibrateWhenRinging");
serializer.startTag(null, "vibrateWhenRinging");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getVibrateWhenRinging()));
serializer.endTag(null, "changeVibrateWhenRinging");
serializer.endTag(null, "vibrateWhenRinging");
serializer.startTag(null, "changeNotificationRingtone");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeNotificationRingtone()));
@ -216,8 +216,7 @@ public class XmlFileInterface
serializer.endTag(null, "Profile");
}
serializer.endTag(null, "ProfileCollection");
serializer.startTag(null, "RuleCollection");
for(int i=0; i<Rule.getRuleCollection().size(); i++)
@ -652,6 +651,8 @@ public class XmlFileInterface
else
newProfile.setNotificationRingtone(null);
}
else if (name.equals("vibrateWhenRinging"))
newProfile.setVibrateWhenRinging(Boolean.parseBoolean(readTag(parser, "vibrateWhenRinging")));
else if (name.equals("changeAudibleSelection"))
newProfile.setChangeAudibleSelection(Boolean.parseBoolean(readTag(parser, "changeAudibleSelection")));
else if (name.equals("audibleSelection"))