forked from jens/Automation
vibrateWhenRinging
This commit is contained in:
parent
d042b3f35a
commit
9e2f7c16f6
@ -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)
|
||||
|
@ -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()));
|
||||
@ -218,7 +218,6 @@ public class XmlFileInterface
|
||||
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"))
|
||||
|
Loading…
Reference in New Issue
Block a user