Compare commits
2 Commits
master
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| b83b6568ca | |||
| 4a90b36f6a |
@@ -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"/>
|
||||||
|
|||||||
@@ -514,8 +514,6 @@ public class Rule implements Comparable<Rule>
|
|||||||
protected boolean activateInternally(AutomationService automationService)
|
protected boolean activateInternally(AutomationService automationService)
|
||||||
{
|
{
|
||||||
boolean isActuallyToggleable = isActuallyToggable();
|
boolean isActuallyToggleable = isActuallyToggable();
|
||||||
|
|
||||||
// boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
|
||||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
@@ -556,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)
|
||||||
{
|
{
|
||||||
@@ -593,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)
|
||||||
|
|||||||
@@ -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"/>
|
||||||
|
|||||||
@@ -487,8 +487,6 @@ public class Rule implements Comparable<Rule>
|
|||||||
protected boolean activateInternally(AutomationService automationService)
|
protected boolean activateInternally(AutomationService automationService)
|
||||||
{
|
{
|
||||||
boolean isActuallyToggleable = isActuallyToggable();
|
boolean isActuallyToggleable = isActuallyToggable();
|
||||||
|
|
||||||
// boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
|
||||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
@@ -529,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)
|
||||||
@@ -566,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)
|
||||||
|
|||||||
@@ -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" />
|
||||||
|
|||||||
@@ -514,8 +514,6 @@ public class Rule implements Comparable<Rule>
|
|||||||
protected boolean activateInternally(AutomationService automationService)
|
protected boolean activateInternally(AutomationService automationService)
|
||||||
{
|
{
|
||||||
boolean isActuallyToggleable = isActuallyToggable();
|
boolean isActuallyToggleable = isActuallyToggable();
|
||||||
|
|
||||||
// boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
|
||||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
@@ -556,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)
|
||||||
@@ -593,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)
|
||||||
|
|||||||
@@ -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()]);
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -1777,7 +1778,7 @@ public class Actions
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("e", "setData", "Error changing network type: " + Log.getStackTraceString(e), 2);
|
Miscellaneous.logEvent("e", "setData", "Error setting data connection: " + Log.getStackTraceString(e), 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,14 +36,14 @@ public class ActivityManageActionWifi extends Activity
|
|||||||
|
|
||||||
Intent input = getIntent();
|
Intent input = getIntent();
|
||||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
if(input.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
||||||
|
{
|
||||||
rbActionWifiOn.setChecked(input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
rbActionWifiOn.setChecked(input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
||||||
|
rbActionWifiOff.setChecked(!input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
||||||
|
}
|
||||||
|
|
||||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter2))
|
if(input.hasExtra(ActivityManageRule.intentNameActionParameter2))
|
||||||
chkWifiRunAsRoot.setChecked(Boolean.parseBoolean(input.getStringExtra(ActivityManageRule.intentNameActionParameter2)));
|
chkWifiRunAsRoot.setChecked(Boolean.parseBoolean(input.getStringExtra(ActivityManageRule.intentNameActionParameter2)));
|
||||||
|
|
||||||
// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
|
||||||
// Miscellaneous.messageBox(getResources().getString(R.string.app_name), getResources().getString(R.string.android10WifiToggleNotice), ActivityManageActionWifi.this).show();
|
|
||||||
|
|
||||||
if(getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q)
|
if(getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q)
|
||||||
tvWifiExplanation1.setVisibility(View.VISIBLE);
|
tvWifiExplanation1.setVisibility(View.VISIBLE);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -281,6 +281,19 @@ public class ActivityPermissions extends Activity
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getAmountOfRulesWhichLackPermissions(Context context)
|
||||||
|
{
|
||||||
|
int rulesWhichLackPermissions = 0;
|
||||||
|
|
||||||
|
for(Rule r : Rule.getRuleCollection())
|
||||||
|
{
|
||||||
|
if(!ActivityPermissions.havePermissionsForRule(r, context))
|
||||||
|
rulesWhichLackPermissions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rulesWhichLackPermissions;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean havePermission(String s, Context context)
|
public static boolean havePermission(String s, Context context)
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
@@ -536,6 +549,8 @@ public class ActivityPermissions extends Activity
|
|||||||
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
|
||||||
addToArrayListUnique(Manifest.permission.BLUETOOTH, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.BLUETOOTH, requiredPermissions);
|
||||||
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
if(Build.VERSION.SDK_INT >= 31)
|
||||||
|
addToArrayListUnique(Manifest.permission.BLUETOOTH_CONNECT, requiredPermissions);
|
||||||
break;
|
break;
|
||||||
case charging:
|
case charging:
|
||||||
// addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
|
// addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
|
||||||
@@ -911,12 +926,8 @@ public class ActivityPermissions extends Activity
|
|||||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
break;
|
break;
|
||||||
case Manifest.permission.BLUETOOTH_ADMIN:
|
case Manifest.permission.BLUETOOTH_ADMIN:
|
||||||
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.bluetoothConnection))
|
|
||||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
|
||||||
for(String ruleName : getRulesUsing(Action.Action_Enum.setBluetooth))
|
|
||||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
|
||||||
break;
|
|
||||||
case Manifest.permission.BLUETOOTH:
|
case Manifest.permission.BLUETOOTH:
|
||||||
|
case Manifest.permission.BLUETOOTH_CONNECT:
|
||||||
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.bluetoothConnection))
|
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.bluetoothConnection))
|
||||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
for(String ruleName : getRulesUsing(Action.Action_Enum.setBluetooth))
|
for(String ruleName : getRulesUsing(Action.Action_Enum.setBluetooth))
|
||||||
|
|||||||
@@ -180,6 +180,17 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
Rule.getRuleCollection().size() == 0
|
Rule.getRuleCollection().size() == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if(
|
||||||
|
Rule.getRuleCollection().size() > 0
|
||||||
|
&&
|
||||||
|
Rule.getRuleCollection().size() == ActivityPermissions.getAmountOfRulesWhichLackPermissions(Miscellaneous.getAnyContext())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Miscellaneous.logEvent("w", "AutomationService", "Don't have complete permissions for any defined rule. Not starting service.", 1);
|
||||||
|
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStartPermissions), Toast.LENGTH_LONG).show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (startAtBoot)
|
if (startAtBoot)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.jens.automation2.ActivityPermissions;
|
import com.jens.automation2.ActivityPermissions;
|
||||||
import com.jens.automation2.AutomationService;
|
import com.jens.automation2.AutomationService;
|
||||||
@@ -149,8 +150,6 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
|||||||
{
|
{
|
||||||
return lhs.getName().compareTo(rhs.getName());
|
return lhs.getName().compareTo(rhs.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(NullPointerException e)
|
catch(NullPointerException e)
|
||||||
@@ -159,6 +158,12 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
|||||||
|
|
||||||
returnArray = new BluetoothDevice[] {};
|
returnArray = new BluetoothDevice[] {};
|
||||||
}
|
}
|
||||||
|
catch(SecurityException se)
|
||||||
|
{
|
||||||
|
Toast.makeText(Miscellaneous.getAnyContext(), Miscellaneous.getAnyContext().getResources().getString(R.string.permissionRequiredBluetooth), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
returnArray = new BluetoothDevice[] {};
|
||||||
|
}
|
||||||
|
|
||||||
return returnArray;
|
return returnArray;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<string name="pleaseSpecifiyTrigger">Please specify at least one trigger.</string>
|
<string name="pleaseSpecifiyTrigger">Please specify at least one trigger.</string>
|
||||||
<string name="pleaseSpecifiyAction">Please specify at least one action.</string>
|
<string name="pleaseSpecifiyAction">Please specify at least one action.</string>
|
||||||
<string name="serviceWontStart">No rules defined. Service won\'t start.</string>
|
<string name="serviceWontStart">No rules defined. Service won\'t start.</string>
|
||||||
|
<string name="serviceWontStartPermissions">Don\'t have full permission for any defined rule. Service won\'t start.</string>
|
||||||
<string name="serviceWontStartNoActivatedRules">No activated rules defined. Service won\'t start.</string>
|
<string name="serviceWontStartNoActivatedRules">No activated rules defined. Service won\'t start.</string>
|
||||||
<string name="serviceStarted">Automation Service started.</string>
|
<string name="serviceStarted">Automation Service started.</string>
|
||||||
<string name="version">Version %1$s.</string>
|
<string name="version">Version %1$s.</string>
|
||||||
@@ -833,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>
|
||||||
@@ -970,4 +971,5 @@
|
|||||||
<string name="far">far</string>
|
<string name="far">far</string>
|
||||||
<string name="proximityText">proximity is between \"%1$s\" and \"%2$s\"</string>
|
<string name="proximityText">proximity is between \"%1$s\" and \"%2$s\"</string>
|
||||||
<string name="pleaseWait">Please wait.</string>
|
<string name="pleaseWait">Please wait.</string>
|
||||||
|
<string name="permissionRequiredBluetooth">Bluetooth permission required to edit this rule. Request permissions from the main screen first.</string>
|
||||||
</resources>
|
</resources>
|
||||||
3
fastlane/metadata/android/en-US/changelogs/146.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/146.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
* Fixed: Set-wifi action wasn't correctly pre-filled-out when editing action.
|
||||||
|
* Fixed: Service startup checks improved when no rules with full permissions were present.
|
||||||
|
* Fixed: Editing bluetooth trigger could crash if permissions weren't given.
|
||||||
Reference in New Issue
Block a user