Compare commits

..

No commits in common. "27e9b3e0d1162fd2f05fd245a34621fd3b0099d0" and "6f80caa1c69893e9c693d2dcb4f3518a12c463a1" have entirely different histories.

22 changed files with 20 additions and 95 deletions

View File

@ -11,8 +11,8 @@ android {
compileSdkVersion 31
buildToolsVersion '29.0.2'
useLibrary 'org.apache.http.legacy'
versionCode 126
versionName "1.7.11"
versionCode 125
versionName "1.7.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -476,8 +476,6 @@ public class Rule implements Comparable<Rule>
{
AutomationService service = AutomationService.getInstance();
service.speak(messages[0], false);
if(Settings.showToasts)
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
super.onProgressUpdate(messages);

View File

@ -440,8 +440,6 @@ public class Rule implements Comparable<Rule>
{
AutomationService service = AutomationService.getInstance();
service.speak(messages[0], false);
if(Settings.showToasts)
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
super.onProgressUpdate(messages);

View File

@ -467,8 +467,6 @@ public class Rule implements Comparable<Rule>
{
AutomationService service = AutomationService.getInstance();
service.speak(messages[0], false);
if(Settings.showToasts)
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
super.onProgressUpdate(messages);

View File

@ -34,7 +34,6 @@ import com.jens.automation2.receivers.PhoneStatusListener;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -42,7 +41,6 @@ import java.util.Set;
public class AutomationService extends Service implements OnInitListener
{
protected TextToSpeech ttsEngine = null;
protected int ttsStatus = -1;
protected final static int notificationId = 1000;
protected final static int notificationIdRestrictions = 1005;
protected final static int notificationIdLocationRestriction = 1006;
@ -99,11 +97,6 @@ public class AutomationService extends Service implements OnInitListener
this.lockSoundChangesEnd = lockSoundChangesEnd;
}
public int getTtsStatus()
{
return ttsStatus;
}
protected final IBinder myBinder = new LocalBinder();
protected LocationProvider myLocationProvider;
@ -233,7 +226,6 @@ public class AutomationService extends Service implements OnInitListener
this.isRunning = true;
Miscellaneous.logEvent("i", "Service", this.getResources().getString(R.string.serviceStarted) + " VERSION_CODE: " + BuildConfig.VERSION_CODE + ", VERSION_NAME: " + BuildConfig.VERSION_NAME + ", flavor: " + BuildConfig.FLAVOR, 1);
if(Settings.showToasts)
Toast.makeText(this, this.getResources().getString(R.string.serviceStarted), Toast.LENGTH_LONG).show();
/*
@ -314,7 +306,6 @@ public class AutomationService extends Service implements OnInitListener
stopRoutine();
this.isRunning = false;
if(Settings.showToasts)
Toast.makeText(this, getResources().getString(R.string.serviceStopped), Toast.LENGTH_LONG).show();
Miscellaneous.logEvent("i", "Service", getResources().getString(R.string.serviceStopped), 1);
}
@ -324,26 +315,8 @@ public class AutomationService extends Service implements OnInitListener
if (Settings.useTextToSpeechOnNormal || Settings.useTextToSpeechOnSilent || Settings.useTextToSpeechOnVibrate || Rule.isAnyRuleUsing(Action.Action_Enum.speakText))
{
if (ttsEngine == null)
{
ttsEngine = new TextToSpeech(this, new TextToSpeech.OnInitListener()
{
@Override
public void onInit(int status)
{
ttsStatus = status;
if (status == TextToSpeech.SUCCESS)
{
ttsEngine.setLanguage(Locale.getDefault());
Miscellaneous.logEvent("i", "TTS engine", "TTS engine available.", 3);
}
else
Miscellaneous.logEvent("i", "TTS engine", "TTS engine not available. Status: " + String.valueOf(status), 3);
}
});
}
}
else
ttsEngine = new TextToSpeech(this, this);
} else
{
if (ttsEngine != null)
ttsEngine.shutdown();
@ -698,26 +671,25 @@ public class AutomationService extends Service implements OnInitListener
{
try
{
for(int i = 0; i < 60; i++)
for(int i = 0; i < 5; i++)
{
if(ttsEngine == null || ttsStatus != TextToSpeech.SUCCESS)
if(ttsEngine != null)
{
break;
}
else
{
try
{
Miscellaneous.logEvent("i", "TTS", "Waiting for a moment to give the TTS service time to load...", 4);
Thread.sleep(500); // give the tts engine time to load
Thread.sleep(1000); // give the tts engine time to load
}
catch(Exception e)
{}
}
else
{
Miscellaneous.logEvent("i", "TextToSpeech", "Speaking \"" + text + "\" in language " + ttsEngine.getLanguage().toLanguageTag(), 3);
}
Miscellaneous.logEvent("i", "TextToSpeech", "Speaking " + text + " in language " + ttsEngine.getLanguage().toLanguageTag(), 3);
this.ttsEngine.speak(text, TextToSpeech.QUEUE_ADD, null);
break;
}
}
Miscellaneous.logEvent("i", "TextToSpeech", "TTS engine not available after waiting 30 seconds, yet. Aborting.", 3);
}
catch(Exception e)
{

View File

@ -65,7 +65,6 @@ public class Settings implements SharedPreferences
public static int tabsPlacement;
public static boolean executeRulesAndProfilesWithSingleClick;
public static boolean displayNewsOnMainScreen;
public static boolean showToasts;
public static boolean automaticUpdateCheck;
public static long musicCheckFrequency;
@ -131,8 +130,6 @@ public class Settings implements SharedPreferences
public static final int default_tabsPlacement = 0;
public static final boolean default_executeRulesAndProfilesWithSingleClick = false;
public static final boolean default_displayNewsOnMainScreen = false;
public static final boolean default_showToasts = true;
public static final boolean default_automaticUpdateCheck = false;
public static final boolean default_lockSoundChanges = false;
public static final long default_lastNewsPolltime = -1;
@ -280,7 +277,6 @@ public class Settings implements SharedPreferences
executeRulesAndProfilesWithSingleClick = prefs.getBoolean("executeRulesAndProfilesWithSingleClick", default_executeRulesAndProfilesWithSingleClick);
automaticUpdateCheck = prefs.getBoolean("automaticUpdateCheck", default_automaticUpdateCheck);
displayNewsOnMainScreen = prefs.getBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen);
showToasts = prefs.getBoolean("showToasts", default_showToasts);
lockSoundChanges = prefs.getBoolean("lockSoundChanges", default_lockSoundChanges);
noticeAndroid9MicrophoneShown = prefs.getBoolean("noticeAndroid9MicrophoneShown", false);
@ -476,9 +472,6 @@ public class Settings implements SharedPreferences
if(!prefs.contains("displayNewsOnMainScreen") || force)
editor.putBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen);
if(!prefs.contains("showToasts") || force)
editor.putBoolean("showToasts", default_showToasts);
if(!prefs.contains("musicCheckFrequency") || force)
editor.putLong("musicCheckFrequency", default_musicCheckFrequency);
@ -562,7 +555,6 @@ public class Settings implements SharedPreferences
editor.putBoolean("executeRulesAndProfilesWithSingleClick", executeRulesAndProfilesWithSingleClick);
editor.putBoolean("automaticUpdateCheck", automaticUpdateCheck);
editor.putBoolean("displayNewsOnMainScreen", displayNewsOnMainScreen);
editor.putBoolean("showToasts", showToasts);
if(Settings.musicCheckFrequency == 0)
Settings.musicCheckFrequency = Settings.default_musicCheckFrequency;

View File

@ -74,11 +74,6 @@
android:title="@string/displayNewsOnMainScreen"
android:summary="@string/displayNewsOnMainScreenDescription" />
<CheckBoxPreference
android:key="showToasts"
android:title="@string/showToastsForEvents"
android:summary="@string/showToastsForEventsSummary" />
</PreferenceCategory>
<PreferenceCategory

View File

@ -777,6 +777,4 @@
<string name="attachment">Dateianhang</string>
<string name="chooseFile">Datei wählen</string>
<string name="startAppByStartService">via startService()</string>
<string name="showToastsForEvents">Toasts anzeigen</string>
<string name="showToastsForEventsSummary">Popups anzeigen, wenn Ereignisse wie Regelausführungen auftreten</string>
</resources>

View File

@ -776,6 +776,4 @@
<string name="attachment">Archivo adjunto</string>
<string name="chooseFile">elegir archivo</string>
<string name="startAppByStartService">via startService()</string>
<string name="showToastsForEvents">Mostrar toasts</string>
<string name="showToastsForEventsSummary">Mostrar notificaciones del sistema cuando se producen eventos como ejecuciones de reglas</string>
</resources>

View File

@ -776,6 +776,4 @@
<string name="attachment">Attachement</string>
<string name="chooseFile">Choisissez un fichier</string>
<string name="startAppByStartService">via startService()</string>
<string name="showToastsForEvents">Afficher les toasts</string>
<string name="showToastsForEventsSummary">Afficher les toasts lorsque des événements tels que des exécutions de règles se produisent</string>
</resources>

View File

@ -777,6 +777,4 @@
<string name="attachment">Allegato</string>
<string name="chooseFile">Scegli file</string>
<string name="startAppByStartService">tramite startService()</string>
<string name="showToastsForEvents">Mostra toast</string>
<string name="showToastsForEventsSummary">Mostrare gli avvisi popup quando si verificano eventi come le esecuzioni di regole</string>
</resources>

View File

@ -775,7 +775,5 @@
<string name="attachment">Bijlage</string>
<string name="chooseFile">kies bestand</string>
<string name="startAppByStartService">via startService()</string>
<string name="showToastsForEvents">Toon toasts</string>
<string name="showToastsForEventsSummary">Pop-ups weergeven wanneer gebeurtenissen zoals regeluitvoeringen plaatsvinden</string>
</resources>

View File

@ -834,6 +834,4 @@
<string name="attachment">Прикрепление</string>
<string name="chooseFile">выберите файл</string>
<string name="startAppByStartService">дорога startService()</string>
<string name="showToastsForEvents">Показать тосты</string>
<string name="showToastsForEventsSummary">Отображение всплывающих уведомлений при таких событиях, как выполнение правил</string>
</resources>

View File

@ -874,6 +874,4 @@
<string name="attachment">Attachment</string>
<string name="chooseFile">choose file</string>
<string name="startAppByStartService">by startService()</string>
<string name="showToastsForEvents">Show toasts</string>
<string name="showToastsForEventsSummary">Show toasts when events like rule executions occur</string>
</resources>

View File

@ -1,2 +0,0 @@
* Behoben: Sprachausgabe hat nicht immer funktioniert, vor allem beim Programmstart
* Neu: Möglichkeit Toasts zu deaktivieren, z.B. für Regel-Aktivierungen

View File

@ -1,4 +1,4 @@
* Fixed: Now allowing negative integers as intent data
* Fixed: Multiple time frames with reoccurrence configured would trigger to early executions
* Fixed: Multiple time frames with reoccurence configured would trigger to early executions
* Fixed: Automatic app start at boot might fail in some cases
* Translations updated

View File

@ -1,2 +0,0 @@
* Fixed: TTS engine wouldn't always speak, especially at the startup of the app
* Added: Possibility to disable toasts for e.g. announcing rule activations

View File

@ -1,2 +0,0 @@
* Corregido: el motor TTS no siempre hablaba, especialmente al inicio de la aplicación
* Añadido: Posibilidad de desactivar las notificaciones del sistema para, por ejemplo, anunciar activaciones de reglas

View File

@ -1,2 +0,0 @@
* Correction : le moteur TTS ne parlait pas toujours, surtout au démarrage de l'application
* Ajouté: Possibilité de désactiver les toasts pour, par exemple, annoncer les activations de règles

View File

@ -1,2 +0,0 @@
* Risolto: il motore TTS non parlava sempre, specialmente all'avvio dell'app
* Aggiunto: Possibilità di disabilitare gli avvisi popup ad esempio per annunciare l'attivazione delle regole

View File

@ -1,2 +0,0 @@
* Opgelost: TTS-engine zou niet altijd spreken, vooral bij het opstarten van de app
* Toegevoegd: Mogelijkheid om toasts uit te schakelen voor bijvoorbeeld het aankondigen van regelactiveringen

View File

@ -1,2 +0,0 @@
* Исправлено: движок TTS не всегда говорил, особенно при запуске приложения
* Добавлено: Возможность отключения всплывающих уведомлений, например, для объявления активации правил