Media playing trigger

This commit is contained in:
Jens 2022-01-30 22:08:55 +01:00
parent 5899dd86f5
commit 1a8ce579a7
3 changed files with 5 additions and 11 deletions

View File

@ -263,6 +263,8 @@ public class Settings implements SharedPreferences
startScreen = Integer.parseInt(prefs.getString("startScreen", String.valueOf(default_startScreen))); startScreen = Integer.parseInt(prefs.getString("startScreen", String.valueOf(default_startScreen)));
tabsPlacement = Integer.parseInt(prefs.getString("tabsPlacement", String.valueOf(default_tabsPlacement))); tabsPlacement = Integer.parseInt(prefs.getString("tabsPlacement", String.valueOf(default_tabsPlacement)));
musicCheckFrequency = Long.parseLong(prefs.getString("musicCheckFrequency", String.valueOf(default_musicCheckFrequency)));
executeRulesAndProfilesWithSingleClick = prefs.getBoolean("executeRulesAndProfilesWithSingleClick", default_executeRulesAndProfilesWithSingleClick); executeRulesAndProfilesWithSingleClick = prefs.getBoolean("executeRulesAndProfilesWithSingleClick", default_executeRulesAndProfilesWithSingleClick);
automaticUpdateCheck = prefs.getBoolean("automaticUpdateCheck", default_automaticUpdateCheck); automaticUpdateCheck = prefs.getBoolean("automaticUpdateCheck", default_automaticUpdateCheck);
displayNewsOnMainScreen = prefs.getBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen); displayNewsOnMainScreen = prefs.getBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen);
@ -273,8 +275,6 @@ public class Settings implements SharedPreferences
lastNewsPolltime = prefs.getLong("lastNewsPolltime", default_lastNewsPolltime); lastNewsPolltime = prefs.getLong("lastNewsPolltime", default_lastNewsPolltime);
lastUpdateCheck = prefs.getLong("lastUpdateCheck", default_lastUpdateCheck); lastUpdateCheck = prefs.getLong("lastUpdateCheck", default_lastUpdateCheck);
musicCheckFrequency = prefs.getLong("musicCheckFrequency", default_musicCheckFrequency);
String whbdString = prefs.getString("whatHasBeenDone", ""); String whbdString = prefs.getString("whatHasBeenDone", "");
if(whbdString != null && whbdString.length() > 0) if(whbdString != null && whbdString.length() > 0)
@ -337,9 +337,6 @@ public class Settings implements SharedPreferences
if(!prefs.contains("writeLogFile") || force) if(!prefs.contains("writeLogFile") || force)
editor.putBoolean("writeLogFile", default_writeLogFile); editor.putBoolean("writeLogFile", default_writeLogFile);
// if(!prefs.contains("useTextToSpeech") || force)
// editor.putBoolean("useTextToSpeech", default_useTextToSpeech);
if(!prefs.contains("useTextToSpeechOnNormal") || force) if(!prefs.contains("useTextToSpeechOnNormal") || force)
editor.putBoolean("useTextToSpeechOnNormal", default_useTextToSpeechOnNormal); editor.putBoolean("useTextToSpeechOnNormal", default_useTextToSpeechOnNormal);
@ -549,6 +546,7 @@ public class Settings implements SharedPreferences
editor.putBoolean("executeRulesAndProfilesWithSingleClick", executeRulesAndProfilesWithSingleClick); editor.putBoolean("executeRulesAndProfilesWithSingleClick", executeRulesAndProfilesWithSingleClick);
editor.putBoolean("automaticUpdateCheck", automaticUpdateCheck); editor.putBoolean("automaticUpdateCheck", automaticUpdateCheck);
editor.putBoolean("displayNewsOnMainScreen", displayNewsOnMainScreen); editor.putBoolean("displayNewsOnMainScreen", displayNewsOnMainScreen);
editor.putString("musicCheckFrequency", String.valueOf(musicCheckFrequency));
editor.putBoolean("lockSoundChanges", lockSoundChanges); editor.putBoolean("lockSoundChanges", lockSoundChanges);
editor.putBoolean("noticeAndroid9MicrophoneShown", noticeAndroid9MicrophoneShown); editor.putBoolean("noticeAndroid9MicrophoneShown", noticeAndroid9MicrophoneShown);
@ -556,8 +554,6 @@ public class Settings implements SharedPreferences
editor.putLong("lastNewsPolltime", lastNewsPolltime); editor.putLong("lastNewsPolltime", lastNewsPolltime);
editor.putLong("lastUpdateCheck", lastUpdateCheck); editor.putLong("lastUpdateCheck", lastUpdateCheck);
editor.putLong("musicCheckFrequency", musicCheckFrequency);
editor.putString("whatHasBeenDone", Miscellaneous.explode(";", whatHasBeenDone)); editor.putString("whatHasBeenDone", Miscellaneous.explode(";", whatHasBeenDone));

View File

@ -2,7 +2,6 @@ package com.jens.automation2.receivers;
import android.content.Context; import android.content.Context;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.MediaPlayer;
import com.jens.automation2.AutomationService; import com.jens.automation2.AutomationService;
import com.jens.automation2.Miscellaneous; import com.jens.automation2.Miscellaneous;
@ -11,7 +10,6 @@ import com.jens.automation2.Settings;
import com.jens.automation2.Trigger; import com.jens.automation2.Trigger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Set;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;

View File

@ -790,7 +790,7 @@
<string name="selectParameters">Select parameters</string> <string name="selectParameters">Select parameters</string>
<string name="musicIsPlaying">music is playing</string> <string name="musicIsPlaying">music is playing</string>
<string name="musicIsNotPlaying">music is not playing</string> <string name="musicIsNotPlaying">music is not playing</string>
<string name="musicCheckFrequencyTitle">Frequency to check if music is playing [milliseconds]</string>
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
<string name="musicPlayingDetection">Music playing detection</string> <string name="musicPlayingDetection">Music playing detection</string>
<string name="musicCheckFrequencyTitle">Check frequency [ms]</string>
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
</resources> </resources>