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(changeVibrateWhenRinging)
|
||||||
{
|
{
|
||||||
// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||||
// {
|
{
|
||||||
// android.provider.Settings.System.putInt(context.getContentResolver(), "vibrate_when_ringing", vibrateWhenRinging?1:0);
|
android.provider.Settings.System.putInt(context.getContentResolver(), "vibrate_when_ringing", vibrateWhenRinging?1:0);
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
if (vibrateWhenRinging)
|
if (vibrateWhenRinging)
|
||||||
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);
|
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);
|
||||||
else
|
else
|
||||||
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
|
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(changeNotificationRingtone)
|
if(changeNotificationRingtone)
|
||||||
|
@ -170,9 +170,9 @@ public class XmlFileInterface
|
|||||||
serializer.startTag(null, "changeVibrateWhenRinging");
|
serializer.startTag(null, "changeVibrateWhenRinging");
|
||||||
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeVibrateWhenRinging()));
|
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeVibrateWhenRinging()));
|
||||||
serializer.endTag(null, "changeVibrateWhenRinging");//
|
serializer.endTag(null, "changeVibrateWhenRinging");//
|
||||||
serializer.startTag(null, "changeVibrateWhenRinging");
|
serializer.startTag(null, "vibrateWhenRinging");
|
||||||
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getVibrateWhenRinging()));
|
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getVibrateWhenRinging()));
|
||||||
serializer.endTag(null, "changeVibrateWhenRinging");
|
serializer.endTag(null, "vibrateWhenRinging");
|
||||||
|
|
||||||
serializer.startTag(null, "changeNotificationRingtone");
|
serializer.startTag(null, "changeNotificationRingtone");
|
||||||
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeNotificationRingtone()));
|
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeNotificationRingtone()));
|
||||||
@ -218,7 +218,6 @@ public class XmlFileInterface
|
|||||||
serializer.endTag(null, "ProfileCollection");
|
serializer.endTag(null, "ProfileCollection");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
serializer.startTag(null, "RuleCollection");
|
serializer.startTag(null, "RuleCollection");
|
||||||
for(int i=0; i<Rule.getRuleCollection().size(); i++)
|
for(int i=0; i<Rule.getRuleCollection().size(); i++)
|
||||||
{
|
{
|
||||||
@ -652,6 +651,8 @@ public class XmlFileInterface
|
|||||||
else
|
else
|
||||||
newProfile.setNotificationRingtone(null);
|
newProfile.setNotificationRingtone(null);
|
||||||
}
|
}
|
||||||
|
else if (name.equals("vibrateWhenRinging"))
|
||||||
|
newProfile.setVibrateWhenRinging(Boolean.parseBoolean(readTag(parser, "vibrateWhenRinging")));
|
||||||
else if (name.equals("changeAudibleSelection"))
|
else if (name.equals("changeAudibleSelection"))
|
||||||
newProfile.setChangeAudibleSelection(Boolean.parseBoolean(readTag(parser, "changeAudibleSelection")));
|
newProfile.setChangeAudibleSelection(Boolean.parseBoolean(readTag(parser, "changeAudibleSelection")));
|
||||||
else if (name.equals("audibleSelection"))
|
else if (name.equals("audibleSelection"))
|
||||||
|
Loading…
Reference in New Issue
Block a user