Compare commits
3 Commits
6f80caa1c6
...
27e9b3e0d1
Author | SHA1 | Date | |
---|---|---|---|
|
27e9b3e0d1 | ||
a6c6dfc6ba | |||
|
6a7875cc61 |
@ -11,8 +11,8 @@ android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion '29.0.2'
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
versionCode 125
|
||||
versionName "1.7.10"
|
||||
versionCode 126
|
||||
versionName "1.7.11"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
@ -476,7 +476,9 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
AutomationService service = AutomationService.getInstance();
|
||||
service.speak(messages[0], false);
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
if(Settings.showToasts)
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
super.onProgressUpdate(messages);
|
||||
}
|
||||
|
@ -440,7 +440,9 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
AutomationService service = AutomationService.getInstance();
|
||||
service.speak(messages[0], false);
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
if(Settings.showToasts)
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
super.onProgressUpdate(messages);
|
||||
}
|
||||
|
@ -467,7 +467,9 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
AutomationService service = AutomationService.getInstance();
|
||||
service.speak(messages[0], false);
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
if(Settings.showToasts)
|
||||
Toast.makeText(service, messages[0], Toast.LENGTH_LONG).show();
|
||||
|
||||
super.onProgressUpdate(messages);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ 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;
|
||||
|
||||
@ -41,6 +42,7 @@ 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;
|
||||
@ -97,6 +99,11 @@ public class AutomationService extends Service implements OnInitListener
|
||||
this.lockSoundChangesEnd = lockSoundChangesEnd;
|
||||
}
|
||||
|
||||
public int getTtsStatus()
|
||||
{
|
||||
return ttsStatus;
|
||||
}
|
||||
|
||||
protected final IBinder myBinder = new LocalBinder();
|
||||
|
||||
protected LocationProvider myLocationProvider;
|
||||
@ -226,7 +233,8 @@ 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);
|
||||
Toast.makeText(this, this.getResources().getString(R.string.serviceStarted), Toast.LENGTH_LONG).show();
|
||||
if(Settings.showToasts)
|
||||
Toast.makeText(this, this.getResources().getString(R.string.serviceStarted), Toast.LENGTH_LONG).show();
|
||||
|
||||
/*
|
||||
On normal phones the app is supposed to automatically restart in case of any problems.
|
||||
@ -306,7 +314,8 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
stopRoutine();
|
||||
this.isRunning = false;
|
||||
Toast.makeText(this, getResources().getString(R.string.serviceStopped), Toast.LENGTH_LONG).show();
|
||||
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);
|
||||
}
|
||||
|
||||
@ -315,8 +324,26 @@ 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, this);
|
||||
} else
|
||||
{
|
||||
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
|
||||
{
|
||||
if (ttsEngine != null)
|
||||
ttsEngine.shutdown();
|
||||
@ -671,25 +698,26 @@ public class AutomationService extends Service implements OnInitListener
|
||||
{
|
||||
try
|
||||
{
|
||||
for(int i = 0; i < 5; i++)
|
||||
for(int i = 0; i < 60; i++)
|
||||
{
|
||||
if(ttsEngine != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
if(ttsEngine == null || ttsStatus != TextToSpeech.SUCCESS)
|
||||
{
|
||||
try
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TTS", "Waiting for a moment to give the TTS service time to load...", 4);
|
||||
Thread.sleep(1000); // give the tts engine time to load
|
||||
Thread.sleep(500); // give the tts engine time to load
|
||||
}
|
||||
catch(Exception e)
|
||||
{}
|
||||
}
|
||||
else
|
||||
{
|
||||
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", "Speaking " + text + " in language " + ttsEngine.getLanguage().toLanguageTag(), 3);
|
||||
this.ttsEngine.speak(text, TextToSpeech.QUEUE_ADD, null);
|
||||
Miscellaneous.logEvent("i", "TextToSpeech", "TTS engine not available after waiting 30 seconds, yet. Aborting.", 3);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ 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;
|
||||
|
||||
@ -130,6 +131,8 @@ 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;
|
||||
@ -277,6 +280,7 @@ 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);
|
||||
@ -472,6 +476,9 @@ 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);
|
||||
|
||||
@ -555,6 +562,7 @@ 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;
|
||||
|
@ -74,7 +74,12 @@
|
||||
android:title="@string/displayNewsOnMainScreen"
|
||||
android:summary="@string/displayNewsOnMainScreenDescription" />
|
||||
|
||||
</PreferenceCategory>
|
||||
<CheckBoxPreference
|
||||
android:key="showToasts"
|
||||
android:title="@string/showToastsForEvents"
|
||||
android:summary="@string/showToastsForEventsSummary" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:summary="@string/soundSettings"
|
||||
|
@ -777,4 +777,6 @@
|
||||
<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>
|
@ -776,4 +776,6 @@
|
||||
<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>
|
@ -776,4 +776,6 @@
|
||||
<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>
|
||||
|
@ -777,4 +777,6 @@
|
||||
<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>
|
||||
|
@ -775,5 +775,7 @@
|
||||
<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>
|
||||
|
@ -834,4 +834,6 @@
|
||||
<string name="attachment">Прикрепление</string>
|
||||
<string name="chooseFile">выберите файл</string>
|
||||
<string name="startAppByStartService">дорога startService()</string>
|
||||
<string name="showToastsForEvents">Показать тосты</string>
|
||||
<string name="showToastsForEventsSummary">Отображение всплывающих уведомлений при таких событиях, как выполнение правил</string>
|
||||
</resources>
|
||||
|
@ -874,4 +874,6 @@
|
||||
<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>
|
2
fastlane/metadata/android/de-DE/changelogs/126.txt
Normal file
2
fastlane/metadata/android/de-DE/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* Behoben: Sprachausgabe hat nicht immer funktioniert, vor allem beim Programmstart
|
||||
* Neu: Möglichkeit Toasts zu deaktivieren, z.B. für Regel-Aktivierungen
|
@ -1,4 +1,4 @@
|
||||
* Fixed: Now allowing negative integers as intent data
|
||||
* Fixed: Multiple time frames with reoccurence configured would trigger to early executions
|
||||
* Fixed: Multiple time frames with reoccurrence configured would trigger to early executions
|
||||
* Fixed: Automatic app start at boot might fail in some cases
|
||||
* Translations updated
|
2
fastlane/metadata/android/en-US/changelogs/126.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* 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
|
2
fastlane/metadata/android/es-ES/changelogs/126.txt
Normal file
2
fastlane/metadata/android/es-ES/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* 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
|
2
fastlane/metadata/android/fr-FR/changelogs/126.txt
Normal file
2
fastlane/metadata/android/fr-FR/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* 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
|
2
fastlane/metadata/android/it-IT/changelogs/126.txt
Normal file
2
fastlane/metadata/android/it-IT/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* 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
|
2
fastlane/metadata/android/nl-NL/changelogs/126.txt
Normal file
2
fastlane/metadata/android/nl-NL/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* 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
|
2
fastlane/metadata/android/ru-RU/changelogs/126.txt
Normal file
2
fastlane/metadata/android/ru-RU/changelogs/126.txt
Normal file
@ -0,0 +1,2 @@
|
||||
* Исправлено: движок TTS не всегда говорил, особенно при запуске приложения
|
||||
* Добавлено: Возможность отключения всплывающих уведомлений, например, для объявления активации правил
|
Loading…
Reference in New Issue
Block a user