Compare commits
No commits in common. "development" and "master" have entirely different histories.
developmen
...
master
@ -11,8 +11,8 @@ android {
|
|||||||
compileSdkVersion 33
|
compileSdkVersion 33
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
versionCode 143
|
versionCode 142
|
||||||
versionName "1.8.2"
|
versionName "1.8.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
||||||
<!--android:maxSdkVersion="32" />
|
<!--android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
||||||
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
|
@ -76,7 +76,6 @@
|
|||||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
||||||
<!--android:maxSdkVersion="32" />
|
<!--android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
||||||
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
|
@ -73,7 +73,6 @@
|
|||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<!--android:maxSdkVersion="32" />
|
<!--android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />-->
|
||||||
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
@ -33,9 +33,13 @@ public class Action
|
|||||||
setWifiTethering,
|
setWifiTethering,
|
||||||
setBluetoothTethering,
|
setBluetoothTethering,
|
||||||
setDisplayRotation,
|
setDisplayRotation,
|
||||||
|
turnWifiOn,turnWifiOff,
|
||||||
|
turnBluetoothOn,turnBluetoothOff,
|
||||||
triggerUrl,
|
triggerUrl,
|
||||||
changeSoundProfile,
|
changeSoundProfile,
|
||||||
turnUsbTetheringOn,turnUsbTetheringOff,
|
turnUsbTetheringOn,turnUsbTetheringOff,
|
||||||
|
turnWifiTetheringOn,turnWifiTetheringOff,
|
||||||
|
enableScreenRotation,disableScreenRotation,
|
||||||
startOtherActivity,
|
startOtherActivity,
|
||||||
waitBeforeNextAction,
|
waitBeforeNextAction,
|
||||||
turnScreenOnOrOff,
|
turnScreenOnOrOff,
|
||||||
@ -56,9 +60,9 @@ public class Action
|
|||||||
startPhoneCall,
|
startPhoneCall,
|
||||||
stopPhoneCall,
|
stopPhoneCall,
|
||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
|
takeScreenshot,
|
||||||
setLocationService,
|
setLocationService,
|
||||||
sendTextMessage,
|
sendTextMessage;
|
||||||
takeScreenshot;
|
|
||||||
|
|
||||||
public String getFullName(Context context)
|
public String getFullName(Context context)
|
||||||
{
|
{
|
||||||
@ -76,6 +80,14 @@ public class Action
|
|||||||
return context.getResources().getString(R.string.actionSetUsbTethering);
|
return context.getResources().getString(R.string.actionSetUsbTethering);
|
||||||
case setDisplayRotation:
|
case setDisplayRotation:
|
||||||
return context.getResources().getString(R.string.actionSetDisplayRotation);
|
return context.getResources().getString(R.string.actionSetDisplayRotation);
|
||||||
|
case turnWifiOn:
|
||||||
|
return context.getResources().getString(R.string.actionTurnWifiOn);
|
||||||
|
case turnWifiOff:
|
||||||
|
return context.getResources().getString(R.string.actionTurnWifiOff);
|
||||||
|
case turnBluetoothOn:
|
||||||
|
return context.getResources().getString(R.string.actionTurnBluetoothOn);
|
||||||
|
case turnBluetoothOff:
|
||||||
|
return context.getResources().getString(R.string.actionTurnBluetoothOff);
|
||||||
case triggerUrl:
|
case triggerUrl:
|
||||||
return context.getResources().getString(R.string.actionTriggerUrl);
|
return context.getResources().getString(R.string.actionTriggerUrl);
|
||||||
case changeSoundProfile:
|
case changeSoundProfile:
|
||||||
@ -84,6 +96,14 @@ public class Action
|
|||||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOn);
|
return context.getResources().getString(R.string.actionTurnUsbTetheringOn);
|
||||||
case turnUsbTetheringOff:
|
case turnUsbTetheringOff:
|
||||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOff);
|
return context.getResources().getString(R.string.actionTurnUsbTetheringOff);
|
||||||
|
case turnWifiTetheringOn:
|
||||||
|
return context.getResources().getString(R.string.actionTurnWifiTetheringOn);
|
||||||
|
case turnWifiTetheringOff:
|
||||||
|
return context.getResources().getString(R.string.actionTurnWifiTetheringOff);
|
||||||
|
case enableScreenRotation:
|
||||||
|
return context.getResources().getString(R.string.actionEnableScreenRotation);
|
||||||
|
case disableScreenRotation:
|
||||||
|
return context.getResources().getString(R.string.actionDisableScreenRotation);
|
||||||
case startOtherActivity:
|
case startOtherActivity:
|
||||||
return context.getResources().getString(R.string.startOtherActivity);
|
return context.getResources().getString(R.string.startOtherActivity);
|
||||||
case waitBeforeNextAction:
|
case waitBeforeNextAction:
|
||||||
@ -473,9 +493,25 @@ public class Action
|
|||||||
for(Action_Enum action : Action_Enum.values())
|
for(Action_Enum action : Action_Enum.values())
|
||||||
{
|
{
|
||||||
if( // exclusion for deprecated types
|
if( // exclusion for deprecated types
|
||||||
|
!action.toString().equals("turnWifiOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnBluetoothOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnBluetoothOff")
|
||||||
|
&&
|
||||||
!action.toString().equals("turnUsbTetheringOn")
|
!action.toString().equals("turnUsbTetheringOn")
|
||||||
&&
|
&&
|
||||||
!action.toString().equals("turnUsbTetheringOff")
|
!action.toString().equals("turnUsbTetheringOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiTetheringOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiTetheringOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("enableScreenRotation")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("disableScreenRotation")
|
||||||
) // exclusion for deprecated types
|
) // exclusion for deprecated types
|
||||||
actionTypesList.add(action.toString());
|
actionTypesList.add(action.toString());
|
||||||
}
|
}
|
||||||
@ -489,9 +525,25 @@ public class Action
|
|||||||
for(Action_Enum action : Action_Enum.values())
|
for(Action_Enum action : Action_Enum.values())
|
||||||
{
|
{
|
||||||
if( // exclusion for deprecated types
|
if( // exclusion for deprecated types
|
||||||
|
!action.toString().equals("turnWifiOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnBluetoothOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnBluetoothOff")
|
||||||
|
&&
|
||||||
!action.toString().equals("turnUsbTetheringOn")
|
!action.toString().equals("turnUsbTetheringOn")
|
||||||
&&
|
&&
|
||||||
!action.toString().equals("turnUsbTetheringOff")
|
!action.toString().equals("turnUsbTetheringOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiTetheringOn")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("turnWifiTetheringOff")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("enableScreenRotation")
|
||||||
|
&&
|
||||||
|
!action.toString().equals("disableScreenRotation")
|
||||||
) // exclusion for deprecated types
|
) // exclusion for deprecated types
|
||||||
actionTypesList.add(action.getFullName(context));
|
actionTypesList.add(action.getFullName(context));
|
||||||
}
|
}
|
||||||
|
@ -208,8 +208,8 @@ public class Actions
|
|||||||
String[] parts = action.split(Action.actionParameter2Split);
|
String[] parts = action.split(Action.actionParameter2Split);
|
||||||
broadcastIntent.setAction(parts[0]);
|
broadcastIntent.setAction(parts[0]);
|
||||||
|
|
||||||
String[] intentParts = parts[1].split(";");
|
String[] intentparts = parts[1].split(";");
|
||||||
broadcastIntent = packParametersIntoIntent(broadcastIntent, intentParts, 0);
|
broadcastIntent = packParametersIntoIntent(broadcastIntent, intentparts, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
broadcastIntent.setAction(action);
|
broadcastIntent.setAction(action);
|
||||||
@ -1056,57 +1056,51 @@ public class Actions
|
|||||||
String params[];
|
String params[];
|
||||||
|
|
||||||
if(param.contains(Action.actionParameter2Split))
|
if(param.contains(Action.actionParameter2Split))
|
||||||
params = param.split(Action.actionParameter2Split, -1);
|
params = param.split(Action.actionParameter2Split);
|
||||||
else
|
else
|
||||||
params = param.split(";", -1);
|
params = param.split(";");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Intent externalApplicationIntent;
|
Intent externalApplicationIntent;
|
||||||
|
|
||||||
String packageName, className, activityOrAction, startupType;
|
|
||||||
|
|
||||||
packageName = params[0];
|
|
||||||
className = params[1];
|
|
||||||
activityOrAction = params[2];
|
|
||||||
startupType = params[3];
|
|
||||||
|
|
||||||
if (!startByAction)
|
if (!startByAction)
|
||||||
{
|
{
|
||||||
// start by activity
|
// selected by activity
|
||||||
|
|
||||||
|
String packageName, className;
|
||||||
|
|
||||||
|
packageName = params[0];
|
||||||
|
className = params[1];
|
||||||
|
|
||||||
Miscellaneous.logEvent("i", "StartOtherApp", "Starting app by activity: " + packageName + " " + className, 3);
|
Miscellaneous.logEvent("i", "StartOtherApp", "Starting app by activity: " + packageName + " " + className, 3);
|
||||||
|
|
||||||
externalApplicationIntent = new Intent(Intent.ACTION_MAIN);
|
externalApplicationIntent = new Intent(Intent.ACTION_MAIN);
|
||||||
externalApplicationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
externalApplicationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
|
|
||||||
if(packageName.equals("dummyPkg") || packageName.length() == 0)
|
if(packageName.equals("dummyPkg"))
|
||||||
externalApplicationIntent.setAction(className);
|
externalApplicationIntent.setAction(className);
|
||||||
|
|
||||||
externalApplicationIntent.setPackage(packageName);
|
externalApplicationIntent.setClassName(packageName, className);
|
||||||
externalApplicationIntent.setClassName(packageName, activityOrAction);
|
|
||||||
|
|
||||||
if (!Miscellaneous.doesActivityExist(externalApplicationIntent, Miscellaneous.getAnyContext()))
|
if (!Miscellaneous.doesActivityExist(externalApplicationIntent, Miscellaneous.getAnyContext()))
|
||||||
Miscellaneous.logEvent("w", "StartOtherApp", "Activity not found: " + className, 2);
|
Miscellaneous.logEvent("w", "StartOtherApp", "Activity not found: " + className, 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// start by action
|
// selected by action
|
||||||
Miscellaneous.logEvent("i", "StartOtherApp", "Starting app by action: " + param, 3);
|
Miscellaneous.logEvent("i", "StartOtherApp", "Starting app by action: " + param, 3);
|
||||||
|
|
||||||
externalApplicationIntent = new Intent();
|
externalApplicationIntent = new Intent();
|
||||||
|
|
||||||
if (!packageName.equals(dummyPackageString))
|
if (!params[0].equals(dummyPackageString))
|
||||||
{
|
externalApplicationIntent.setPackage(params[0]);
|
||||||
externalApplicationIntent.setPackage(packageName);
|
|
||||||
if(!StringUtils.isEmpty(className))
|
|
||||||
externalApplicationIntent.setClassName(packageName, className);
|
|
||||||
}
|
|
||||||
|
|
||||||
externalApplicationIntent.setAction(activityOrAction);
|
externalApplicationIntent.setAction(params[1]);
|
||||||
|
|
||||||
if (startupType.equals(ActivityManageActionStartActivity.startByServiceString) || startupType.equals(ActivityManageActionStartActivity.startByForegroundServiceString))
|
if (params[2].equals(ActivityManageActionStartActivity.startByServiceString) || params[2].equals(ActivityManageActionStartActivity.startByForegroundServiceString))
|
||||||
{
|
{
|
||||||
externalApplicationIntent.setComponent(new ComponentName(packageName, className));
|
externalApplicationIntent.setComponent(new ComponentName(params[0], params[2]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1115,17 +1109,17 @@ public class Actions
|
|||||||
// Pack intents
|
// Pack intents
|
||||||
if(params.length >= 4)
|
if(params.length >= 4)
|
||||||
{
|
{
|
||||||
if(Miscellaneous.isNumeric(startupType))
|
if(Miscellaneous.isNumeric(params[3]))
|
||||||
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 4);
|
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 4);
|
||||||
else
|
else
|
||||||
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 3);
|
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startupType.equals(ActivityManageActionStartActivity.startByActivityString))
|
if (params[2].equals(ActivityManageActionStartActivity.startByActivityString))
|
||||||
automationServerRef.startActivity(externalApplicationIntent);
|
automationServerRef.startActivity(externalApplicationIntent);
|
||||||
else if (startupType.equals(ActivityManageActionStartActivity.startByServiceString))
|
else if (params[2].equals(ActivityManageActionStartActivity.startByServiceString))
|
||||||
automationServerRef.startService(externalApplicationIntent);
|
automationServerRef.startService(externalApplicationIntent);
|
||||||
else if (startupType.equals(ActivityManageActionStartActivity.startByForegroundServiceString) && Build.VERSION.SDK_INT >= 26)
|
else if (params[2].equals(ActivityManageActionStartActivity.startByForegroundServiceString) && Build.VERSION.SDK_INT >= 26)
|
||||||
automationServerRef.startForegroundService(externalApplicationIntent);
|
automationServerRef.startForegroundService(externalApplicationIntent);
|
||||||
else
|
else
|
||||||
automationServerRef.sendBroadcast(externalApplicationIntent);
|
automationServerRef.sendBroadcast(externalApplicationIntent);
|
||||||
|
@ -8,7 +8,6 @@ import android.content.Intent;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
@ -99,17 +98,8 @@ public class ActivityControlCenter extends Activity
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v)
|
public void onClick(View v)
|
||||||
{
|
{
|
||||||
AlertDialog dialog = Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.importChooseFolderNotice), ActivityControlCenter.this);
|
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener()
|
startActivityForResult(intent, requestCodeImport);
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onDismiss(DialogInterface dialogInterface)
|
|
||||||
{
|
|
||||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
|
||||||
startActivityForResult(intent, requestCodeImport);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dialog.show();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
|||||||
Miscellaneous.messageBox(getResources().getString(R.string.app_name), getResources().getString(R.string.android9RecordAudioNotice) + " " + getResources().getString(R.string.messageNotShownAgain), ActivityMainScreen.this).show();
|
Miscellaneous.messageBox(getResources().getString(R.string.app_name), getResources().getString(R.string.android9RecordAudioNotice) + " " + getResources().getString(R.string.messageNotShownAgain), ActivityMainScreen.this).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Miscellaneous.getTargetSDK(ActivityMainScreen.this) >= 29 && !Settings.noticeAndroid10WifiShown && Rule.isAnyRuleUsing(Action.Action_Enum.setWifi))
|
if(Build.VERSION.SDK_INT >= 29 && !Settings.noticeAndroid10WifiShown && Rule.isAnyRuleUsing(Action.Action_Enum.setWifi))
|
||||||
{
|
{
|
||||||
Settings.noticeAndroid10WifiShown = true;
|
Settings.noticeAndroid10WifiShown = true;
|
||||||
Settings.writeSettings(ActivityMainScreen.this);
|
Settings.writeSettings(ActivityMainScreen.this);
|
||||||
|
@ -53,7 +53,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
Button bSelectApp, bAddIntentPair, bSaveActionStartOtherActivity, showStartProgramExamples;
|
Button bSelectApp, bAddIntentPair, bSaveActionStartOtherActivity, showStartProgramExamples;
|
||||||
Spinner spinnerParameterType;
|
Spinner spinnerParameterType;
|
||||||
RadioGroup rgAppStartupType;
|
RadioGroup rgAppStartupType;
|
||||||
// boolean edit = false;
|
boolean edit = false;
|
||||||
ProgressDialog progressDialog = null;
|
ProgressDialog progressDialog = null;
|
||||||
RadioButton rbStartAppSelectByActivity, rbStartAppSelectByAction, rbStartAppByActivity, rbStartAppByBroadcast, rbStartAppByService, rbStartAppByForegroundService;
|
RadioButton rbStartAppSelectByActivity, rbStartAppSelectByAction, rbStartAppByActivity, rbStartAppByBroadcast, rbStartAppByService, rbStartAppByForegroundService;
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
||||||
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
// etClassName.setEnabled(false);
|
etClassName.setEnabled(false);
|
||||||
|
|
||||||
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
|
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
|
||||||
bSelectApp.setOnClickListener(new OnClickListener()
|
bSelectApp.setOnClickListener(new OnClickListener()
|
||||||
@ -233,29 +233,26 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
|
|
||||||
String parameter2 = "";
|
String parameter2 = "";
|
||||||
|
|
||||||
/*
|
if (rbStartAppSelectByActivity.isChecked())
|
||||||
0 = packageName
|
parameter2 += etPackageName.getText().toString() + Action.actionParameter2Split + etActivityOrActionPath.getText().toString();
|
||||||
1 = className
|
else
|
||||||
2 = activityName/actionName
|
{
|
||||||
3 = startType
|
if (etPackageName.getText().toString() != null && etPackageName.getText().toString().length() > 0)
|
||||||
4 = parameters
|
parameter2 += etPackageName.getText().toString() + Action.actionParameter2Split + etActivityOrActionPath.getText().toString();
|
||||||
*/
|
else
|
||||||
|
parameter2 += Actions.dummyPackageString + Action.actionParameter2Split + etActivityOrActionPath.getText().toString();
|
||||||
|
|
||||||
parameter2 += etPackageName.getText().toString()
|
parameter2 += Action.actionParameter2Split + etClassName.getText().toString();
|
||||||
+ Action.actionParameter2Split
|
}
|
||||||
+ etClassName.getText().toString()
|
|
||||||
+ Action.actionParameter2Split
|
|
||||||
+ etActivityOrActionPath.getText().toString()
|
|
||||||
+ Action.actionParameter2Split;
|
|
||||||
|
|
||||||
if (rbStartAppByActivity.isChecked())
|
if (rbStartAppByActivity.isChecked())
|
||||||
parameter2 += startByActivityString;
|
parameter2 += Action.actionParameter2Split + startByActivityString;
|
||||||
else if(rbStartAppByService.isChecked())
|
else if(rbStartAppByService.isChecked())
|
||||||
parameter2 += startByServiceString;
|
parameter2 += Action.actionParameter2Split + startByServiceString;
|
||||||
else if(rbStartAppByForegroundService.isChecked())
|
else if(rbStartAppByForegroundService.isChecked())
|
||||||
parameter2 += startByForegroundServiceString;
|
parameter2 += Action.actionParameter2Split + startByForegroundServiceString;
|
||||||
else
|
else
|
||||||
parameter2 += startByBroadcastString;
|
parameter2 += Action.actionParameter2Split + startByBroadcastString;
|
||||||
|
|
||||||
for (String s : intentPairList)
|
for (String s : intentPairList)
|
||||||
parameter2 += Action.actionParameter2Split + s;
|
parameter2 += Action.actionParameter2Split + s;
|
||||||
@ -319,6 +316,23 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
rgAppStartupType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(RadioGroup radioGroup, int i)
|
||||||
|
{
|
||||||
|
if(rbStartAppByActivity.isChecked())
|
||||||
|
etClassName.setEnabled(false);
|
||||||
|
else if (rbStartAppByBroadcast.isChecked())
|
||||||
|
etClassName.setEnabled(false);
|
||||||
|
else if(rbStartAppByService.isChecked())
|
||||||
|
etClassName.setEnabled(true);
|
||||||
|
else if(rbStartAppByForegroundService.isChecked())
|
||||||
|
etClassName.setEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Intent i = getIntent();
|
Intent i = getIntent();
|
||||||
if(i.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
if(i.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
||||||
loadValuesIntoGui(i);
|
loadValuesIntoGui(i);
|
||||||
@ -611,36 +625,52 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
rbStartAppSelectByActivity.setChecked(!selectionByAction);
|
rbStartAppSelectByActivity.setChecked(!selectionByAction);
|
||||||
rbStartAppSelectByAction.setChecked(selectionByAction);
|
rbStartAppSelectByAction.setChecked(selectionByAction);
|
||||||
|
|
||||||
/*
|
String[] params;
|
||||||
0 = packageName
|
String partsString = input.getStringExtra(ActivityManageRule.intentNameActionParameter2);
|
||||||
1 = className
|
|
||||||
2 = activityName/actionName
|
|
||||||
3 = startType
|
|
||||||
4 = parameters
|
|
||||||
*/
|
|
||||||
|
|
||||||
try
|
if(partsString.contains(Action.actionParameter2Split))
|
||||||
|
params = partsString.split(Action.actionParameter2Split);
|
||||||
|
else
|
||||||
|
params = partsString.split(";");
|
||||||
|
|
||||||
|
if(Miscellaneous.isNumeric(params[2])) // old configuration file
|
||||||
|
{
|
||||||
|
rbStartAppByActivity.setChecked(params[2].equals(startByActivityString));
|
||||||
|
rbStartAppByBroadcast.setChecked(params[2].equals(startByBroadcastString));
|
||||||
|
rbStartAppByService.setChecked(params[2].equals(startByServiceString));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
String[] params;
|
|
||||||
String partsString = input.getStringExtra(ActivityManageRule.intentNameActionParameter2);
|
|
||||||
|
|
||||||
if(partsString.contains(Action.actionParameter2Split))
|
|
||||||
params = partsString.split(Action.actionParameter2Split, -1);
|
|
||||||
else
|
|
||||||
params = partsString.split(";", -1);
|
|
||||||
|
|
||||||
etPackageName.setText(params[0]);
|
|
||||||
etClassName.setText(params[1]);
|
|
||||||
etActivityOrActionPath.setText(params[2]);
|
|
||||||
|
|
||||||
rbStartAppByActivity.setChecked(params[3].equals(startByActivityString));
|
rbStartAppByActivity.setChecked(params[3].equals(startByActivityString));
|
||||||
rbStartAppByBroadcast.setChecked(params[3].equals(startByBroadcastString));
|
rbStartAppByBroadcast.setChecked(params[3].equals(startByBroadcastString));
|
||||||
rbStartAppByService.setChecked(params[3].equals(startByServiceString));
|
rbStartAppByService.setChecked(params[3].equals(startByServiceString));
|
||||||
rbStartAppByForegroundService.setChecked(params[3].equals(startByForegroundServiceString));
|
rbStartAppByForegroundService.setChecked(params[3].equals(startByForegroundServiceString));
|
||||||
|
}
|
||||||
|
|
||||||
|
int startIndex = -1;
|
||||||
|
|
||||||
|
if(!selectionByAction)
|
||||||
|
{
|
||||||
|
etPackageName.setText(params[0]);
|
||||||
|
etActivityOrActionPath.setText(params[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!params[0].contains(Actions.dummyPackageString))
|
||||||
|
etPackageName.setText(params[0]);
|
||||||
|
|
||||||
|
etActivityOrActionPath.setText(params[1]);
|
||||||
|
etClassName.setText(params[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.length >= 4)
|
||||||
|
startIndex = 4;
|
||||||
|
|
||||||
|
if(startIndex > -1 && params.length > startIndex)
|
||||||
|
{
|
||||||
intentPairList.clear();
|
intentPairList.clear();
|
||||||
|
|
||||||
for(int i=4; i<params.length; i++)
|
for(int i=startIndex; i<params.length; i++)
|
||||||
{
|
{
|
||||||
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
||||||
lvIntentPairs.setVisibility(View.VISIBLE);
|
lvIntentPairs.setVisibility(View.VISIBLE);
|
||||||
@ -650,10 +680,6 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
|
|
||||||
updateIntentPairList();
|
updateIntentPairList();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.errorLoadingValues), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateIntentPairList()
|
private void updateIntentPairList()
|
||||||
|
@ -622,7 +622,7 @@ public class ActivityManageRule extends Activity
|
|||||||
items.add(new Item(typesLong[i].toString(), R.drawable.megaphone));
|
items.add(new Item(typesLong[i].toString(), R.drawable.megaphone));
|
||||||
else if(types[i].toString().equals(Trigger_Enum.phoneCall.toString()))
|
else if(types[i].toString().equals(Trigger_Enum.phoneCall.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
||||||
}
|
}
|
||||||
else if(types[i].toString().equals(Trigger_Enum.nfcTag.toString()))
|
else if(types[i].toString().equals(Trigger_Enum.nfcTag.toString()))
|
||||||
@ -655,7 +655,7 @@ public class ActivityManageRule extends Activity
|
|||||||
items.add(new Item(typesLong[i].toString(), R.drawable.variable));
|
items.add(new Item(typesLong[i].toString(), R.drawable.variable));
|
||||||
else if(types[i].toString().equals(Trigger_Enum.calendarEvent.toString()))
|
else if(types[i].toString().equals(Trigger_Enum.calendarEvent.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.READ_CALENDAR))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.READ_CALENDAR))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.calendar));
|
items.add(new Item(typesLong[i].toString(), R.drawable.calendar));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2238,17 +2238,17 @@ public class ActivityManageRule extends Activity
|
|||||||
items.add(new Item(typesLong[i].toString(), R.drawable.script));
|
items.add(new Item(typesLong[i].toString(), R.drawable.script));
|
||||||
else if(types[i].toString().equals(Action_Enum.startPhoneCall.toString()))
|
else if(types[i].toString().equals(Action_Enum.startPhoneCall.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.CALL_PHONE))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.CALL_PHONE))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
||||||
}
|
}
|
||||||
else if(types[i].toString().equals(Action_Enum.stopPhoneCall.toString()))
|
else if(types[i].toString().equals(Action_Enum.stopPhoneCall.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.ANSWER_PHONE_CALLS))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.ANSWER_PHONE_CALLS))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
||||||
}
|
}
|
||||||
else if(types[i].toString().equals(Action_Enum.sendTextMessage.toString()))
|
else if(types[i].toString().equals(Action_Enum.sendTextMessage.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.message));
|
items.add(new Item(typesLong[i].toString(), R.drawable.message));
|
||||||
}
|
}
|
||||||
else if(types[i].toString().equals(Action_Enum.copyToClipboard.toString()))
|
else if(types[i].toString().equals(Action_Enum.copyToClipboard.toString()))
|
||||||
@ -2259,7 +2259,7 @@ public class ActivityManageRule extends Activity
|
|||||||
items.add(new Item(typesLong[i].toString(), R.drawable.compass_small));
|
items.add(new Item(typesLong[i].toString(), R.drawable.compass_small));
|
||||||
else if(types[i].toString().equals(Action_Enum.takeScreenshot.toString()))
|
else if(types[i].toString().equals(Action_Enum.takeScreenshot.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isServiceAvailable(Miscellaneous.getAnyContext(), "MyAccessibilityService"))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.BIND_ACCESSIBILITY_SERVICE))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.copier));
|
items.add(new Item(typesLong[i].toString(), R.drawable.copier));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2294,28 +2294,28 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
newAction = new Action();
|
newAction = new Action();
|
||||||
|
|
||||||
CharSequence[] actionTypes = Action.getActionTypesAsArray();
|
if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.triggerUrl.toString()))
|
||||||
if(actionTypes[which].toString().equals(Action_Enum.triggerUrl.toString()))
|
|
||||||
{
|
{
|
||||||
//launch other activity to enter a url and parameters;
|
//launch other activity to enter a url and parameters;
|
||||||
newAction.setAction(Action_Enum.triggerUrl);
|
newAction.setAction(Action_Enum.triggerUrl);
|
||||||
|
// ActivityManageActionTriggerUrl.resultingAction = null;
|
||||||
Intent editTriggerIntent = new Intent(context, ActivityManageActionTriggerUrl.class);
|
Intent editTriggerIntent = new Intent(context, ActivityManageActionTriggerUrl.class);
|
||||||
startActivityForResult(editTriggerIntent, requestCodeActionTriggerUrlAdd);
|
startActivityForResult(editTriggerIntent, requestCodeActionTriggerUrlAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setWifi.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifi.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setWifi);
|
newAction.setAction(Action_Enum.setWifi);
|
||||||
Intent editSetWifiIntent = new Intent(context, ActivityManageActionWifi.class);
|
Intent editSetWifiIntent = new Intent(context, ActivityManageActionWifi.class);
|
||||||
startActivityForResult(editSetWifiIntent, requestCodeActionSetWifiAdd);
|
startActivityForResult(editSetWifiIntent, requestCodeActionSetWifiAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setBluetooth.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setBluetooth.toString()))
|
||||||
{
|
{
|
||||||
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
|
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
|
||||||
Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();;
|
Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();;
|
||||||
newAction.setAction(Action_Enum.setBluetooth);
|
newAction.setAction(Action_Enum.setBluetooth);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setUsbTethering.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setUsbTethering.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setUsbTethering);
|
newAction.setAction(Action_Enum.setUsbTethering);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
@ -2323,12 +2323,12 @@ public class ActivityManageRule extends Activity
|
|||||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1)
|
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1)
|
||||||
Miscellaneous.messageBox(context.getResources().getString(R.string.warning), context.getResources().getString(R.string.usbTetheringFailForAboveGingerbread), context).show();
|
Miscellaneous.messageBox(context.getResources().getString(R.string.warning), context.getResources().getString(R.string.usbTetheringFailForAboveGingerbread), context).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setWifiTethering.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifiTethering.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setWifiTethering);
|
newAction.setAction(Action_Enum.setWifiTethering);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setBluetoothTethering.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setBluetoothTethering.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setBluetoothTethering);
|
newAction.setAction(Action_Enum.setBluetoothTethering);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
@ -2339,12 +2339,12 @@ public class ActivityManageRule extends Activity
|
|||||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
|
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
|
||||||
Miscellaneous.messageBox(context.getResources().getString(R.string.notice), context.getResources().getString(R.string.btTetheringNotice), context).show();
|
Miscellaneous.messageBox(context.getResources().getString(R.string.notice), context.getResources().getString(R.string.btTetheringNotice), context).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setDisplayRotation.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setDisplayRotation.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setDisplayRotation);
|
newAction.setAction(Action_Enum.setDisplayRotation);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.changeSoundProfile.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.changeSoundProfile.toString()))
|
||||||
{
|
{
|
||||||
if(Profile.getProfileCollection().size() > 0)
|
if(Profile.getProfileCollection().size() > 0)
|
||||||
{
|
{
|
||||||
@ -2354,23 +2354,23 @@ public class ActivityManageRule extends Activity
|
|||||||
else
|
else
|
||||||
Toast.makeText(context, getResources().getString(R.string.noProfilesCreateOneFirst), Toast.LENGTH_LONG).show();
|
Toast.makeText(context, getResources().getString(R.string.noProfilesCreateOneFirst), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.startOtherActivity.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.startOtherActivity.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.startOtherActivity);
|
newAction.setAction(Action_Enum.startOtherActivity);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
|
||||||
startActivityForResult(intent, requestCodeActionStartActivityAdd);
|
startActivityForResult(intent, requestCodeActionStartActivityAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.waitBeforeNextAction.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.waitBeforeNextAction.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.waitBeforeNextAction);
|
newAction.setAction(Action_Enum.waitBeforeNextAction);
|
||||||
getActionWaitBeforeNextActionDialog(ActivityManageRule.this).show();
|
getActionWaitBeforeNextActionDialog(ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.turnScreenOnOrOff.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.turnScreenOnOrOff.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.turnScreenOnOrOff);
|
newAction.setAction(Action_Enum.turnScreenOnOrOff);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setAirplaneMode.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setAirplaneMode.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setAirplaneMode);
|
newAction.setAction(Action_Enum.setAirplaneMode);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
@ -2379,13 +2379,13 @@ public class ActivityManageRule extends Activity
|
|||||||
Miscellaneous.messageBox(getResources().getString(R.string.airplaneMode), getResources().getString(R.string.rootExplanation), ActivityManageRule.this).show();
|
Miscellaneous.messageBox(getResources().getString(R.string.airplaneMode), getResources().getString(R.string.rootExplanation), ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setDataConnection.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setDataConnection.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setDataConnection);
|
newAction.setAction(Action_Enum.setDataConnection);
|
||||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||||
Miscellaneous.messageBox(getResources().getString(R.string.actionDataConnection), getResources().getString(R.string.rootExplanation), ActivityManageRule.this).show();
|
Miscellaneous.messageBox(getResources().getString(R.string.actionDataConnection), getResources().getString(R.string.rootExplanation), ActivityManageRule.this).show();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.speakText.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.speakText.toString()))
|
||||||
{
|
{
|
||||||
//launch other activity to enter a url and parameters;
|
//launch other activity to enter a url and parameters;
|
||||||
newAction.setAction(Action_Enum.speakText);
|
newAction.setAction(Action_Enum.speakText);
|
||||||
@ -2393,9 +2393,9 @@ public class ActivityManageRule extends Activity
|
|||||||
Intent editTriggerIntent = new Intent(context, ActivityManageActionSpeakText.class);
|
Intent editTriggerIntent = new Intent(context, ActivityManageActionSpeakText.class);
|
||||||
startActivityForResult(editTriggerIntent, requestCodeActionSpeakTextAdd);
|
startActivityForResult(editTriggerIntent, requestCodeActionSpeakTextAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.sendTextMessage.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.sendTextMessage.toString()))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
|
||||||
{
|
{
|
||||||
//launch other activity to enter parameters;
|
//launch other activity to enter parameters;
|
||||||
newAction.setAction(Action_Enum.sendTextMessage);
|
newAction.setAction(Action_Enum.sendTextMessage);
|
||||||
@ -2404,97 +2404,97 @@ public class ActivityManageRule extends Activity
|
|||||||
startActivityForResult(editTriggerIntent, requestCodeActionSendTextMessageAdd);
|
startActivityForResult(editTriggerIntent, requestCodeActionSendTextMessageAdd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.playMusic.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.playMusic.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.playMusic);
|
newAction.setAction(Action_Enum.playMusic);
|
||||||
ruleToEdit.getActionSet().add(newAction);
|
ruleToEdit.getActionSet().add(newAction);
|
||||||
refreshActionList();
|
refreshActionList();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.vibrate.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.vibrate.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.vibrate);
|
newAction.setAction(Action_Enum.vibrate);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionVibrate.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionVibrate.class);
|
||||||
startActivityForResult(intent, requestCodeActionVibrateAdd);
|
startActivityForResult(intent, requestCodeActionVibrateAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.sendBroadcast.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.sendBroadcast.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.sendBroadcast);
|
newAction.setAction(Action_Enum.sendBroadcast);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionSendBroadcast.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionSendBroadcast.class);
|
||||||
startActivityForResult(intent, requestCodeActionSendBroadcastAdd);
|
startActivityForResult(intent, requestCodeActionSendBroadcastAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.runExecutable.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.runExecutable.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.runExecutable);
|
newAction.setAction(Action_Enum.runExecutable);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionRunExecutable.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionRunExecutable.class);
|
||||||
startActivityForResult(intent, requestCodeActionRunExecutableAdd);
|
startActivityForResult(intent, requestCodeActionRunExecutableAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.startPhoneCall.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.startPhoneCall.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.startPhoneCall);
|
newAction.setAction(Action_Enum.startPhoneCall);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionMakePhoneCall.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionMakePhoneCall.class);
|
||||||
startActivityForResult(intent, requestCodeActionMakePhoneCallAdd);
|
startActivityForResult(intent, requestCodeActionMakePhoneCallAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setVariable.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setVariable.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setVariable);
|
newAction.setAction(Action_Enum.setVariable);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionSetVariable.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionSetVariable.class);
|
||||||
startActivityForResult(intent, requestCodeActionSetVariableAdd);
|
startActivityForResult(intent, requestCodeActionSetVariableAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.stopPhoneCall.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.stopPhoneCall.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.stopPhoneCall);
|
newAction.setAction(Action_Enum.stopPhoneCall);
|
||||||
ruleToEdit.getActionSet().add(newAction);
|
ruleToEdit.getActionSet().add(newAction);
|
||||||
refreshActionList();
|
refreshActionList();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.wakelock.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.wakelock.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.wakelock);
|
newAction.setAction(Action_Enum.wakelock);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionWakeLock.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionWakeLock.class);
|
||||||
startActivityForResult(intent, requestCodeActionWakeLockAdd);
|
startActivityForResult(intent, requestCodeActionWakeLockAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.controlMediaPlayback.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.controlMediaPlayback.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.controlMediaPlayback);
|
newAction.setAction(Action_Enum.controlMediaPlayback);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionControlMedia.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionControlMedia.class);
|
||||||
startActivityForResult(intent, requestCodeActionControlMediaAdd);
|
startActivityForResult(intent, requestCodeActionControlMediaAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.createNotification.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.createNotification.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.createNotification);
|
newAction.setAction(Action_Enum.createNotification);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
|
||||||
startActivityForResult(intent, requestCodeActionCreateNotificationAdd);
|
startActivityForResult(intent, requestCodeActionCreateNotificationAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.closeNotification.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.closeNotification.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.closeNotification);
|
newAction.setAction(Action_Enum.closeNotification);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCloseNotification.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCloseNotification.class);
|
||||||
startActivityForResult(intent, requestCodeActionCloseNotificationAdd);
|
startActivityForResult(intent, requestCodeActionCloseNotificationAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setScreenBrightness.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setScreenBrightness.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setScreenBrightness);
|
newAction.setAction(Action_Enum.setScreenBrightness);
|
||||||
Intent actionScreenBrightnessIntent = new Intent(context, ActivityManageActionBrightnessSetting.class);
|
Intent actionScreenBrightnessIntent = new Intent(context, ActivityManageActionBrightnessSetting.class);
|
||||||
startActivityForResult(actionScreenBrightnessIntent, requestCodeActionScreenBrightnessAdd);
|
startActivityForResult(actionScreenBrightnessIntent, requestCodeActionScreenBrightnessAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.playSound.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.playSound.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.playSound);
|
newAction.setAction(Action_Enum.playSound);
|
||||||
Intent actionPlaySoundIntent = new Intent(context, ActivityManageActionPlaySound.class);
|
Intent actionPlaySoundIntent = new Intent(context, ActivityManageActionPlaySound.class);
|
||||||
startActivityForResult(actionPlaySoundIntent, requestCodeActionPlaySoundAdd);
|
startActivityForResult(actionPlaySoundIntent, requestCodeActionPlaySoundAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.copyToClipboard.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.copyToClipboard.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.copyToClipboard);
|
newAction.setAction(Action_Enum.copyToClipboard);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCopyToClipboard.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCopyToClipboard.class);
|
||||||
startActivityForResult(intent, requestCodeActionCopyTextToClipboardAdd);
|
startActivityForResult(intent, requestCodeActionCopyTextToClipboardAdd);
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.takeScreenshot.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.takeScreenshot.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.takeScreenshot);
|
newAction.setAction(Action_Enum.takeScreenshot);
|
||||||
ruleToEdit.getActionSet().add(newAction);
|
ruleToEdit.getActionSet().add(newAction);
|
||||||
refreshActionList();
|
refreshActionList();
|
||||||
}
|
}
|
||||||
else if(actionTypes[which].toString().equals(Action_Enum.setLocationService.toString()))
|
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setLocationService.toString()))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setLocationService);
|
newAction.setAction(Action_Enum.setLocationService);
|
||||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionLocationService.class);
|
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionLocationService.class);
|
||||||
|
@ -15,6 +15,7 @@ import android.os.Bundle;
|
|||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
@ -73,7 +74,7 @@ public class ActivityManageTriggerWifi extends Activity
|
|||||||
if(
|
if(
|
||||||
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
||||||
&&
|
&&
|
||||||
!ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
!ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||||
)
|
)
|
||||||
tvWifiTriggerNameLocationNotice.setVisibility(View.VISIBLE);
|
tvWifiTriggerNameLocationNotice.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@ import android.content.DialogInterface;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.PermissionInfo;
|
|
||||||
import android.content.pm.ServiceInfo;
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -29,6 +27,8 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import com.jens.automation2.receivers.NotificationListener;
|
import com.jens.automation2.receivers.NotificationListener;
|
||||||
|
|
||||||
|
import org.w3c.dom.DOMImplementationSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -579,7 +579,7 @@ public class ActivityPermissions extends Activity
|
|||||||
(
|
(
|
||||||
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
||||||
&&
|
&&
|
||||||
isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||||
)
|
)
|
||||||
||
|
||
|
||||||
Build.VERSION.SDK_INT >= 33
|
Build.VERSION.SDK_INT >= 33
|
||||||
@ -611,6 +611,12 @@ public class ActivityPermissions extends Activity
|
|||||||
if(targetProfile.changeIncomingCallsRingtone || targetProfile.changeNotificationRingtone)
|
if(targetProfile.changeIncomingCallsRingtone || targetProfile.changeNotificationRingtone)
|
||||||
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
|
||||||
break;
|
break;
|
||||||
|
case disableScreenRotation:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
break;
|
||||||
|
case enableScreenRotation:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
break;
|
||||||
case playMusic:
|
case playMusic:
|
||||||
break;
|
break;
|
||||||
case controlMediaPlayback:
|
case controlMediaPlayback:
|
||||||
@ -713,12 +719,40 @@ public class ActivityPermissions extends Activity
|
|||||||
addToArrayListUnique(Manifest.permission.INTERNET, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.INTERNET, requiredPermissions);
|
||||||
getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
|
getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
|
||||||
break;
|
break;
|
||||||
|
case turnBluetoothOff:
|
||||||
|
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.BLUETOOTH, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
|
case turnBluetoothOn:
|
||||||
|
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.BLUETOOTH, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
case turnUsbTetheringOff:
|
case turnUsbTetheringOff:
|
||||||
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
break;
|
break;
|
||||||
case turnUsbTetheringOn:
|
case turnUsbTetheringOn:
|
||||||
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
break;
|
break;
|
||||||
|
case turnWifiOff:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
|
case turnWifiOn:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
|
case turnWifiTetheringOff:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
|
case turnWifiTetheringOn:
|
||||||
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
|
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||||
|
break;
|
||||||
case waitBeforeNextAction:
|
case waitBeforeNextAction:
|
||||||
break;
|
break;
|
||||||
case playSound:
|
case playSound:
|
||||||
@ -864,6 +898,18 @@ 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));
|
||||||
for(String ruleName : getRulesUsing(Action.Action_Enum.setWifiTethering))
|
for(String ruleName : getRulesUsing(Action.Action_Enum.setWifiTethering))
|
||||||
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.turnBluetoothOff))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnBluetoothOn))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnWifiOff))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnWifiOn))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnWifiTetheringOff))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnWifiTetheringOn))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
break;
|
break;
|
||||||
case Manifest.permission.ACCESS_WIFI_STATE:
|
case Manifest.permission.ACCESS_WIFI_STATE:
|
||||||
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.pointOfInterest))
|
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.pointOfInterest))
|
||||||
@ -876,12 +922,20 @@ 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));
|
||||||
for(String ruleName : getRulesUsing(Action.Action_Enum.setBluetooth))
|
for(String ruleName : getRulesUsing(Action.Action_Enum.setBluetooth))
|
||||||
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.turnBluetoothOff))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnBluetoothOn))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
break;
|
break;
|
||||||
case Manifest.permission.BLUETOOTH:
|
case Manifest.permission.BLUETOOTH:
|
||||||
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))
|
||||||
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.turnBluetoothOff))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnBluetoothOn))
|
||||||
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
break;
|
break;
|
||||||
case Manifest.permission.GET_TASKS:
|
case Manifest.permission.GET_TASKS:
|
||||||
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.process_started_stopped))
|
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.process_started_stopped))
|
||||||
@ -1075,14 +1129,14 @@ public class ActivityPermissions extends Activity
|
|||||||
{
|
{
|
||||||
if(permissionNames.equals(Manifest.permission.PROCESS_OUTGOING_CALLS))
|
if(permissionNames.equals(Manifest.permission.PROCESS_OUTGOING_CALLS))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.PROCESS_OUTGOING_CALLS) && !Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext()))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.PROCESS_OUTGOING_CALLS) && !Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext()))
|
||||||
{
|
{
|
||||||
permissionList.add(permission);
|
permissionList.add(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(permissionNames.equals(Manifest.permission.SEND_SMS))
|
else if(permissionNames.equals(Manifest.permission.SEND_SMS))
|
||||||
{
|
{
|
||||||
if(ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS) && !Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext()))
|
if(ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS) && !Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext()))
|
||||||
{
|
{
|
||||||
permissionList.add(permission);
|
permissionList.add(permission);
|
||||||
}
|
}
|
||||||
@ -1251,7 +1305,7 @@ public class ActivityPermissions extends Activity
|
|||||||
{
|
{
|
||||||
if(requiredPermissions.contains(Manifest.permission.PROCESS_OUTGOING_CALLS))
|
if(requiredPermissions.contains(Manifest.permission.PROCESS_OUTGOING_CALLS))
|
||||||
{
|
{
|
||||||
if(!ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS)
|
if(!ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS)
|
||||||
&&
|
&&
|
||||||
Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext())
|
Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext())
|
||||||
)
|
)
|
||||||
@ -1262,7 +1316,7 @@ public class ActivityPermissions extends Activity
|
|||||||
}
|
}
|
||||||
if(requiredPermissions.contains(Manifest.permission.SEND_SMS))
|
if(requiredPermissions.contains(Manifest.permission.SEND_SMS))
|
||||||
{
|
{
|
||||||
if(!ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS)
|
if(!ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
requiredPermissions.remove(Manifest.permission.SEND_SMS);
|
requiredPermissions.remove(Manifest.permission.SEND_SMS);
|
||||||
@ -1632,53 +1686,12 @@ public class ActivityPermissions extends Activity
|
|||||||
mapActionPermissions.put("wakeupDevice", Manifest.permission.WAKE_LOCK);
|
mapActionPermissions.put("wakeupDevice", Manifest.permission.WAKE_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isServiceAvailable(Context context, String serviceName)
|
public static boolean isPermissionDeclaratedInManifest(Context context, String permission)
|
||||||
{
|
|
||||||
/*int flags = PackageManager.GET_ACTIVITIES
|
|
||||||
| PackageManager.GET_CONFIGURATIONS
|
|
||||||
| PackageManager.GET_DISABLED_COMPONENTS
|
|
||||||
| PackageManager.GET_GIDS | PackageManager.GET_INSTRUMENTATION
|
|
||||||
| PackageManager.GET_INTENT_FILTERS
|
|
||||||
| PackageManager.GET_PERMISSIONS | PackageManager.GET_PROVIDERS
|
|
||||||
| PackageManager.GET_RECEIVERS | PackageManager.GET_SERVICES
|
|
||||||
| PackageManager.GET_SIGNATURES;
|
|
||||||
PackageManager packageManager = getPackageManager();
|
|
||||||
List<PackageInfo> installedPackages = packageManager.getInstalledPackages(flags);
|
|
||||||
for (PackageInfo packageInfo : installedPackages)
|
|
||||||
{
|
|
||||||
ServiceInfo[] services = packageInfo.services;
|
|
||||||
PermissionInfo[] permissions = packageInfo.permissions;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PackageManager packageManager = context.getPackageManager();
|
|
||||||
PackageInfo packageInfo = packageManager.getPackageInfo("com.jens.automation2", PackageManager.GET_SERVICES);
|
|
||||||
ServiceInfo[] services = packageInfo.services;
|
|
||||||
for (ServiceInfo serviceInfo : services)
|
|
||||||
{
|
|
||||||
if(serviceInfo.name.endsWith(serviceName))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
PermissionInfo[] permissions = packageInfo.permissions;
|
|
||||||
}
|
|
||||||
catch (PackageManager.NameNotFoundException e)
|
|
||||||
{
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isPermissionDeclaredInManifest(Context context, String permission)
|
|
||||||
{
|
{
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PackageInfo packageInfo = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
|
PackageInfo packageInfo = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
|
||||||
|
|
||||||
String[] requestedPermissions = null;
|
String[] requestedPermissions = null;
|
||||||
if (packageInfo != null)
|
if (packageInfo != null)
|
||||||
{
|
{
|
||||||
|
@ -322,7 +322,7 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
|
|
||||||
DateTimeListener.setOrResetAlarms();
|
DateTimeListener.setOrResetAlarms();
|
||||||
|
|
||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaredInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||||
CalendarReceiver.armOrRearmTimer();
|
CalendarReceiver.armOrRearmTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,20 +392,6 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
r.activate(AutomationService.this, false);
|
r.activate(AutomationService.this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Settings.hasBeenDone(Settings.constVersion143StartOtherProgramConfigEditHint))
|
|
||||||
{
|
|
||||||
if(Rule.isAnyRuleUsing(Action.Action_Enum.startOtherActivity))
|
|
||||||
{
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
|
|
||||||
Miscellaneous.createDismissibleNotificationWithDelay(1010, null, getResources().getString(R.string.version143StartOtherActivityHint), 9123, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, null);
|
|
||||||
else
|
|
||||||
Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.version143StartOtherActivityHint), 9123, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings.considerDone(Settings.constVersion143StartOtherProgramConfigEditHint);
|
|
||||||
Settings.writeSettings(Miscellaneous.getAnyContext());
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings.serviceStartDone = true;
|
Settings.serviceStartDone = true;
|
||||||
Settings.deviceStartDone = true;
|
Settings.deviceStartDone = true;
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ public class ReceiverCoordinator
|
|||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
||||||
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
||||||
|
|
||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaredInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||||
CalendarReceiver.startCalendarReceiver(AutomationService.getInstance());
|
CalendarReceiver.startCalendarReceiver(AutomationService.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ public class ReceiverCoordinator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaredInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||||
{
|
{
|
||||||
if(!CalendarReceiver.getInstance().isListenerRunning())
|
if(!CalendarReceiver.getInstance().isListenerRunning())
|
||||||
CalendarReceiver.getInstance().startListener(AutomationService.getInstance());
|
CalendarReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||||
|
@ -19,9 +19,8 @@ public class Settings implements SharedPreferences
|
|||||||
public static final String folderName = "Automation";
|
public static final String folderName = "Automation";
|
||||||
public static final String zipFileName = "automation.zip";
|
public static final String zipFileName = "automation.zip";
|
||||||
|
|
||||||
public static final String constNewsOptInDone = "newsOptInDone";
|
public static final String constNewsOptInDone ="newsOptInDone";
|
||||||
public static final String constNotificationChannelCleanupApk118 = "notificationChannelCleanupApk118";
|
public static final String constNotificationChannelCleanupApk118 ="notificationChannelCleanupApk118";
|
||||||
public static final String constVersion143StartOtherProgramConfigEditHint = "constVersion143StartOtherProgramConfigEditHint";
|
|
||||||
|
|
||||||
public static long minimumDistanceChangeForGpsUpdate;
|
public static long minimumDistanceChangeForGpsUpdate;
|
||||||
public static long minimumDistanceChangeForNetworkUpdate;
|
public static long minimumDistanceChangeForNetworkUpdate;
|
||||||
|
@ -1665,7 +1665,7 @@ public class Trigger
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class testClass = Class.forName(ActivityManageRule.activityDetectionClassPath);
|
Class testClass = Class.forName(ActivityManageRule.activityDetectionClassPath);
|
||||||
if (ActivityPermissions.isPermissionDeclaredInManifest(Miscellaneous.getAnyContext(), "com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
|
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.
|
// This type doesn't have an activate/deactivate equivalent, at least not yet.
|
||||||
returnString.append(Miscellaneous.runMethodReflective(ActivityManageRule.activityDetectionClassPath, "getDescription", new Object[]{getActivityDetectionType()}));
|
returnString.append(Miscellaneous.runMethodReflective(ActivityManageRule.activityDetectionClassPath, "getDescription", new Object[]{getActivityDetectionType()}));
|
||||||
|
@ -1135,10 +1135,28 @@ public class XmlFileInterface
|
|||||||
|
|
||||||
// *** deprecated
|
// *** deprecated
|
||||||
//else
|
//else
|
||||||
if(actionNameString.equals("turnUsbTetheringOn"))
|
if(actionNameString.equals("turnWifiOn"))
|
||||||
|
newAction.setAction(Action_Enum.turnWifiOn);
|
||||||
|
else if(actionNameString.equals("turnWifiOff"))
|
||||||
|
newAction.setAction(Action_Enum.turnWifiOff);
|
||||||
|
else if(actionNameString.equals("turnBluetoothOn"))
|
||||||
|
newAction.setAction(Action_Enum.turnBluetoothOn);
|
||||||
|
else if(actionNameString.equals("turnBluetoothOff"))
|
||||||
|
newAction.setAction(Action_Enum.turnBluetoothOff);
|
||||||
|
else if(actionNameString.equals("turnUsbTetheringOn"))
|
||||||
newAction.setAction(Action_Enum.turnUsbTetheringOn);
|
newAction.setAction(Action_Enum.turnUsbTetheringOn);
|
||||||
else if(actionNameString.equals("turnUsbTetheringOff"))
|
else if(actionNameString.equals("turnUsbTetheringOff"))
|
||||||
newAction.setAction(Action_Enum.turnUsbTetheringOff);
|
newAction.setAction(Action_Enum.turnUsbTetheringOff);
|
||||||
|
else if(actionNameString.equals("turnWifiTetheringOn"))
|
||||||
|
newAction.setAction(Action_Enum.turnWifiTetheringOn);
|
||||||
|
else if(actionNameString.equals("turnWifiTetheringOff"))
|
||||||
|
newAction.setAction(Action_Enum.turnWifiTetheringOff);
|
||||||
|
else if(actionNameString.equals("enableScreenRotation"))
|
||||||
|
newAction.setAction(Action_Enum.enableScreenRotation);
|
||||||
|
else if(actionNameString.equals("disableScreenRotation"))
|
||||||
|
newAction.setAction(Action_Enum.disableScreenRotation);
|
||||||
|
else if(actionNameString.equals("disableScreenRotation"))
|
||||||
|
newAction.setAction(Action_Enum.disableScreenRotation);
|
||||||
else if(actionNameString.equals("playMusic"))
|
else if(actionNameString.equals("playMusic"))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.controlMediaPlayback);
|
newAction.setAction(Action_Enum.controlMediaPlayback);
|
||||||
@ -1157,7 +1175,31 @@ public class XmlFileInterface
|
|||||||
else if (name.equals("ActionParameter1"))
|
else if (name.equals("ActionParameter1"))
|
||||||
{
|
{
|
||||||
// exclusion for deprecated types
|
// exclusion for deprecated types
|
||||||
if(newAction.getAction().equals(Action_Enum.turnUsbTetheringOn))
|
if(newAction.getAction().equals(Action_Enum.turnWifiOn))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setWifi);
|
||||||
|
newAction.setParameter1(true);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnWifiOff))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setWifi);
|
||||||
|
newAction.setParameter1(false);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnBluetoothOn))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setBluetooth);
|
||||||
|
newAction.setParameter1(true);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnBluetoothOff))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setBluetooth);
|
||||||
|
newAction.setParameter1(false);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnUsbTetheringOn))
|
||||||
{
|
{
|
||||||
newAction.setAction(Action_Enum.setUsbTethering);
|
newAction.setAction(Action_Enum.setUsbTethering);
|
||||||
newAction.setParameter1(true);
|
newAction.setParameter1(true);
|
||||||
@ -1169,6 +1211,36 @@ public class XmlFileInterface
|
|||||||
newAction.setParameter1(false);
|
newAction.setParameter1(false);
|
||||||
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
}
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnWifiTetheringOn))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setWifiTethering);
|
||||||
|
newAction.setParameter1(true);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.turnWifiTetheringOff))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setWifiTethering);
|
||||||
|
newAction.setParameter1(false);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.enableScreenRotation))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setDisplayRotation);
|
||||||
|
newAction.setParameter1(true);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.disableScreenRotation))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setDisplayRotation);
|
||||||
|
newAction.setParameter1(false);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
|
else if(newAction.getAction().equals(Action_Enum.disableScreenRotation))
|
||||||
|
{
|
||||||
|
newAction.setAction(Action_Enum.setDisplayRotation);
|
||||||
|
newAction.setParameter1(false);
|
||||||
|
readTag(parser, "ActionParameter1"); //read the tag for the parser to head on
|
||||||
|
}
|
||||||
else if(newAction.getAction().equals(Action_Enum.turnScreenOnOrOff) && newAction.getParameter1())
|
else if(newAction.getAction().equals(Action_Enum.turnScreenOnOrOff) && newAction.getParameter1())
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -78,7 +78,7 @@ public class CellLocationChangedReceiver extends PhoneStateListener
|
|||||||
{
|
{
|
||||||
for(Action action : Rule.getLastActivatedRule().getActionSet())
|
for(Action action : Rule.getLastActivatedRule().getActionSet())
|
||||||
{
|
{
|
||||||
if(action.getAction() == Action.Action_Enum.setWifi && action.getParameter1())
|
if(action.getAction() == Action.Action_Enum.turnWifiOn)
|
||||||
{
|
{
|
||||||
// we will be using wifiReceiver, deactivate AccelerometerTimer if applicable
|
// we will be using wifiReceiver, deactivate AccelerometerTimer if applicable
|
||||||
SensorActivity.stopAccelerometerTimer();
|
SensorActivity.stopAccelerometerTimer();
|
||||||
@ -88,7 +88,7 @@ public class CellLocationChangedReceiver extends PhoneStateListener
|
|||||||
catch(NullPointerException ne)
|
catch(NullPointerException ne)
|
||||||
{
|
{
|
||||||
// Nothing to do, there is no last activated rule. Wifi hasn't been activated so we don't
|
// Nothing to do, there is no last activated rule. Wifi hasn't been activated so we don't
|
||||||
// deactivate accelerometer receiver.
|
// deactive accelerometer receiver.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,46 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_margin="@dimen/default_margin"
|
android:layout_weight="30"
|
||||||
android:layout_weight="30">
|
android:layout_margin="@dimen/default_margin" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvRuleTitle"
|
android:id="@+id/tvRuleTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/start"
|
android:text="@string/start"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<TimePicker
|
<TimePicker
|
||||||
android:id="@+id/tpTimeFrameStart"
|
android:id="@+id/tpTimeFrameStart"
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLastRule"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/end"
|
android:text="@string/end"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<TimePicker
|
<TimePicker
|
||||||
android:id="@+id/tpTimeFrameStop"
|
android:id="@+id/tpTimeFrameStop"
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="#aa000000" />
|
android:background="#aa000000" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView2"
|
android:id="@+id/textView2"
|
||||||
@ -49,22 +47,22 @@
|
|||||||
android:text="@string/insideOrOutsideTimeFrames"
|
android:text="@string/insideOrOutsideTimeFrames"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/radioTimeFrameEntering"
|
android:id="@+id/radioTimeFrameEntering"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:text="@string/entering" />
|
android:text="@string/entering" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/radioTimeFrameLeaving"
|
android:id="@+id/radioTimeFrameLeaving"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/leaving" />
|
android:text="@string/leaving" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -82,52 +80,52 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvDaysHint"
|
android:id="@+id/tvDaysHint"
|
||||||
|
android:layout_marginVertical="@dimen/default_margin"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="@dimen/default_margin"
|
|
||||||
android:textColor="@color/red" />
|
android:textColor="@color/red" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkMonday"
|
android:id="@+id/checkMonday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/monday" />
|
android:text="@string/monday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkTuesday"
|
android:id="@+id/checkTuesday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/tuesday" />
|
android:text="@string/tuesday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkWednesday"
|
android:id="@+id/checkWednesday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/wednesday" />
|
android:text="@string/wednesday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkThursday"
|
android:id="@+id/checkThursday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/thursday" />
|
android:text="@string/thursday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkFriday"
|
android:id="@+id/checkFriday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/friday" />
|
android:text="@string/friday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkSaturday"
|
android:id="@+id/checkSaturday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/saturday" />
|
android:text="@string/saturday" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkSunday"
|
android:id="@+id/checkSunday"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/sunday" />
|
android:text="@string/sunday" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -138,7 +136,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/chkRepeat"
|
android:id="@+id/chkRepeat"
|
||||||
@ -148,21 +146,21 @@
|
|||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/etRepeatEvery"
|
android:id="@+id/etRepeatEvery"
|
||||||
|
android:layout_marginLeft="@dimen/default_margin"
|
||||||
|
android:minWidth="75dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/default_margin"
|
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:inputType="numberSigned"
|
android:inputType="numberSigned" />
|
||||||
android:minWidth="75dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bSaveTimeFrame"
|
android:id="@+id/bSaveTimeFrame"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:text="@string/save" />
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/save" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@
|
|||||||
<string name="brightnessAuto">automatic brightness</string>
|
<string name="brightnessAuto">automatic brightness</string>
|
||||||
<string name="brightnessManual">manual brightness</string>
|
<string name="brightnessManual">manual brightness</string>
|
||||||
<string name="autoBrightnessNotice">If you use auto brightness the brightness value you use below will probably not be used long.</string>
|
<string name="autoBrightnessNotice">If you use auto brightness the brightness value you use below will probably not be used long.</string>
|
||||||
<string name="screenLockSoundNotice">Screen lock sounds cannot automatically be changed anymore on devices running Android version 6.0 or higher. Whatever you set here, it will not work in either direction.</string>
|
<string name="screenLockSoundNotice">Screenlock sounds cannot automatically be changed anymore on devices running Android version 6.0 or higher. Whatever you set here, it will not work in either direction.</string>
|
||||||
<string name="startScreen">Start screen</string>
|
<string name="startScreen">Start screen</string>
|
||||||
<string name="startScreenSummary">Select the screen the applications opens with at start.</string>
|
<string name="startScreenSummary">Select the screen the applications opens with at start.</string>
|
||||||
<string name="executeRulesAndProfilesWithSingleClickTitle">Run rules/profiles with single click.</string>
|
<string name="executeRulesAndProfilesWithSingleClickTitle">Run rules/profiles with single click.</string>
|
||||||
@ -947,6 +947,4 @@
|
|||||||
<string name="notCharging">not charging</string>
|
<string name="notCharging">not charging</string>
|
||||||
<string name="triggerChargingComment">The type will only be evaluated if the device is charging. If not charging is chosen, it will fire at any previous charging type. If you want to evaluate that, consider using the variables trigger/action.</string>
|
<string name="triggerChargingComment">The type will only be evaluated if the device is charging. If not charging is chosen, it will fire at any previous charging type. If you want to evaluate that, consider using the variables trigger/action.</string>
|
||||||
<string name="helpTextProfiles">A profile is a collection of settings for ringtones, volumes and other audio related settings that you can have applied from rules or apply it manually.\n\nIt is also possible to query for the last activated profile as a trigger. In the normal case it will only query if the profile was the last activated one (regardless if specific audio settings have been changed in the meantime). But you can also have the individual settings compared.</string>
|
<string name="helpTextProfiles">A profile is a collection of settings for ringtones, volumes and other audio related settings that you can have applied from rules or apply it manually.\n\nIt is also possible to query for the last activated profile as a trigger. In the normal case it will only query if the profile was the last activated one (regardless if specific audio settings have been changed in the meantime). But you can also have the individual settings compared.</string>
|
||||||
<string name="version143StartOtherActivityHint">In version 1.8.2 it was necessary to revise the way actions to start other programs were saved. Compatibility could not be ensured. Please check and edit your start other activity actions to make sure they are still working.</string>
|
|
||||||
<string name="importChooseFolderNotice">In the following dialog do not try to select specific files, but choose the folder in which the Automation backup files reside. If the choose button is disabled, you have found an Android limitation. In that case try moving the files to a subdirectory first.</string>
|
|
||||||
</resources>
|
</resources>
|
@ -1,2 +0,0 @@
|
|||||||
* Fixed: Start other program action revised, editing of your actions may be necessary to continue working
|
|
||||||
* Fixed: Action type menu would in some cases pick up another action than selected
|
|
Loading…
Reference in New Issue
Block a user