mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-13 13:05:03 -05:00
e28e6d8817
Extracted notification related settings in separate class (see Issue 2268) Update issue 371 Status: Fixed Added ability to disable LED notification for new messages
116 lines
2.1 KiB
Java
116 lines
2.1 KiB
Java
package com.fsck.k9;
|
|
|
|
/**
|
|
* Describes how a notification should behave.
|
|
*/
|
|
public class NotificationSetting
|
|
{
|
|
|
|
/**
|
|
* Ring notification kill switch. Allow disabling ringtones without losing
|
|
* ringtone selection.
|
|
*/
|
|
private boolean mRing;
|
|
|
|
private String mRingtoneUri;
|
|
|
|
/**
|
|
* LED kill switch.
|
|
*/
|
|
private boolean mLed;
|
|
|
|
private int mLedColor;
|
|
|
|
/**
|
|
* Vibration kill switch.
|
|
*/
|
|
private boolean mVibrate;
|
|
|
|
private int mVibratePattern;
|
|
|
|
private int mVibrateTimes;
|
|
|
|
/**
|
|
* Set the ringtone kill switch. Allow to disable ringtone without losing
|
|
* ringtone selection.
|
|
*
|
|
* @param ring
|
|
* <code>true</code> to allow ringtones, <code>false</code>
|
|
* otherwise.
|
|
*/
|
|
public synchronized void setRing(boolean ring)
|
|
{
|
|
mRing = ring;
|
|
}
|
|
|
|
/**
|
|
* @return <code>true</code> if ringtone is allowed to play,
|
|
* <code>false</code> otherwise.
|
|
*/
|
|
public synchronized boolean shouldRing()
|
|
{
|
|
return mRing;
|
|
}
|
|
|
|
public synchronized String getRingtone()
|
|
{
|
|
return mRingtoneUri;
|
|
}
|
|
|
|
public synchronized void setRingtone(String ringtoneUri)
|
|
{
|
|
mRingtoneUri = ringtoneUri;
|
|
}
|
|
|
|
public synchronized boolean isLed()
|
|
{
|
|
return mLed;
|
|
}
|
|
|
|
public synchronized void setLed(final boolean led)
|
|
{
|
|
mLed = led;
|
|
}
|
|
|
|
public synchronized int getLedColor()
|
|
{
|
|
return mLedColor;
|
|
}
|
|
|
|
public synchronized void setLedColor(int color)
|
|
{
|
|
mLedColor = color;
|
|
}
|
|
|
|
public synchronized boolean isVibrate()
|
|
{
|
|
return mVibrate;
|
|
}
|
|
|
|
public synchronized void setVibrate(boolean vibrate)
|
|
{
|
|
mVibrate = vibrate;
|
|
}
|
|
|
|
public synchronized int getVibratePattern()
|
|
{
|
|
return mVibratePattern;
|
|
}
|
|
|
|
public synchronized int getVibrateTimes()
|
|
{
|
|
return mVibrateTimes;
|
|
}
|
|
|
|
public synchronized void setVibratePattern(int pattern)
|
|
{
|
|
mVibratePattern = pattern;
|
|
}
|
|
|
|
public synchronized void setVibrateTimes(int times)
|
|
{
|
|
mVibrateTimes = times;
|
|
}
|
|
|
|
}
|