Minor changes

This commit is contained in:
2025-12-31 15:54:25 +01:00
parent 4a90b36f6a
commit b83b6568ca
10 changed files with 24 additions and 57 deletions

View File

@@ -112,16 +112,6 @@
android:name="google_analytics_ssaid_collection_enabled" android:name="google_analytics_ssaid_collection_enabled"
android:value="false" /> android:value="false" />
<activity
android:name=".ActivityMainScreen"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivityManagePoi"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivitySettings"
android:label="@string/app_name"></activity>
<service <service
android:name=".AutomationService" android:name=".AutomationService"
android:exported="false" android:exported="false"
@@ -166,6 +156,9 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity android:name=".ActivityMainScreen" android:label="@string/app_name" />
<activity android:name=".ActivityManagePoi" android:label="@string/app_name" />
<activity android:name=".ActivitySettings" android:label="@string/app_name" />
<activity android:name=".ActivityManageRule" /> <activity android:name=".ActivityManageRule" />
<activity android:name=".ActivityManageActionTriggerUrl" /> <activity android:name=".ActivityManageActionTriggerUrl" />
<activity android:name=".ActivityDisplayLongMessage" /> <activity android:name=".ActivityDisplayLongMessage" />
@@ -223,7 +216,6 @@
</intent-filter> </intent-filter>
--> -->
<!-- <!--
<meta-data <meta-data
android:name="android.nfc.action.TECH_DISCOVERED" android:name="android.nfc.action.TECH_DISCOVERED"
@@ -236,13 +228,12 @@
<activity android:name=".ActivityManageActionStartActivity" /> <activity android:name=".ActivityManageActionStartActivity" />
<activity android:name=".ActivityManageTriggerNfc" /> <activity android:name=".ActivityManageTriggerNfc" />
<activity android:name=".ActivityManageActionSpeakText" /> <activity android:name=".ActivityManageActionSpeakText" />
<activity android:name=".ActivityManageActionPlaySound" />
<activity android:name=".ActivityManageTriggerBluetooth" /> <activity android:name=".ActivityManageTriggerBluetooth" />
<activity android:name=".ActivityMainProfiles" /> <activity android:name=".ActivityMainProfiles" />
<activity android:name=".ActivityManageProfile" /> <activity android:name=".ActivityManageProfile" />
<activity android:name=".ActivityManageTriggerWifi" /> <activity android:name=".ActivityManageTriggerWifi" />
<activity android:name=".ActivityVolumeTest" /> <activity android:name=".ActivityVolumeTest" />
<activity android:name=".ActivityPermissions"></activity> <activity android:name=".ActivityPermissions" />
<activity android:name=".ActivityManageTriggerNotification" /> <activity android:name=".ActivityManageTriggerNotification" />
<activity android:name=".ActivityManageTriggerCalendar" /> <activity android:name=".ActivityManageTriggerCalendar" />
<activity android:name=".ActivityManageTriggerProximity" /> <activity android:name=".ActivityManageTriggerProximity" />
@@ -258,7 +249,6 @@
</service> </service>
<activity android:name=".ActivityPermissions" />
<!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p--> <!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p-->
<uses-library android:name="org.apache.http.legacy" android:required="false"/> <uses-library android:name="org.apache.http.legacy" android:required="false"/>

View File

@@ -554,7 +554,8 @@ public class Rule implements Comparable<Rule>
{ {
try try
{ {
Rule.this.getActionSet().get(i).run(automationService, doToggle); Miscellaneous.logEvent("i", "RuleExecution", "Running action " + Rule.this.getActionSet().get(i).toStringShort() + " of rule " + Rule.this.getName(), 5);
Rule.this.getActionSet().get(i).run(automationService, doToggle);
} }
catch(Exception e) catch(Exception e)
{ {
@@ -591,10 +592,7 @@ public class Rule implements Comparable<Rule>
public void activate(AutomationService automationService, boolean force) public void activate(AutomationService automationService, boolean force)
{ {
ActivateRuleTask task = new ActivateRuleTask(); ActivateRuleTask task = new ActivateRuleTask();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
else
task.execute(automationService, force);
} }
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType) public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)

View File

@@ -110,16 +110,6 @@
android:name="google_analytics_ssaid_collection_enabled" android:name="google_analytics_ssaid_collection_enabled"
android:value="false" /> android:value="false" />
<activity
android:name=".ActivityMainScreen"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivityManagePoi"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivitySettings"
android:label="@string/app_name"></activity>
<service <service
android:name=".AutomationService" android:name=".AutomationService"
android:exported="false" android:exported="false"
@@ -164,6 +154,9 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity android:name=".ActivityMainScreen" android:label="@string/app_name" />
<activity android:name=".ActivityManagePoi" android:label="@string/app_name" />
<activity android:name=".ActivitySettings" android:label="@string/app_name" />
<activity android:name=".ActivityManageRule" /> <activity android:name=".ActivityManageRule" />
<activity android:name=".ActivityManageActionTriggerUrl" /> <activity android:name=".ActivityManageActionTriggerUrl" />
<activity android:name=".ActivityDisplayLongMessage" /> <activity android:name=".ActivityDisplayLongMessage" />
@@ -221,7 +214,6 @@
</intent-filter> </intent-filter>
--> -->
<!-- <!--
<meta-data <meta-data
android:name="android.nfc.action.TECH_DISCOVERED" android:name="android.nfc.action.TECH_DISCOVERED"
@@ -234,13 +226,12 @@
<activity android:name=".ActivityManageActionStartActivity" /> <activity android:name=".ActivityManageActionStartActivity" />
<activity android:name=".ActivityManageTriggerNfc" /> <activity android:name=".ActivityManageTriggerNfc" />
<activity android:name=".ActivityManageActionSpeakText" /> <activity android:name=".ActivityManageActionSpeakText" />
<activity android:name=".ActivityManageActionPlaySound" />
<activity android:name=".ActivityManageTriggerBluetooth" /> <activity android:name=".ActivityManageTriggerBluetooth" />
<activity android:name=".ActivityMainProfiles" /> <activity android:name=".ActivityMainProfiles" />
<activity android:name=".ActivityManageProfile" /> <activity android:name=".ActivityManageProfile" />
<activity android:name=".ActivityManageTriggerWifi" /> <activity android:name=".ActivityManageTriggerWifi" />
<activity android:name=".ActivityVolumeTest" /> <activity android:name=".ActivityVolumeTest" />
<activity android:name=".ActivityPermissions"></activity> <activity android:name=".ActivityPermissions" />
<activity android:name=".ActivityManageTriggerNotification" /> <activity android:name=".ActivityManageTriggerNotification" />
<activity android:name=".ActivityManageTriggerCalendar" /> <activity android:name=".ActivityManageTriggerCalendar" />
<activity android:name=".ActivityManageTriggerProximity" /> <activity android:name=".ActivityManageTriggerProximity" />
@@ -256,7 +247,6 @@
</service> </service>
<activity android:name=".ActivityPermissions" />
<!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p--> <!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p-->
<uses-library android:name="org.apache.http.legacy" android:required="false"/> <uses-library android:name="org.apache.http.legacy" android:required="false"/>

View File

@@ -527,6 +527,7 @@ public class Rule implements Comparable<Rule>
{ {
try try
{ {
Miscellaneous.logEvent("i", "RuleExecution", "Running action " + Rule.this.getActionSet().get(i).toStringShort() + " of rule " + Rule.this.getName(), 5);
Rule.this.getActionSet().get(i).run(automationService, doToggle); Rule.this.getActionSet().get(i).run(automationService, doToggle);
} }
catch(Exception e) catch(Exception e)
@@ -564,10 +565,7 @@ public class Rule implements Comparable<Rule>
public void activate(AutomationService automationService, boolean force) public void activate(AutomationService automationService, boolean force)
{ {
ActivateRuleTask task = new ActivateRuleTask(); ActivateRuleTask task = new ActivateRuleTask();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
else
task.execute(automationService, force);
} }
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType) public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)

View File

@@ -94,21 +94,11 @@
android:name="google_analytics_ssaid_collection_enabled" android:name="google_analytics_ssaid_collection_enabled"
android:value="false" /> android:value="false" />
<activity
android:name=".ActivityMainScreen"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivityManagePoi"
android:label="@string/app_name"></activity>
<activity
android:name=".ActivitySettings"
android:label="@string/app_name"></activity>
<service <service
android:name=".AutomationService" android:name=".AutomationService"
android:exported="false" android:exported="false"
android:label="@string/app_name" android:label="@string/app_name"
android:foregroundServiceType="specialUse"> android:foregroundServiceType="specialUse" >
<property <property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="Automating things on the device" /> android:value="Automating things on the device" />
@@ -154,6 +144,9 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity android:name=".ActivityMainScreen" android:label="@string/app_name" />
<activity android:name=".ActivityManagePoi" android:label="@string/app_name" />
<activity android:name=".ActivitySettings" android:label="@string/app_name" />
<activity android:name=".ActivityManageRule" /> <activity android:name=".ActivityManageRule" />
<activity android:name=".ActivityManageActionTriggerUrl" /> <activity android:name=".ActivityManageActionTriggerUrl" />
<activity android:name=".ActivityDisplayLongMessage" /> <activity android:name=".ActivityDisplayLongMessage" />
@@ -210,7 +203,6 @@
</intent-filter> </intent-filter>
--> -->
<!-- <!--
<meta-data <meta-data
android:name="android.nfc.action.TECH_DISCOVERED" android:name="android.nfc.action.TECH_DISCOVERED"
@@ -228,7 +220,7 @@
<activity android:name=".ActivityManageProfile" /> <activity android:name=".ActivityManageProfile" />
<activity android:name=".ActivityManageTriggerWifi" /> <activity android:name=".ActivityManageTriggerWifi" />
<activity android:name=".ActivityVolumeTest" /> <activity android:name=".ActivityVolumeTest" />
<activity android:name=".ActivityPermissions"></activity> <activity android:name=".ActivityPermissions" />
<activity android:name=".ActivityManageTriggerNotification" /> <activity android:name=".ActivityManageTriggerNotification" />
<activity android:name=".ActivityManageTriggerCalendar" /> <activity android:name=".ActivityManageTriggerCalendar" />
<activity android:name=".ActivityManageTriggerProximity" /> <activity android:name=".ActivityManageTriggerProximity" />

View File

@@ -554,6 +554,7 @@ public class Rule implements Comparable<Rule>
{ {
try try
{ {
Miscellaneous.logEvent("i", "RuleExecution", "Running action " + Rule.this.getActionSet().get(i).toStringShort() + " of rule " + Rule.this.getName(), 5);
Rule.this.getActionSet().get(i).run(automationService, doToggle); Rule.this.getActionSet().get(i).run(automationService, doToggle);
} }
catch(Exception e) catch(Exception e)
@@ -591,10 +592,7 @@ public class Rule implements Comparable<Rule>
public void activate(AutomationService automationService, boolean force) public void activate(AutomationService automationService, boolean force)
{ {
ActivateRuleTask task = new ActivateRuleTask(); ActivateRuleTask task = new ActivateRuleTask();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
else
task.execute(automationService, force);
} }
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType) public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)

View File

@@ -493,7 +493,7 @@ public class Action
&& &&
!action.toString().equals("turnUsbTetheringOff") !action.toString().equals("turnUsbTetheringOff")
) // exclusion for deprecated types ) // exclusion for deprecated types
actionTypesList.add(action.getFullName(context)); actionTypesList.add(action.getFullName(context));
} }
return (String[])actionTypesList.toArray(new String[actionTypesList.size()]); return (String[])actionTypesList.toArray(new String[actionTypesList.size()]);

View File

@@ -12,6 +12,7 @@ import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothProfile;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.media.AudioManager; import android.media.AudioManager;

View File

@@ -628,7 +628,7 @@ public class Profile implements Comparable<Profile>
{ {
Miscellaneous.logEvent("i", "Profile", "Setting audible selection to " + String.valueOf(audibleSelection ? 1 : 0), 4); Miscellaneous.logEvent("i", "Profile", "Setting audible selection to " + String.valueOf(audibleSelection ? 1 : 0), 4);
if(audibleSelection) if(audibleSelection)
android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED, 1); // enable android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED, 1); // enable
else else
android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED, 0); // dissable android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED, 0); // dissable

View File

@@ -834,7 +834,7 @@
<string name="wifiExplanation1">Apps targeting Android Q or higher cannot turn wifi on or off anymore. Please blame Google for this restriction, not me. You can bypass this restriction by rooting your device and activating the checkbox below. Alternatively download this application from F-Droid or my website as I am not forced to target the latest API level in those versions.</string> <string name="wifiExplanation1">Apps targeting Android Q or higher cannot turn wifi on or off anymore. Please blame Google for this restriction, not me. You can bypass this restriction by rooting your device and activating the checkbox below. Alternatively download this application from F-Droid or my website as I am not forced to target the latest API level in those versions.</string>
<string name="wifiExplanation2">While airplane mode is activated, wifi can only be toggled from applications when using root permissions for that.</string> <string name="wifiExplanation2">While airplane mode is activated, wifi can only be toggled from applications when using root permissions for that.</string>
<string name="usingRoot">using root</string> <string name="usingRoot">using root</string>
<string name="runExecutableExplanation">You can select a script or an executable file here that will be executed as an action.\n\nBut there are some prerequisites which you have to deal with on your own. Google has made it very hard to run anything other than regular Android applications.\n\n1. The script needs to be marked as executable. On a regular Android system (without root) this is actually the hard part.\n\n2. That also means Automation must be able to execute the file, not just the owner or the group.\n\n3. If it is a script, a valid shell be specified in the script\'s header.\n\nIf you cannot meet the above requirements, you could alternatively try to specify a shell as the actual executable (like /system/bin/sh) and your script as parameter. That has worked for at least one user.</string> <string name="runExecutableExplanation">You can select a script or an executable file here that will be executed as an action.\n\nBut there are some prerequisites which you have to deal with on your own. Google has made it very hard to run anything other than regular Android applications.\n\n1. The script needs to be marked as executable. On a regular Android system (without root) this is actually the hard part.\n\n2. That also means Automation must be able to execute the file, not just the owner or the group.\n\n3. If it is a script, a valid shell must be specified in the script\'s header.\n\nIf you cannot meet the above requirements, you could alternatively try to specify a shell as the actual executable (like /system/bin/sh) and your script as parameter. That has worked for at least one user.</string>
<string name="tetheringActive">tethering is active</string> <string name="tetheringActive">tethering is active</string>
<string name="tetheringNotActive">tethering is not active</string> <string name="tetheringNotActive">tethering is not active</string>
<string name="tetheringState">Tethering state</string> <string name="tetheringState">Tethering state</string>