All 3 flavors can be compiled.

This commit is contained in:
2021-02-16 23:38:38 +01:00
parent 8690dec2e2
commit f379ab01ef
9 changed files with 135 additions and 80 deletions

View File

@@ -356,20 +356,20 @@ public class Trigger
if(ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), "com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
{
// This type doesn't have an activate/deactivate equivalent, at least not yet.
try
{
Class activityDetection = Class.forName("com.jens.automation2.receivers.ActivityDetectionReceiver");
for(Method method : activityDetection.getMethods())
{
if(method.getName().equalsIgnoreCase("getDescription"))
returnString.append(method.invoke(getActivityDetectionType()));
// returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.detectedActivity) + " " + activityDetection.getDescription(getActivityDetectionType()));
}
}
catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException e)
{
e.printStackTrace();
}
// try
// {
returnString.append(Miscellaneous.runMethodReflective(ActivityManageSpecificRule.activityDetectionClassPath, "getDescription", new Object[] { getActivityDetectionType() } ));
// for(Method method : activityDetection.getMethods())
// {
// if(method.getName().equalsIgnoreCase("getDescription"))
// returnString.append(method.invoke());
//// returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.detectedActivity) + " " + activityDetection.getDescription(getActivityDetectionType()));
// }
// }
// catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException e)
// {
// e.printStackTrace();
// }
}
else