mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-03 22:26:56 +02:00
Added rule loop sound option
This commit is contained in:
@@ -1428,6 +1428,7 @@ public class EntityRule {
|
||||
|
||||
private boolean onActionSound(Context context, EntityMessage message, JSONObject jargs) throws JSONException {
|
||||
Uri uri = (jargs.has("uri") ? Uri.parse(jargs.getString("uri")) : null);
|
||||
boolean loop = jargs.getBoolean("loop");
|
||||
boolean alarm = jargs.getBoolean("alarm");
|
||||
int duration = jargs.optInt("duration", MediaPlayerHelper.DEFAULT_ALARM_DURATION);
|
||||
Log.i("Sound uri=" + uri + " alarm=" + alarm + " duration=" + duration);
|
||||
@@ -1438,7 +1439,7 @@ public class EntityRule {
|
||||
db.message().setMessageUiSilent(message.id, message.ui_silent);
|
||||
|
||||
if (uri != null)
|
||||
MediaPlayerHelper.queue(context, uri, alarm, duration);
|
||||
MediaPlayerHelper.queue(context, uri, loop, alarm, duration);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user