Compare commits

...

20 Commits

Author SHA1 Message Date
074f75ed20 permission for play sound 2021-11-03 15:25:21 +01:00
d988e1f43d permission for play sound 2021-11-03 15:15:26 +01:00
23502f52bb permission for play sound 2021-11-03 15:15:06 +01:00
9a6083247f permission for play sound 2021-10-31 13:27:45 +01:00
ba2a340bdf permission for play sound 2021-10-28 17:58:55 +02:00
9e2f7c16f6 vibrateWhenRinging 2021-10-09 02:19:34 +02:00
d042b3f35a Translations 2021-10-04 20:18:09 +02:00
220d2d316e Fix in data switch 2021-10-03 21:38:33 +02:00
4aa095e801 Fix in data switch 2021-10-03 21:20:47 +02:00
b5bd332ff5 data with root 2021-10-03 15:09:07 +02:00
969937f8a0 vibrate for calls 2021-09-27 20:12:40 +02:00
e3598cc475 DND 2021-09-26 19:54:17 +02:00
e63d97be0c DND 2021-09-26 13:58:48 +02:00
e60fb1535a bugspray 2021-09-25 02:03:44 +02:00
8563234db3 bugspray 2021-09-24 19:15:41 +02:00
448942e4e8 bugspray 2021-09-20 19:58:11 +02:00
dcdb770d9f bugspray 2021-09-15 21:58:18 +02:00
b5040cedb3 var replacement 2021-09-14 17:56:45 +02:00
423839fa43 Sound settings 2021-09-12 20:05:12 +02:00
a6edab75ce Location without Cell Radio 2021-09-07 17:30:45 +02:00
25 changed files with 765 additions and 292 deletions

View File

@ -12,6 +12,6 @@
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2021-08-14T11:41:28.444891400Z" />
<timeTargetWasSelectedWithDropDown value="2021-09-24T23:07:53.935197300Z" />
</component>
</project>

View File

@ -11,8 +11,8 @@ android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
useLibrary 'org.apache.http.legacy'
versionCode 112
versionName "1.6.42"
versionCode 113
versionName "1.6.43"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -41,7 +41,7 @@ android {
{
dimension "version"
versionNameSuffix "-googlePlay"
targetSdkVersion 29
targetSdkVersion 30
}
fdroidFlavor

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 112,
"versionName": "1.6.42-googlePlay",
"versionCode": 113,
"versionName": "1.6.43-googlePlay",
"outputFile": "app-googlePlayFlavor-release.apk"
}
],

View File

@ -365,7 +365,7 @@ public class Action
Actions.setUsbTethering(context, getParameter1(), toggleActionIfPossible);
break;
case setWifi:
Actions.setWifi(context, getParameter1(), toggleActionIfPossible);
Actions.WifiStuff.setWifi(context, getParameter1(), toggleActionIfPossible);
break;
case setWifiTethering:
Actions.setWifiTethering(context, getParameter1(), toggleActionIfPossible);
@ -381,7 +381,7 @@ public class Action
break;
case wakeupDevice:
Actions.wakeupDevice(Long.parseLong(this.getParameter2()));
// wakeupDevice() will create a seperate thread. That'll take some time, we wait 100ms.
// wakeupDevice() will create a separate thread. That'll take some time, we wait 100ms.
try
{
Thread.sleep(100);

View File

@ -3,6 +3,7 @@ package com.jens.automation2;
import android.Manifest;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.content.ActivityNotFoundException;
@ -23,10 +24,11 @@ import android.telephony.SmsManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import com.jens.automation2.actions.wifi_router.MyOnStartTetheringCallback;
import com.jens.automation2.actions.wifi_router.MyOreoWifiManager;
import com.jens.automation2.location.WifiBroadcastReceiver;
@ -70,9 +72,45 @@ public class Actions
public static final String wireguard_tunnel_down = "com.wireguard.android.action.SET_TUNNEL_DOWN";
public static final String wireguard_tunnel_refresh = "com.wireguard.android.action.REFRESH_TUNNEL_STATES";
public static class WifiStuff
{
public static Boolean setWifi(Context context, Boolean desiredState, boolean toggleActionIfPossible)
{
Miscellaneous.logEvent("i", "Wifi", "Changing Wifi to " + String.valueOf(desiredState), 4);
if(context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q)
return setWifiWithRoot(context, desiredState, toggleActionIfPossible);
else
return setWifiOldFashioned(context, desiredState, toggleActionIfPossible);
}
public static Boolean setWifiWithRoot(Context context, Boolean desiredState, boolean toggleActionIfPossible)
{
Miscellaneous.logEvent("i", "Wifi", "Changing wifi to " + String.valueOf(desiredState) + ", but with root permissions.", 4);
String command = null;
int state = 0;
String desiredStateString;
if(desiredState)
desiredStateString = "enable";
else
desiredStateString = "disable";
try
{
command = "svc wifi " + desiredStateString;
Miscellaneous.logEvent("i", "setWifiWithRoot()", "Running command as root: " + command.toString(), 5);
return executeCommandViaSu(new String[]{command});
}
catch (Exception e)
{
// Oops! Something went wrong, so we throw the exception here.
throw e;
}
}
public static Boolean setWifiOldFashioned(Context context, Boolean desiredState, boolean toggleActionIfPossible)
{
Miscellaneous.logEvent("i", "Wifi", "Changing wifi to " + String.valueOf(desiredState), 4);
if (desiredState && Settings.useWifiForPositioning)
WifiBroadcastReceiver.startWifiReceiver(autoMationServerRef.getLocationProvider());
@ -113,6 +151,7 @@ public class Actions
return true;
}
}
public static void setDisplayRotation(Context myContext, Boolean desiredState, boolean toggleActionIfPossible)
{
@ -459,12 +498,53 @@ public class Actions
return false;
}
public static void setSound(Context context, int soundSetting)
@RequiresApi(api = Build.VERSION_CODES.M)
public static void setDoNotDisturb(Context context, int desiredSetting)
{
Miscellaneous.logEvent("i", context.getResources().getString(R.string.soundSettings), "Changing sound to " + String.valueOf(soundSetting), 4);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// Check if the notification policy access has been granted for the app.
/* if (!notificationManager.isNotificationPolicyAccessGranted())
{
Intent intent = new Intent(android.provider.Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
startActivity(intent);
return;
}*/
notificationManager.setInterruptionFilter(desiredSetting);
/*if (notificationManager.getCurrentInterruptionFilter() == NotificationManager.INTERRUPTION_FILTER_ALL)
{
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_NONE);
}
else
{
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALL);
}*/
}
@RequiresApi(api = Build.VERSION_CODES.M)
public static boolean isDoNotDisturbActive(Context context)
{
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
int result = notificationManager.getCurrentInterruptionFilter();
return (notificationManager.getCurrentInterruptionFilter() != NotificationManager.INTERRUPTION_FILTER_ALL);
}
public static void setSound(Context context, int desiredSoundSetting)
{
Miscellaneous.logEvent("i", context.getResources().getString(R.string.soundSettings), "Changing sound to " + String.valueOf(desiredSoundSetting), 4);
AudioManager myAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
myAudioManager.setRingerMode(soundSetting);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && desiredSoundSetting == AudioManager.RINGER_MODE_SILENT)
{
AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE);
am.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0, AudioManager.FLAG_PLAY_SOUND);
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
}
else
myAudioManager.setRingerMode(desiredSoundSetting);
}
private static String getIPAddressUsb(final boolean useIPv4)
@ -577,6 +657,18 @@ public class Actions
}
}
public static void setDND(Context context, int desiredDndMode)
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
{
Miscellaneous.logEvent("i", context.getResources().getString(R.string.soundSettings), "Changing DND to " + String.valueOf(desiredDndMode), 4);
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.setInterruptionFilter(desiredDndMode);
}
else
Miscellaneous.logEvent("w", context.getResources().getString(R.string.soundSettings), "Cannot change DND to " + String.valueOf(desiredDndMode) + ". This Android version is too and doesn\'t have that feature, yet.", 4);
}
public void useDownloadedWebpage(String result)
{
// Toast.makeText(context, "Result: " + result, Toast.LENGTH_LONG).show();
@ -1143,7 +1235,7 @@ public class Actions
desiredState = !isEnabled;
}
if (Build.VERSION.SDK_INT <= 20)
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH)
{
for (Method m : iConnectivityManagerClass.getDeclaredMethods())
{
@ -1169,15 +1261,13 @@ public class Actions
}
}
protected static boolean setDataConnectionWithRoot(boolean enable)
protected static boolean setDataConnectionWithRoot(boolean desiredState)
{
try
{
int desiredState = 0;
if (enable)
desiredState = 1;
if (MobileDataStuff.setMobileNetworkFromLollipop(desiredState, autoMationServerRef))
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.O_MR1)
{
if(MobileDataStuff.setMobileNetworkFromAndroid9(desiredState, autoMationServerRef))
{
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
return true;
@ -1188,6 +1278,33 @@ public class Actions
return false;
}
}
else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP)
{
if (MobileDataStuff.setMobileNetworkTillAndroid5(desiredState, autoMationServerRef))
{
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
return true;
}
else
{
Miscellaneous.logEvent("e", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootFail), 2);
return false;
}
}
else
{
if (MobileDataStuff.setMobileNetworkAndroid6Till8(desiredState, autoMationServerRef))
{
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
return true;
}
else
{
Miscellaneous.logEvent("e", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootFail), 2);
return false;
}
}
}
catch (Exception e)
{
String rootString;
@ -1202,20 +1319,23 @@ public class Actions
}
@SuppressLint("NewApi")
public static boolean setMobileNetworkFromLollipop(int desiredState, Context context) throws Exception
public static boolean setMobileNetworkAndroid6Till8(boolean desiredState, Context context) throws Exception
{
String command = null;
int state = 0;
try
{
int desiredStateString;
if(desiredState)
desiredStateString = 1;
else
desiredStateString = 0;
// Get the current state of the mobile network.
state = isMobileDataEnabled() ? 0 : 1;
// boolean state = isMobileDataEnabled() ? 0 : 1;
// Get the value of the "TRANSACTION_setDataEnabled" field.
String transactionCode = getTransactionCode(context);
// Android 5.1+ (API 22) and later.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP)
{
SubscriptionManager mSubscriptionManager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
// Loop through the subscription list i.e. SIM list.
for (int i = 0; i < mSubscriptionManager.getActiveSubscriptionInfoCountMax(); i++)
@ -1226,19 +1346,8 @@ public class Actions
int subscriptionId = mSubscriptionManager.getActiveSubscriptionInfoList().get(i).getSubscriptionId();
// Execute the command via `su` to turn off
// mobile network for a subscription service.
command = "service call phone " + transactionCode + " i32 " + subscriptionId + " i32 " + desiredState;
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", "Running command: " + command.toString(), 5);
return executeCommandViaSu(new String[]{command});
}
}
}
else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP)
{
// Android 5.0 (API 21) only.
if (transactionCode != null && transactionCode.length() > 0)
{
// Execute the command via `su` to turn off mobile network.
command = "service call phone " + transactionCode + " i32 " + desiredState;
command = "service call phone " + transactionCode + " i32 " + subscriptionId + " i32 " + desiredStateString;
Miscellaneous.logEvent("i", "setMobileNetworkAndroid6Till8()", "Running command: " + command.toString(), 5);
return executeCommandViaSu(new String[]{command});
}
}
@ -1252,6 +1361,75 @@ public class Actions
return false;
}
@SuppressLint("NewApi")
public static boolean setMobileNetworkTillAndroid5(boolean desiredState, Context context) throws Exception
{
String command = null;
try
{
int desiredStateString;
if(desiredState)
desiredStateString = 1;
else
desiredStateString = 0;
// Get the current state of the mobile network.
// int currentState = isMobileDataEnabled() ? 0 : 1;
// Get the value of the "TRANSACTION_setDataEnabled" field.
String transactionCode = getTransactionCode(context);
// Android 5.0 (API 21) only.
if (transactionCode != null && transactionCode.length() > 0)
{
// Execute the command via `su` to turn off mobile network.
command = "service call phone " + transactionCode + " i32 " + desiredStateString;
Miscellaneous.logEvent("i", "setMobileNetworkTillAndroid5()", "Running command: " + command.toString(), 5);
return executeCommandViaSu(new String[]{command});
}
}
catch (Exception e)
{
// Oops! Something went wrong, so we throw the exception here.
throw e;
}
return false;
}
@SuppressLint("NewApi")
public static boolean setMobileNetworkFromAndroid9(boolean desiredState, Context context) throws Exception
{
String command = null;
String desiredStateString;
if(desiredState)
desiredStateString = "enable";
else
desiredStateString = "disable";
try
{
/*
Android 8.1 is the last version on which the transaction code can be determined
with the below method. From 9.0 on the field TRANSACTION_setDataEnabled does not
exist anymore. Usually it was 83 and we'll just try this number hardcoded.
Alternatively the bottom of this might be an approach:
https://stackoverflow.com/questions/26539445/the-setmobiledataenabled-method-is-no-longer-callable-as-of-android-l-and-later
*/
// Execute the command via `su` to turn off
// mobile network for a subscription service.
command = "svc data " + desiredStateString;
Miscellaneous.logEvent("i", "setMobileNetworkFromAndroid9()", "Running command: " + command.toString(), 5);
return executeCommandViaSu(new String[]{command});
}
catch (Exception e)
{
// Oops! Something went wrong, so we throw the exception here.
throw e;
}
}
@SuppressLint("NewApi")
public static boolean isMobileDataEnabled()
{

View File

@ -29,6 +29,7 @@ import androidx.core.text.HtmlCompat;
import com.jens.automation2.AutomationService.serviceCommands;
import com.jens.automation2.Trigger.Trigger_Enum;
import com.jens.automation2.location.CellLocationChangedReceiver;
import com.jens.automation2.location.LocationProvider;
import java.io.File;

View File

@ -22,6 +22,8 @@ import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
import com.jens.automation2.receivers.ConnectivityReceiver;
import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;
@ -163,7 +165,7 @@ public class ActivityManagePoi extends Activity
locationSearchStart = Calendar.getInstance();
startTimeout();
if(!Settings.privacyLocationing)
if(!Settings.privacyLocationing || !ConnectivityReceiver.isDataConnectionAvailable(AutomationService.getInstance()))
{
Miscellaneous.logEvent("i", "POI Manager", getResources().getString(R.string.logGettingPositionWithProvider) + " " + provider1, 3);
myLocationManager.requestLocationUpdates(provider1, 500, Settings.satisfactoryAccuracyNetwork, myLocationListenerNetwork);

View File

@ -1,6 +1,7 @@
package com.jens.automation2;
import android.app.Activity;
import android.app.NotificationManager;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
@ -37,8 +38,8 @@ public class ActivityManageProfile extends Activity
final static int intentCodeRingtonePickerNotificationsFile = 9020;
final static int intentCodeRingtonePickerNotificationsRingtone = 9021;
CheckBox checkBoxChangeSoundMode, checkBoxChangeVolumeMusicVideoGameMedia, checkBoxChangeVolumeNotifications, checkBoxChangeVolumeAlarms, checkBoxChangeIncomingCallsRingtone, checkBoxChangeNotificationRingtone, checkBoxChangeAudibleSelection, checkBoxChangeScreenLockUnlockSound, checkBoxChangeHapticFeedback, checkBoxChangeVibrateWhenRinging, checkBoxVibrateWhenRinging, checkBoxAudibleSelection, checkBoxScreenLockUnlockSound, checkBoxHapticFeedback;
Spinner spinnerSoundMode;
CheckBox checkBoxChangeSoundMode, checkBoxChangeVolumeMusicVideoGameMedia, checkBoxChangeVolumeNotifications, checkBoxChangeVolumeAlarms, checkBoxChangeIncomingCallsRingtone, checkBoxChangeNotificationRingtone, checkBoxChangeAudibleSelection, checkBoxChangeScreenLockUnlockSound, checkBoxChangeHapticFeedback, checkBoxChangeVibrateWhenRinging, checkBoxVibrateWhenRinging, checkBoxAudibleSelection, checkBoxScreenLockUnlockSound, checkBoxHapticFeedback, checkBoxChangeDnd;
Spinner spinnerSoundMode, spinnerDndMode;
SeekBar seekBarVolumeMusic, seekBarVolumeNotifications, seekBarVolumeAlarms;
Button bChangeSoundIncomingCalls, bChangeSoundNotifications, bSaveProfile;
TextView tvIncomingCallsRingtone, tvNotificationsRingtone;
@ -47,6 +48,7 @@ public class ActivityManageProfile extends Activity
File incomingCallsRingtone = null, notificationsRingtone = null;
ArrayAdapter<String> soundModeAdapter;
ArrayAdapter<String> dndModeAdapter;
public void setIncomingCallsRingtone(File incomingCallsRingtone)
{
@ -85,6 +87,7 @@ public class ActivityManageProfile extends Activity
this.setContentView(R.layout.activity_manage_specific_profile);
checkBoxChangeSoundMode = (CheckBox)findViewById(R.id.checkBoxChangeSoundMode);
checkBoxChangeDnd = (CheckBox)findViewById(R.id.checkBoxChangeDnd);
checkBoxChangeVolumeMusicVideoGameMedia = (CheckBox)findViewById(R.id.checkBoxChangeVolumeMusicVideoGameMedia);
checkBoxChangeVolumeNotifications = (CheckBox)findViewById(R.id.checkBoxChangeVolumeNotifications);
checkBoxChangeVolumeAlarms = (CheckBox)findViewById(R.id.checkBoxChangeVolumeAlarms);
@ -99,6 +102,7 @@ public class ActivityManageProfile extends Activity
checkBoxHapticFeedback = (CheckBox)findViewById(R.id.checkBoxHapticFeedback);
checkBoxVibrateWhenRinging = (CheckBox)findViewById(R.id.checkBoxVibrateWhenRinging);
spinnerSoundMode = (Spinner)findViewById(R.id.spinnerSoundMode);
spinnerDndMode = (Spinner)findViewById(R.id.spinnerDndMode);
seekBarVolumeMusic = (SeekBar)findViewById(R.id.seekBarVolumeMusic);
seekBarVolumeNotifications = (SeekBar)findViewById(R.id.seekBarVolumeNotifications);
seekBarVolumeAlarms = (SeekBar)findViewById(R.id.seekBarVolumeAlarms);
@ -114,6 +118,7 @@ public class ActivityManageProfile extends Activity
checkBoxScreenLockUnlockSound.setEnabled(false);
checkBoxHapticFeedback.setEnabled(false);
spinnerSoundMode.setEnabled(false);
spinnerDndMode.setEnabled(false);
seekBarVolumeMusic.setEnabled(false);
seekBarVolumeNotifications.setEnabled(false);
seekBarVolumeAlarms.setEnabled(false);
@ -121,6 +126,14 @@ public class ActivityManageProfile extends Activity
bChangeSoundNotifications.setEnabled(false);
spinnerSoundMode.setSelection(0);
spinnerDndMode.setSelection(0);
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
{
// Disable DND controls
checkBoxChangeDnd.setEnabled(false);
spinnerDndMode.setEnabled(false);
}
// Scale SeekBars to the system's maximum volume values
AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE);
@ -128,9 +141,31 @@ public class ActivityManageProfile extends Activity
seekBarVolumeNotifications.setMax(am.getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION));
seekBarVolumeAlarms.setMax(am.getStreamMaxVolume(AudioManager.STREAM_ALARM));
soundModeAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, new String[] { getResources().getString(R.string.soundModeSilent), getResources().getString(R.string.soundModeVibrate), getResources().getString(R.string.soundModeNormal) });
soundModeAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, new String[]
{
getResources().getString(R.string.soundModeSilent),
getResources().getString(R.string.soundModeVibrate),
getResources().getString(R.string.soundModeNormal)
});
spinnerSoundMode.setAdapter(soundModeAdapter);
dndModeAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, new String[]
{
getResources().getString(R.string.dndOff),
getResources().getString(R.string.dndPriority),
getResources().getString(R.string.dndNothing),
getResources().getString(R.string.dndAlarms)
});
spinnerDndMode.setAdapter(dndModeAdapter);
/*
Order in spinner: 1, 2, 4, 3
NotificationManager.INTERRUPTION_FILTER_UNKNOWN -> Returned when the value is unavailable for any reason.
NotificationManager.INTERRUPTION_FILTER_ALL -> 1 -> Normal interruption filter - no notifications are suppressed. -> essentially turn off DND
NotificationManager.INTERRUPTION_FILTER_PRIORITY -> 2 -> Priority interruption filter - all notifications are suppressed except those that match the priority criteria.
NotificationManager.INTERRUPTION_FILTER_ALARMS -> 4 -> Alarms only interruption filter - all notifications except those of category
NotificationManager.INTERRUPTION_FILTER_NONE -> 3 -> No interruptions filter - all notifications are suppressed and all audio streams (except those used for phone calls) and vibrations are muted.
*/
checkBoxChangeSoundMode.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
@ -139,6 +174,14 @@ public class ActivityManageProfile extends Activity
spinnerSoundMode.setEnabled(isChecked);
}
});
checkBoxChangeDnd.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
spinnerDndMode.setEnabled(isChecked);
}
});
checkBoxChangeVolumeMusicVideoGameMedia.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
@ -327,6 +370,7 @@ public class ActivityManageProfile extends Activity
{
etName.setText(ActivityMainProfiles.profileToEdit.getName());
checkBoxChangeSoundMode.setChecked(ActivityMainProfiles.profileToEdit.getChangeSoundMode());
checkBoxChangeDnd.setChecked(ActivityMainProfiles.profileToEdit.getChangeDndMode());
checkBoxChangeVolumeMusicVideoGameMedia.setChecked(ActivityMainProfiles.profileToEdit.getChangeVolumeMusicVideoGameMedia());
checkBoxChangeVolumeNotifications.setChecked(ActivityMainProfiles.profileToEdit.getChangeVolumeNotifications());
checkBoxChangeVolumeAlarms.setChecked(ActivityMainProfiles.profileToEdit.getChangeVolumeAlarms());
@ -338,6 +382,7 @@ public class ActivityManageProfile extends Activity
checkBoxChangeVibrateWhenRinging.setChecked(ActivityMainProfiles.profileToEdit.getChangeVibrateWhenRinging());
spinnerSoundMode.setSelection(ActivityMainProfiles.profileToEdit.getSoundMode());
spinnerDndMode.setSelection(ActivityMainProfiles.profileToEdit.getDndMode()-1);
seekBarVolumeMusic.setProgress(ActivityMainProfiles.profileToEdit.getVolumeMusic());
seekBarVolumeNotifications.setProgress(ActivityMainProfiles.profileToEdit.getVolumeNotifications());
seekBarVolumeAlarms.setProgress(ActivityMainProfiles.profileToEdit.getVolumeAlarms());
@ -359,6 +404,7 @@ public class ActivityManageProfile extends Activity
ActivityMainProfiles.profileToEdit.setName(etName.getText().toString());
ActivityMainProfiles.profileToEdit.setChangeSoundMode(checkBoxChangeSoundMode.isChecked());
ActivityMainProfiles.profileToEdit.setChangeDndMode(checkBoxChangeDnd.isChecked());
ActivityMainProfiles.profileToEdit.setChangeVolumeMusicVideoGameMedia(checkBoxChangeVolumeMusicVideoGameMedia.isChecked());
ActivityMainProfiles.profileToEdit.setChangeVolumeNotifications(checkBoxChangeVolumeNotifications.isChecked());
ActivityMainProfiles.profileToEdit.setChangeVolumeAlarms(checkBoxChangeVolumeAlarms.isChecked());
@ -374,6 +420,7 @@ public class ActivityManageProfile extends Activity
ActivityMainProfiles.profileToEdit.setHapticFeedback(checkBoxHapticFeedback.isChecked());
ActivityMainProfiles.profileToEdit.setVibrateWhenRinging(checkBoxVibrateWhenRinging.isChecked());
ActivityMainProfiles.profileToEdit.setSoundMode(spinnerSoundMode.getSelectedItemPosition());
ActivityMainProfiles.profileToEdit.setDndMode(spinnerDndMode.getSelectedItemPosition()+1);
ActivityMainProfiles.profileToEdit.setVolumeMusic(seekBarVolumeMusic.getProgress());
ActivityMainProfiles.profileToEdit.setVolumeNotifications(seekBarVolumeNotifications.getProgress());
ActivityMainProfiles.profileToEdit.setVolumeAlarms(seekBarVolumeAlarms.getProgress());
@ -401,21 +448,23 @@ public class ActivityManageProfile extends Activity
}
if(!checkBoxChangeSoundMode.isChecked()
&
&&
!checkBoxChangeDnd.isChecked()
&&
!checkBoxChangeVolumeMusicVideoGameMedia.isChecked()
&
&&
!checkBoxChangeVolumeNotifications.isChecked()
&
&&
!checkBoxChangeVolumeAlarms.isChecked()
&
&&
!checkBoxChangeIncomingCallsRingtone.isChecked()
&
&&
!checkBoxChangeNotificationRingtone.isChecked()
&
&&
!checkBoxChangeAudibleSelection.isChecked()
&
&&
!checkBoxChangeScreenLockUnlockSound.isChecked()
&
&&
!checkBoxChangeHapticFeedback.isChecked()
)
{

View File

@ -1,5 +1,6 @@
package com.jens.automation2;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@ -120,7 +121,7 @@ public class ActivityManageRule extends Activity
{
context = this;
super.onCreate(savedInstanceState);
setContentView(R.layout.manage_specific_rule);
setContentView(R.layout.activity_manage_specific_rule);
instance = this;
@ -613,16 +614,16 @@ public class ActivityManageRule extends Activity
if(triggerType == Trigger_Enum.nfcTag)
{
if (NfcReceiver.checkNfcRequirements(ActivityManageRule.this, true))
getTriggerParamterDialog(context, booleanChoices).show();
getTriggerParameterDialog(context, booleanChoices).show();
}
else
getTriggerParamterDialog(context, booleanChoices).show();
getTriggerParameterDialog(context, booleanChoices).show();
}
});
return builder.create();
}
private AlertDialog getTriggerParamterDialog(final Context myContext, final String[] choices)
private AlertDialog getTriggerParameterDialog(final Context myContext, final String[] choices)
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
alertDialogBuilder.setTitle(getResources().getString(R.string.selectTypeOfTrigger));
@ -1176,6 +1177,7 @@ public class ActivityManageRule extends Activity
{
ruleToEdit.getTriggerSet().add(newTrigger);
newTrigger.setTriggerParameter(data.getBooleanExtra("direction", false));
newTrigger.setTriggerParameter2(
data.getStringExtra("app") + Trigger.triggerParameter2Split +
data.getStringExtra("titleDir") + Trigger.triggerParameter2Split +
@ -1382,7 +1384,7 @@ public class ActivityManageRule extends Activity
else if(types[i].toString().equals(Action_Enum.sendTextMessage.toString()))
{
// if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageSpecificRule.this, "android.permission.SEND_SMS") && !Miscellaneous.isGooglePlayInstalled(ActivityManageSpecificRule.this))
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, "android.permission.SEND_SMS"))
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, Manifest.permission.SEND_SMS))
items.add(new Item(typesLong[i].toString(), R.drawable.message));
}
else
@ -1423,14 +1425,15 @@ public class ActivityManageRule extends Activity
newAction.setAction(Action_Enum.triggerUrl);
ActivityManageActionTriggerUrl.resultingAction = null;
Intent editTriggerIntent = new Intent(context, ActivityManageActionTriggerUrl.class);
startActivityForResult(editTriggerIntent, 1000);
startActivityForResult(editTriggerIntent, requestCodeActionTriggerUrlAdd);
}
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifi.toString()))
{
newAction.setAction(Action_Enum.setWifi);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
Toast.makeText(context, context.getResources().getString(R.string.android10WifiToggleNotice), Toast.LENGTH_LONG).show();
getActionParameter1Dialog(ActivityManageRule.this).show();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
Miscellaneous.messageBox(context.getResources().getString(R.string.app_name), context.getResources().getString(R.string.android10WifiToggleNotice), context).show();
}
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setBluetooth.toString()))
{
@ -1442,9 +1445,10 @@ public class ActivityManageRule extends Activity
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setUsbTethering.toString()))
{
newAction.setAction(Action_Enum.setUsbTethering);
getActionParameter1Dialog(ActivityManageRule.this).show();
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();
getActionParameter1Dialog(ActivityManageRule.this).show();
}
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifiTethering.toString()))
{
@ -1470,7 +1474,7 @@ public class ActivityManageRule extends Activity
{
newAction.setAction(Action_Enum.startOtherActivity);
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
startActivityForResult(intent, 3000);
startActivityForResult(intent, requestCodeActionStartActivityAdd);
}
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.waitBeforeNextAction.toString()))
{
@ -1504,7 +1508,7 @@ public class ActivityManageRule extends Activity
newAction.setAction(Action_Enum.speakText);
ActivityManageActionSpeakText.resultingAction = null;
Intent editTriggerIntent = new Intent(context, ActivityManageActionSpeakText.class);
startActivityForResult(editTriggerIntent, 5000);
startActivityForResult(editTriggerIntent, requestCodeActionSpeakTextAdd);
}
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.sendTextMessage.toString()))
{

View File

@ -3,6 +3,7 @@ package com.jens.automation2;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
@ -19,6 +20,9 @@ import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.app.NotificationManagerCompat;
import com.jens.automation2.receivers.NotificationListener;
@ -411,11 +415,11 @@ public class ActivityPermissions extends Activity
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case charging:
addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
// addToArrayListUnique("android.permission.BATTERY_STATS", requiredPermissions);
break;
case headsetPlugged:
addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
break;
case nfcTag:
addToArrayListUnique(Manifest.permission.NFC, requiredPermissions);
@ -499,7 +503,8 @@ public class ActivityPermissions extends Activity
case setAirplaneMode:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// https://stackoverflow.com/questions/32185628/connectivitymanager-requestnetwork-in-android-6-0
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
/* Permission was not required anymore, even before Android 6: https://su.chainfire.eu/#updates-permission
addToArrayListUnique(permissionNameSuperuser, requiredPermissions);*/
break;
@ -512,7 +517,8 @@ public class ActivityPermissions extends Activity
case setDataConnection:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// https://stackoverflow.com/questions/32185628/connectivitymanager-requestnetwork-in-android-6-0
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.READ_PHONE_STATE, requiredPermissions);
/* Permission was not required anymore, even before Android 6: https://su.chainfire.eu/#updates-permission
addToArrayListUnique(permissionNameSuperuser, requiredPermissions);*/
@ -522,16 +528,19 @@ public class ActivityPermissions extends Activity
break;
case setUsbTethering:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// https://stackoverflow.com/questions/32185628/connectivitymanager-requestnetwork-in-android-6-0
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
break;
case setWifi:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// https://stackoverflow.com/questions/32185628/connectivitymanager-requestnetwork-in-android-6-0
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case setWifiTethering:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// https://stackoverflow.com/questions/32185628/connectivitymanager-requestnetwork-in-android-6-0
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
/*
@ -578,30 +587,30 @@ public class ActivityPermissions extends Activity
break;
case turnUsbTetheringOff:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
break;
case turnUsbTetheringOn:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
break;
case turnWifiOff:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case turnWifiOn:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case turnWifiTetheringOff:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case turnWifiTetheringOn:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
// addToArrayListUnique(Manifest.permission.CHANGE_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
break;
case waitBeforeNextAction:
@ -609,6 +618,9 @@ public class ActivityPermissions extends Activity
case wakeupDevice:
addToArrayListUnique(Manifest.permission.WAKE_LOCK, requiredPermissions);
break;
case playSound:
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
break;
default:
break;
}
@ -647,7 +659,7 @@ public class ActivityPermissions extends Activity
{
for (Action action : rule.getActionSet())
{
if(action.equals(actionType))
if(action.getAction().equals(actionType))
addToArrayListUnique(rule.getName(), returnList);
}
}
@ -674,17 +686,14 @@ public class ActivityPermissions extends Activity
case Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE:
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.notification))
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
break;
case permissionNameGoogleActivityDetection:
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.activityDetection))
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
break;
case Manifest.permission.ACTIVITY_RECOGNITION:
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.activityDetection))
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
break;
case Manifest.permission.ACCESS_COARSE_LOCATION:
// usingElements.add(getResources().getString(R.string.android_permission_ACCESS_COARSE_LOCATION));
@ -821,6 +830,10 @@ public class ActivityPermissions extends Activity
case Manifest.permission.FOREGROUND_SERVICE:
usingElements.add(getResources().getString(R.string.startAutomationAsService));
break;
case Manifest.permission.READ_EXTERNAL_STORAGE:
for(String ruleName : getRulesUsing(Action.Action_Enum.playSound))
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
break;
}
return usingElements;
@ -965,8 +978,8 @@ public class ActivityPermissions extends Activity
if(requiredPermissions.contains(Manifest.permission.SEND_SMS))
{
if(!ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.SEND_SMS)
&&
Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext())
// &&
// Miscellaneous.isGooglePlayInstalled(Miscellaneous.getAnyContext())
)
{
requiredPermissions.remove(Manifest.permission.SEND_SMS);
@ -984,7 +997,10 @@ public class ActivityPermissions extends Activity
Miscellaneous.logEvent("i", "Permissions", "Requesting permissions: " + permissions, 2);
// Toast.makeText(ActivityPermissions.this, "Requesting permissions. Amount: " + String.valueOf(requiredPermissions.size()), Toast.LENGTH_LONG).show();
if(requiredPermissions.size() > 0)
requestPermissions(requiredPermissions.toArray(new String[requiredPermissions.size()]), requestCodeForPermissions);
// else
// Miscellaneous.messageBox(getResources().getString(R.string.warning), getResources().getString(R.string.permissionsRequiredNotAvailable), ActivityPermissions.this).show();
}
else
setHaveAllPermissions();
@ -1152,10 +1168,6 @@ public class ActivityPermissions extends Activity
private void setHaveAllPermissions()
{
setResult(RESULT_OK);
// All permissions have been granted.
NotificationManager mNotificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(notificationIdPermissions);
ActivityMainScreen.updateMainScreen();
try
{
@ -1166,6 +1178,14 @@ public class ActivityPermissions extends Activity
// Activity may not have been loaded, yet.
}
// All permissions have been granted.
NotificationManager mNotificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(notificationIdPermissions);
if(AutomationService.getInstance() != null)
AutomationService.getInstance().cancelNotification();
ActivityMainScreen.updateMainScreen();
this.finish();
}
@ -1322,6 +1342,7 @@ public class ActivityPermissions extends Activity
mapActionPermissions.put("turnWifiTetheringOn", Manifest.permission.WRITE_SETTINGS);
mapActionPermissions.put("turnWifiTetheringOn", Manifest.permission.CHANGE_NETWORK_STATE);
mapActionPermissions.put("turnWifiTetheringOn", Manifest.permission.ACCESS_NETWORK_STATE);
mapActionPermissions.put("playSound", Manifest.permission.READ_EXTERNAL_STORAGE);
// mapActionPermissions.put("waitBeforeNextAction", "");
mapActionPermissions.put("wakeupDevice", Manifest.permission.WAKE_LOCK);
}

View File

@ -24,6 +24,7 @@ import android.util.Log;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.jens.automation2.Trigger.Trigger_Enum;
import com.jens.automation2.location.LocationProvider;
@ -333,7 +334,7 @@ public class AutomationService extends Service implements OnInitListener
protected void startLocationProvider()
{
if(ActivityPermissions.havePermission("android.permission.ACCESS_COARSE_LOCATION", AutomationService.this))
if(ActivityPermissions.havePermission(Manifest.permission.ACCESS_COARSE_LOCATION, AutomationService.this))
myLocationProvider = new LocationProvider(this); //autostart with this (only) constructor
}
@ -407,6 +408,14 @@ public class AutomationService extends Service implements OnInitListener
}
}
public void cancelNotification()
{
// stopForeground(false);
NotificationManagerCompat.from(AutomationService.this).cancelAll();
// NotificationManagerCompat.from(AutomationService.this).cancel(ActivityPermissions.notificationIdPermissions);
// NotificationManagerCompat.from(AutomationService.this).cancel(AutomationService.notificationIdRestrictions);
}
protected void checkForMissingBackgroundLocationPermission()
{
if(Miscellaneous.googleToBlameForLocation(true))
@ -421,23 +430,6 @@ public class AutomationService extends Service implements OnInitListener
else
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
}
/*
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
if (BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
{
if (Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest))
{
Intent intent = new Intent(AutomationService.this, ActivityMainTabLayout.class);
PendingIntent pi = PendingIntent.getActivity(AutomationService.this, 0, intent, 0);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
Miscellaneous.createDismissableNotificationWithDelay(2200, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
else
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
}
}
}*/
}
public static void startAutomationService(Context context, boolean startAtBoot)
@ -632,6 +624,9 @@ public class AutomationService extends Service implements OnInitListener
// }
// else
// {
if(notificationBuilder == null)
notificationBuilder = createDefaultNotificationBuilder();
notificationBuilder.setContentText(textToDisplay);
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));

View File

@ -15,6 +15,8 @@ import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
@ -607,8 +609,11 @@ public class Miscellaneous extends Service
if(notificationTitle != null && notificationTitle.length() > 0)
source = source.replace("[notificationTitle]", notificationTitle);
else
{
source = source.replace("notificationTitle unknown", notificationTitle);
Miscellaneous.logEvent("w", "Variable replacement", "notificationTitle was empty.", 3);
}
}
if(source.contains("[notificationText]"))
{
@ -617,8 +622,11 @@ public class Miscellaneous extends Service
if(notificationText != null && notificationText.length() > 0)
source = source.replace("[notificationText]", notificationText);
else
{
source = source.replace("notificationText unknown", notificationText);
Miscellaneous.logEvent("w", "Variable replacement", "notificationText was empty.", 3);
}
}
// Miscellaneous.logEvent("i", "URL after replace", source);
@ -665,6 +673,24 @@ public class Miscellaneous extends Service
return alertDialog.create();
}
private boolean haveNetworkConnection()
{
boolean haveConnectedWifi = false;
boolean haveConnectedMobile = false;
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
for (NetworkInfo ni : netInfo) {
if (ni.getTypeName().equalsIgnoreCase("WIFI"))
if (ni.isConnected())
haveConnectedWifi = true;
if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
if (ni.isConnected())
haveConnectedMobile = true;
}
return haveConnectedWifi || haveConnectedMobile;
}
/**
* Checks if the device is rooted.
*
@ -672,9 +698,13 @@ public class Miscellaneous extends Service
*/
public static boolean isPhoneRooted()
{
// if(true)
// return true;
// get from build info
String buildTags = Build.TAGS;
if (buildTags != null && buildTags.contains("test-keys")) {
if (buildTags != null && buildTags.contains("test-keys"))
{
return true;
}
@ -881,6 +911,7 @@ public class Miscellaneous extends Service
dismissableNotificationBuilder.setContentText(textToDisplay);
dismissableNotificationBuilder.setContentIntent(pendingIntent);
dismissableNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
dismissableNotificationBuilder.setAutoCancel(true);
Notification dismissableNotification = dismissableNotificationBuilder.build();
@ -982,6 +1013,7 @@ public class Miscellaneous extends Service
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
builder.setCategory(Notification.CATEGORY_SERVICE);
builder.setAutoCancel(true);
builder.setWhen(System.currentTimeMillis());
builder.setContentIntent(myPendingIntent);

View File

@ -5,6 +5,7 @@ import android.content.Context;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.util.Log;
import android.widget.Toast;
@ -24,6 +25,9 @@ public class Profile implements Comparable<Profile>
protected boolean changeSoundMode;
protected int soundMode;
protected boolean changeDndMode;
protected int dndMode;
boolean changeVolumeMusicVideoGameMedia;
protected int volumeMusic;
@ -81,6 +85,26 @@ public class Profile implements Comparable<Profile>
return soundMode;
}
public boolean getChangeDndMode()
{
return changeDndMode;
}
public void setChangeDndMode(boolean changeDndMode)
{
this.changeDndMode = changeDndMode;
}
public int getDndMode()
{
return dndMode;
}
public void setDndMode(int dndMode)
{
this.dndMode = dndMode;
}
public void setChangeVolumeMusicVideoGameMedia(boolean changeVolumeMusicVideoGameMedia)
{
this.changeVolumeMusicVideoGameMedia = changeVolumeMusicVideoGameMedia;
@ -450,6 +474,9 @@ public class Profile implements Comparable<Profile>
if(changeSoundMode)
Actions.setSound(context, soundMode);
if(changeDndMode)
Actions.setDND(context, dndMode);
if(changeVolumeMusicVideoGameMedia)
am.setStreamVolume(AudioManager.STREAM_MUSIC, volumeMusic, AudioManager.FLAG_PLAY_SOUND);
@ -464,10 +491,19 @@ public class Profile implements Comparable<Profile>
applyRingTone(incomingCallsRingtone, RingtoneManager.TYPE_RINGTONE, context);
if(changeVibrateWhenRinging)
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
android.provider.Settings.System.putInt(context.getContentResolver(), "vibrate_when_ringing", vibrateWhenRinging?1:0);
}
else
{
if (vibrateWhenRinging)
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);
else
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
}
}
if(changeNotificationRingtone)
if(notificationRingtone != null)

View File

@ -144,14 +144,14 @@ public class ReceiverCoordinator
ConnectivityReceiver.startConnectivityReceiver(AutomationService.getInstance());
// startCellLocationChangedReceiver
if(!ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance()) && WifiBroadcastReceiver.mayCellLocationReceiverBeActivated() && (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.speed)))
if(!ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance()) && WifiBroadcastReceiver.mayCellLocationReceiverBeActivated() && (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.pointOfInterest) || Rule.isAnyRuleUsing(Trigger.Trigger_Enum.speed)))
{
if(!Miscellaneous.googleToBlameForLocation(true))
CellLocationChangedReceiver.startCellLocationChangedReceiver();
}
// startBatteryReceiver
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.charging) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.usb_host_connection) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.batteryLevel))
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.charging) || Rule.isAnyRuleUsing(Trigger.Trigger_Enum.usb_host_connection) || Rule.isAnyRuleUsing(Trigger.Trigger_Enum.batteryLevel))
BatteryReceiver.startBatteryReceiver(AutomationService.getInstance());
// startAlarmListener

View File

@ -170,9 +170,9 @@ public class XmlFileInterface
serializer.startTag(null, "changeVibrateWhenRinging");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeVibrateWhenRinging()));
serializer.endTag(null, "changeVibrateWhenRinging");//
serializer.startTag(null, "changeVibrateWhenRinging");
serializer.startTag(null, "vibrateWhenRinging");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getVibrateWhenRinging()));
serializer.endTag(null, "changeVibrateWhenRinging");
serializer.endTag(null, "vibrateWhenRinging");
serializer.startTag(null, "changeNotificationRingtone");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeNotificationRingtone()));
@ -206,12 +206,18 @@ public class XmlFileInterface
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getHapticFeedback()));
serializer.endTag(null, "hapticFeedback");
serializer.startTag(null, "changeDndMode");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getChangeDndMode()));
serializer.endTag(null, "changeDndMode");//
serializer.startTag(null, "dndMode");
serializer.text(String.valueOf(Profile.getProfileCollection().get(i).getDndMode()));
serializer.endTag(null, "dndMode");
serializer.endTag(null, "Profile");
}
serializer.endTag(null, "ProfileCollection");
serializer.startTag(null, "RuleCollection");
for(int i=0; i<Rule.getRuleCollection().size(); i++)
{
@ -607,6 +613,10 @@ public class XmlFileInterface
newProfile.setChangeSoundMode(Boolean.parseBoolean(readTag(parser, "changeSoundMode")));
else if (name.equals("soundMode"))
newProfile.setSoundMode(Integer.parseInt(readTag(parser, "soundMode")));
else if (name.equals("changeDndMode"))
newProfile.setChangeDndMode(Boolean.parseBoolean(readTag(parser, "changeDndMode")));
else if (name.equals("dndMode"))
newProfile.setDndMode(Integer.parseInt(readTag(parser, "dndMode")));
else if (name.equals("changeVolumeMusicVideoGameMedia"))
newProfile.setChangeVolumeMusicVideoGameMedia(Boolean.parseBoolean(readTag(parser, "changeVolumeMusicVideoGameMedia")));
else if (name.equals("volumeMusic"))
@ -641,6 +651,8 @@ public class XmlFileInterface
else
newProfile.setNotificationRingtone(null);
}
else if (name.equals("vibrateWhenRinging"))
newProfile.setVibrateWhenRinging(Boolean.parseBoolean(readTag(parser, "vibrateWhenRinging")));
else if (name.equals("changeAudibleSelection"))
newProfile.setChangeAudibleSelection(Boolean.parseBoolean(readTag(parser, "changeAudibleSelection")));
else if (name.equals("audibleSelection"))

View File

@ -130,6 +130,21 @@ public class CellLocationChangedReceiver extends PhoneStateListener
}
}
public static boolean isCellLocationChangedReceiverPossible()
{
if(telephonyManager == null)
telephonyManager = (TelephonyManager) AutomationService.getInstance().getSystemService(Context.TELEPHONY_SERVICE);
if(
ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance())
||
telephonyManager.getSimState() != TelephonyManager.SIM_STATE_READY
)
return false;
else
return true;
}
public Location getLocation(String accuracy)
{
Criteria crit = new Criteria();
@ -137,7 +152,7 @@ public class CellLocationChangedReceiver extends PhoneStateListener
String myProviderName;
// If privacy mode or no data connection available
if(Settings.privacyLocationing | !ConnectivityReceiver.isDataConnectionAvailable(AutomationService.getInstance()))
if(Settings.privacyLocationing || !ConnectivityReceiver.isDataConnectionAvailable(AutomationService.getInstance()))
{
Miscellaneous.logEvent("i", "CellLocation", Miscellaneous.getAnyContext().getResources().getString(R.string.enforcingGps), 4);
myProviderName = LocationManager.GPS_PROVIDER;
@ -175,6 +190,9 @@ public class CellLocationChangedReceiver extends PhoneStateListener
}
else
{
if(myLocationManager == null)
myLocationManager = (LocationManager) AutomationService.getInstance().getSystemService(Context.LOCATION_SERVICE);
if(!myLocationManager.isProviderEnabled(myProviderName))
{
if(myProviderName.equals(LocationManager.NETWORK_PROVIDER))
@ -226,13 +244,11 @@ public class CellLocationChangedReceiver extends PhoneStateListener
return currentLocation;
}
public void setCurrentLocation(Location currentLocation)
{
this.currentLocation = currentLocation;
}
public class MyLocationListener implements LocationListener
{
@Override
@ -327,7 +343,7 @@ public class CellLocationChangedReceiver extends PhoneStateListener
{
if(!cellLocationListenerActive)
{
if(!ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance()))
if(!ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance()) && telephonyManager.getSimState() == TelephonyManager.SIM_STATE_READY)
{
if(WifiBroadcastReceiver.mayCellLocationReceiverBeActivated())
{
@ -356,7 +372,7 @@ public class CellLocationChangedReceiver extends PhoneStateListener
Miscellaneous.logEvent("w", "cellReceiver", "Wanted to activate CellLocationChangedReceiver, but Wifi-Receiver says not to.", 4);
}
else
Miscellaneous.logEvent("i", "cellReceiver", "Not starting cellLocationListener because Airplane mode is active.", 4);
Miscellaneous.logEvent("i", "cellReceiver", "Not starting cellLocationListener because Airplane mode is active or SIM_STATE is not ready.", 4);
}
}
catch(Exception ex)
@ -410,4 +426,3 @@ public class CellLocationChangedReceiver extends PhoneStateListener
ActivityPermissions.havePermission("android.permission.ACCESS_WIFI_STATE", Miscellaneous.getAnyContext());
}
}

View File

@ -7,6 +7,7 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.jens.automation2.ActivityMainScreen;
@ -26,13 +27,9 @@ import java.util.Calendar;
public class LocationProvider
{
protected static boolean passiveLocationListenerActive = false;
protected static LocationListener passiveLocationListener;
protected static LocationProvider locationProviderInstance = null;
protected AutomationService parentService;
public AutomationService getParentService()
{
@ -108,6 +105,8 @@ public class LocationProvider
}
public void setCurrentLocation(Location newLocation, boolean skipVerification)
{
if(newLocation != null)
{
Miscellaneous.logEvent("i", "Location", "Setting location.", 4);
@ -227,6 +226,9 @@ public class LocationProvider
if (AutomationService.isMainActivityRunning(parentService))
ActivityMainScreen.updateMainScreen();
}
else
Miscellaneous.logEvent("w", "Location", "New location given is null. Ignoring.", 5);
}
public void startLocationService()
{
@ -244,14 +246,38 @@ public class LocationProvider
if(Settings.positioningEngine == 0)
{
if(Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger_Enum.speed))
{
// TelephonyManager telephonyManager = (TelephonyManager) AutomationService.getInstance().getSystemService(Context.TELEPHONY_SERVICE);
// startCellLocationChangedReceiver
if (!ConnectivityReceiver.isAirplaneMode(this.parentService) && WifiBroadcastReceiver.mayCellLocationReceiverBeActivated() && (Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger_Enum.speed)))
if (CellLocationChangedReceiver.isCellLocationChangedReceiverPossible())
{
if (WifiBroadcastReceiver.mayCellLocationReceiverBeActivated())
CellLocationChangedReceiver.startCellLocationChangedReceiver();
}
else
{
/*
Reasons why we may end up here:
- Airplane mode is active
- No phone module present (pure wifi device)
- No SIM card is inserted or it's not unlocked
We'd have to try GPS now to get an initial position.
For permanent use there is no way we could know when it
would make sense to check the position again.
*/
// Trigger a one-time-position-search
Location loc = CellLocationChangedReceiver.getInstance().getLocation("fine");
LocationProvider.getInstance().setCurrentLocation(loc, true);
}
// startPassiveLocationListener
if(Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger_Enum.speed))
startPassiveLocationListener();
}
}
else
{
// if(Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest))

View File

@ -9,6 +9,13 @@
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/smsDialogNotice"
android:textColor="#ea131b"
android:layout_marginBottom="@dimen/default_margin" />
<Button
android:id="@+id/bImportNumberFromContacts"
android:drawableLeft="@drawable/contacts"

View File

@ -45,6 +45,19 @@
<requestFocus />
</EditText>
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/general"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBoxChangeSoundMode"
android:layout_width="wrap_content"
@ -63,13 +76,54 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:text="@string/silentTriggersDnd" />
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dnd"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBoxChangeDnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/change" />
<Spinner
android:id="@+id/spinnerDndMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:text="@string/dndRemarks" />
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/volumes"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginLeft="40dp" />
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBoxChangeVolumeMusicVideoGameMedia"
@ -122,6 +176,19 @@
android:layout_height="wrap_content"
android:layout_marginLeft="40dp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tones"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBoxChangeIncomingCallsRingtone"
android:layout_width="wrap_content"
@ -200,6 +267,19 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/miscellaneous"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBoxChangeAudibleSelection"
android:layout_width="wrap_content"
@ -240,6 +320,7 @@
<Button
android:id="@+id/bSaveProfile"
android:layout_marginTop="@dimen/default_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/save" />

View File

@ -475,14 +475,14 @@
<string name="textMessageAnnotations">Sie können direkt eine Telefonnummer eingeben. Alternativ können Sie eine aus Ihren Kontakten auswählen. Aber: Es wird immer die Nummer gespeichert, nicht der Kontakt referenziert. D.h., wenn Sie einmal die Nummer eines Kontaktes ändern, müssen Sie diese Regel aktualisieren.</string>
<string name="importNumberFromContacts">Von Kontakten importieren</string>
<string name="android9RecordAudioNotice">Falls Sie die Umgebungslautstärke als Auslöser benutzen: Leider hat sich Google entschlossen ab Android Version 9 (Pie) Hintergrundanwendungen den Zugriff auf das Mikrofon zu verweigern. Das bedeutet, dass dieser Auslöser keinen Effekt mehr hat und keine Regeln auslösen wird.</string>
<string name="android10WifiToggleNotice">Leider hat Google in Android 10 die Möglichkeit entfernt, daß normale Anwendungen WLAN an- oder ausschalten können. Diese Aktion wird also keinen Effekt auf Ihrem Gerät haben.</string>
<string name="android10WifiToggleNotice">Leider hat Google in Android 10 die Möglichkeit entfernt, daß normale Anwendungen WLAN an- oder ausschalten können. Nur, wenn Ihr Gerät gerootet ist, sollte es weiterhin funktionieren. Wenn nicht, wird diese Aktion leider keinen Effekt mehr auf Ihrem Gerät haben.</string>
<string name="messageNotShownAgain">Diese Nachricht wird nicht wieder angezeigt.</string>
<string name="chooseActivityHint">In diesem letzten Auswahlfeld müssen Sie eine bestimmte \"Activity\" auswählen. Vereinfacht ist das ein bestimmtes Fenster der ausgewählten Anwendung. Wenn Sie nicht wissen, welche Sie auswählen sollen, ist es normalerweise eine gute Idee zunächst welche auszuprobieren, die \"main\" oder \"launcher\" im Namen haben.</string>
<string name="edit">Bearbeiten</string>
<string name="clickAndHoldForOptions">Klicken und halten Sie ein Objekt für Optionen.</string>
<string name="startAutomationAsService">Automation als Dienst starten</string>
<string name="setScreenBrightness">Set screen brightness</string>
<string name="setScreenBrightnessEnterValue">Enter the desired brightness (from 0 to 100).</string>
<string name="setScreenBrightness">Bildschirmhelligkeit einstellen</string>
<string name="setScreenBrightnessEnterValue">Geben Sie den gewünschten Helligkeitswert ein (von 0 bis 100).</string>
<string name="autoBrightness">Automatische Helligkeitseinstellung verwenden</string>
<string name="apply">übernehmen</string>
<string name="brightnessAuto">automatische Helligkeit</string>
@ -594,4 +594,5 @@
<string name="top">Oben</string>
<string name="bottom">Unten</string>
<string name="tabsPlacementSummary">Wol soll die Taskleiste angezeigt werden?</string>
<string name="tones">Klingeltöne</string>
</resources>

View File

@ -556,7 +556,7 @@
<string name="logFileMaxSizeTitle">Maximo tamaño del archivo log [Mb]</string>
<string name="theseAreThePermissionsRequired">Esos son los permisos necesarios.</string>
<string name="android9RecordAudioNotice">Si usa la condición nivel del ruido fondo: Desafortunadamente iniciando con Android 9 (Pie) Google decidió prohibir aplicaciones de fondo usando el micrófono. Por eso esta condición no tendrá un efecto y no iniciará algo.</string>
<string name="android10WifiToggleNotice">Si usa la condición nivel del ruido fondo: Desafortunadamente iniciando con Android 9 (Pie) Google decidió prohibir aplicaciones de fondo usando el micrófono. Por eso esta condición no tendrá un efecto y no iniciará algo.</string>
<string name="android10WifiToggleNotice">Desafortunadamente Google dedició remover esta función en Android 10. Applicaciones regulares ya no pueden activar o desactivar wifi. Solo si su dispositivo esta rooted debe funcionar adelante. Si no este ación no va a continuar de funcionar.</string>
<string name="messageNotShownAgain">Esta nota no aparecerá otra vez.</string>
<string name="noLocationCouldBeFound">No pude encontrar una posición despues de un limite de %1$s segundos..</string>
<string name="pleaseGiveBgLocation">En la proxima pantalla por favor vaya a permisos, luego a posición. Ahi elija \"Siempre permitir\" para permitir Automation determinar la posición en el fondo.</string>
@ -593,4 +593,5 @@
<string name="intentDataComment">Si su parametro es de tipo Uri y especifica \"IntentData\" como nombre (minúscula/mayáscula no es importante), el parametro no está añadido como un parametro normal con puExtra(), pero estará añadido al intent con setData().</string>
<string name="locationEngineDisabledLong">Desafortunadamente su posición todavia no puede ser determinada. Gratitud va para Google por su sabiduria y amabilidad infinita.\n\nDejenme explicarselo mas. Comenzando con Android 10 un nuevo permiso se introdujo que es necesario para determinar la posición en el fondo (que es necesario para una app como esta). Aunque lo considero una buena idea, conlleva a una chicana para desarolladores.\n\nCuando se esta desarrollando una app se puede intentar calificar para este permiso mientras se sigue un catalogo de condiciones. Desafortunadamente nuevas versiones de mi app fueron rechazadas por un periodo de trés meses. Cumplé todas las condiciones, pero Google\'s mierda servicio para desarolladores afirmó que no. Despues de presentar pruebas, que cumplí con todo, recibí una respuesta de \"No puedo ayudarte mas.\". En algun momento me rendí.\n\nComo consecuencia la version Google Play todavia no sabe usar la locación como una condición. Mi única alternativa fue remover la applicación de Google Play.\n\nLo siento mucho, pero hicé todo lo posible para discutir con un support que no sabe aprobar la prueba de Turing repetidamente.\n\nLa noticia positiva: Usted todavia puede tener todo!\n\nAutomation ahora es open source y se puede encontrar en F-Droid. Es un app store que se preocupa por su privacidad - en vez de solo simular eso. Simplemente guarde su configuración, desinstale la app, instale la de F-Droid, restaure su configuración - terminado.\n\nCliquee aqui para averiguar más:</string>
<string name="startAppChoiceNote">Aqui tiene 2 opciones generales:\\n\\n1. Puede encender un programa seleccionando un activity. Imagine eso como preseleccionar una pantalla/ventana especifica de una aplicación. Tenga en cuenta que no siempre funcionará. Eso es porque las ventanas de una app pueden interactuar entre ellas, por ejemplo dar parametros. Si se abre una ventana especifica directamente esta interacción todavia no ha ocurrido y la ventana se podría cerrar al instante (por lo tanto nunca será presentada). Pruebe esto sin embargo! Puede introducir una trayectoria de una activity manualmente, pero es recomendable usar el boton \"Elegir\". Si decide introducir la trayectoria de la app manualmente en la casilla de arriba y la trayectoria completa de una activity en la de abajo.\\n\\n2.Elección con action\\nContrariamente a elegir una ventana especifica, tambien puede encender una app con un action. Es similar a llamar \"Queria xyz\" y si hay una app que le puede ayudar a usted sera encendida. Un ejemplo bueno seria \"abrir browser\" - podria tener multiples (una normalemente es el valor predeterminado). Usted necesita introducirlo manualmente, PackageName es opcional aqui. Tenga en cuenta las variables no seran resueltas. Si por ejemplo quiere encender la camara usando \"MediaStore.ACTION_IMAGE_CAPTURE\" no va a funcionar. Tiene que mirar en la documentación de Android y usar el valor real de esta variable que - en este ejemplo - seria \"android.media.action.IMAGE_CAPTURE\".</string>
<string name="tones">Sonidos</string>
</resources>

View File

@ -586,4 +586,5 @@
<string name="locationFoundInaccurate">È stato possibile solo trovare una ubicazione con una precisione limitata. Potrebbe non funzionare in maniera affidabile. Il raggio minimo per le ubicazioni è di %1$d m.</string>
<string name="noLocationCouldBeFound">Nessuna posizione è stata trovata dopo un tempo di attesa di %1$s seconds.</string>
<string name="pleaseGiveBgLocation">Nella schermata successiva vai su permessi, poi posizione. Lì seleziona \"Consenti sempre\" per permettere ad Automation di determinare la tua posizione in secondo piano.</string>
<string name="tones">Suonerias</string>
</resources>

View File

@ -507,7 +507,7 @@
<string name="phoneIsNotRooted" translatable="false">Phone is not rooted.</string>
<string name="dataConWithRootSuccess" translatable="false">Data connection was successfully changed using superuser permissions.</string>
<string name="dataConWithRootFail" translatable="false">Data could not be changed using superuser permissions.</string>
<string name="rootExplanation">You need to root your phone for this function to work. Afterwards you needs to \"run the rule manually\" to show up the superuser permission question. When the superuser popups shows up you need to always allow the application to do that. Otherwise the rule cannot function when the phone is unattended.</string>
<string name="rootExplanation">You need to root your phone for this function to work. Afterwards you need to \"run the rule manually\" to show up the superuser permission question. When the superuser popups shows up you need to always allow the application to do that. Otherwise the rule cannot function when the phone is unattended.</string>
<string name="errorWritingConfig">Error writing config. Do you have a writable memory?</string>
<string name="phoneNrReplacementError">I could not insert the last phone nr in the variable. I don\'t have it.</string>
<string name="username">Username</string>
@ -570,7 +570,7 @@
<string name="textMessageAnnotations">You can directly enter a phone number. Alternatively use the contacts option to pick one. But keep in mind: The number will be stored here, not the contact. If you change the phone number of a selected contact you\'ll need to update this rule. It doesn\'t do that by itself.</string>
<string name="importNumberFromContacts">Import number from contacts</string>
<string name="android9RecordAudioNotice">If you\'re using the noise level trigger: Unfortunately beginning with Android 9 (Pie) Google decided to disallow background applications to use the microphone. So this trigger has no effect anymore and won\'t trigger anything.</string>
<string name="android10WifiToggleNotice">Unfortunately Google decided to remove this feature in Android 10. Regular apps are not allowed anymore to turn wifi on or off. This means this action will have no effect on your device.</string>
<string name="android10WifiToggleNotice">Unfortunately Google decided to remove this feature in Android 10. Regular apps are not allowed anymore to turn wifi on or off. Only if your device is rooted it should continue to work. If not, then I\'m afraid this won\'t have an effect anymore.</string>
<string name="messageNotShownAgain">This message won\'t be shown again.</string>
<string name="chooseActivityHint">In this final selection popup you need to select a specific activity. Simplified this is like a window of the desired application. If you do not know which one it is generally a good idea to pick one that has \"main\" or \"launcher\" in its name.</string>
<string name="edit">Edit</string>
@ -691,4 +691,15 @@
<string name="tabsPlacement">Position of tab bar</string>
<string name="tabsPlacementSummary">Choose where the tabs bar should be placed.</string>
<string name="wifiApi30">Because Google screwd up yet another part of Android, starting with API 30 only the currently visible wifis can be displayed. Not all the ones your device knows.</string>
<string name="smsDialogNotice">If you have not used a send-sms action in this program before, Android may show an additional confirmation dialog, asking you to allow sending messages. You need to select the \"always allow\" checkbox and confirm if you want this action to work in the background. It\'s advised to run this rule manually once.</string>
<string name="silentTriggersDnd">REMARK: The silent mode often triggers Do-Not-Disturb on newer devices. If that happens on your device, I recommend using the normal mode instead and lowering all volumes to zero.</string>
<string name="tones">Tones</string>
<string name="miscellaneous">Miscellaneous</string>
<string name="dnd">Do not disturb</string>
<string name="dndOff">DND off</string>
<string name="dndPriority">Let priority notifications through</string>
<string name="dndAlarms">Let alarms through</string>
<string name="dndNothing">Let nothing through</string>
<string name="dndRemarks">Fine tuning (like allowing phone calls, picking specific numbers, etc.) can only be done from the system\'s settings.</string>
<string name="permissionsRequiredNotAvailable">Your rules required permissions which cannot be requested from this installed flavor of Automation.</string>
</resources>

View File

@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.0.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files