tethering type
This commit is contained in:
parent
4f7c36c4f7
commit
d74e2eae68
@ -977,7 +977,19 @@ public class Trigger
|
|||||||
|
|
||||||
boolean checkTetheringActive()
|
boolean checkTetheringActive()
|
||||||
{
|
{
|
||||||
return TetheringReceiver.isTetheringActive() == triggerParameter;
|
if(TetheringReceiver.isTetheringActive() == triggerParameter)
|
||||||
|
{
|
||||||
|
if(getTriggerParameter2().equals(ActivityManageTriggerTethering.tetheringTypeAny))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for(String oneOfLastTypes : TetheringReceiver.getLastTetheringTypes())
|
||||||
|
{
|
||||||
|
if(oneOfLastTypes.equals(getTriggerParameter2()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkDateTime(Object triggeringObject, boolean checkifStateChangedSinceLastRuleExecution)
|
public boolean checkDateTime(Object triggeringObject, boolean checkifStateChangedSinceLastRuleExecution)
|
||||||
|
@ -12,6 +12,7 @@ import com.jens.automation2.Rule;
|
|||||||
import com.jens.automation2.Trigger;
|
import com.jens.automation2.Trigger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TetheringReceiver extends android.content.BroadcastReceiver implements AutomationListenerInterface
|
public class TetheringReceiver extends android.content.BroadcastReceiver implements AutomationListenerInterface
|
||||||
{
|
{
|
||||||
@ -20,8 +21,14 @@ public class TetheringReceiver extends android.content.BroadcastReceiver impleme
|
|||||||
private static TetheringReceiver receiverInstance = null;
|
private static TetheringReceiver receiverInstance = null;
|
||||||
private static IntentFilter intentFilter = null;
|
private static IntentFilter intentFilter = null;
|
||||||
|
|
||||||
|
private static List<String> lastTetheringTypes = null;
|
||||||
private static boolean tetheringActive = false;
|
private static boolean tetheringActive = false;
|
||||||
|
|
||||||
|
public static List<String> getLastTetheringTypes()
|
||||||
|
{
|
||||||
|
return lastTetheringTypes;
|
||||||
|
}
|
||||||
|
|
||||||
public static TetheringReceiver getInstance()
|
public static TetheringReceiver getInstance()
|
||||||
{
|
{
|
||||||
if(receiverInstance == null)
|
if(receiverInstance == null)
|
||||||
@ -53,7 +60,14 @@ public class TetheringReceiver extends android.content.BroadcastReceiver impleme
|
|||||||
if(key.equals(target) && ob instanceof ArrayList)
|
if(key.equals(target) && ob instanceof ArrayList)
|
||||||
{
|
{
|
||||||
if(((ArrayList<String>)ob).size() > 0)
|
if(((ArrayList<String>)ob).size() > 0)
|
||||||
|
{
|
||||||
tetheringActive = true;
|
tetheringActive = true;
|
||||||
|
|
||||||
|
for(String adapterName : (ArrayList<String>)ob)
|
||||||
|
{
|
||||||
|
String test = adapterName;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
tetheringActive = false;
|
tetheringActive = false;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
Loading…
Reference in New Issue
Block a user