Notification listener finished.
This commit is contained in:
parent
fb44196a0d
commit
67e6a38ddc
@ -137,12 +137,12 @@
|
||||
<receiver android:name=".receivers.TimeZoneListener" />
|
||||
|
||||
<activity android:name=".ActivityManageRule" />
|
||||
<activity android:name=".ActivityEditTriggerUrl" />
|
||||
<activity android:name=".ActivityManageActionTriggerUrl" />
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityEditSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageTimeFrame" />
|
||||
<activity android:name=".ActivityManageBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
@ -180,10 +180,10 @@
|
||||
<activity android:name=".ActivityMainPoi" />
|
||||
<activity android:name=".ActivityMainRules" />
|
||||
<activity android:name=".ActivityGeneric" />
|
||||
<activity android:name=".ActivityManageStartActivity" />
|
||||
<activity android:name=".ActivityManageNfc" />
|
||||
<activity android:name=".ActivityEditSpeakText" />
|
||||
<activity android:name=".ActivityManageBluetoothTrigger" />
|
||||
<activity android:name=".ActivityManageActionStartActivity" />
|
||||
<activity android:name=".ActivityManageTriggerNfc" />
|
||||
<activity android:name=".ActivityManageActionSpeakText" />
|
||||
<activity android:name=".ActivityManageTriggerBluetooth" />
|
||||
<activity android:name=".ActivityMainProfiles" />
|
||||
<activity android:name=".ActivityManageProfile" />
|
||||
<activity android:name=".ActivityVolumeTest" />
|
||||
@ -218,6 +218,12 @@
|
||||
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name=".FileShareProvider"
|
||||
android:authorities="com.jens.automation2"
|
||||
android:exported="true"
|
||||
/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -132,11 +132,11 @@
|
||||
<receiver android:name=".receivers.TimeZoneListener" />
|
||||
|
||||
<activity android:name=".ActivityManageRule" />
|
||||
<activity android:name=".ActivityEditTriggerUrl" />
|
||||
<activity android:name=".ActivityManageActionTriggerUrl" />
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityEditSendTextMessage" />
|
||||
<activity android:name=".ActivityManageTimeFrame" />
|
||||
<activity android:name=".ActivityManageBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
@ -173,11 +173,11 @@
|
||||
<activity android:name=".ActivityMainPoi" />
|
||||
<activity android:name=".ActivityMainRules" />
|
||||
<activity android:name=".ActivityGeneric" />
|
||||
<activity android:name=".ActivityManageStartActivity" />
|
||||
<activity android:name=".ActivityManageNfc" />
|
||||
<activity android:name=".ActivityEditSpeakText" />
|
||||
<activity android:name=".ActivityManageActionStartActivity" />
|
||||
<activity android:name=".ActivityManageTriggerNfc" />
|
||||
<activity android:name=".ActivityManageActionSpeakText" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageBluetoothTrigger" />
|
||||
<activity android:name=".ActivityManageTriggerBluetooth" />
|
||||
<activity android:name=".ActivityMainProfiles" />
|
||||
<activity android:name=".ActivityManageProfile" />
|
||||
<activity android:name=".ActivityVolumeTest" />
|
||||
@ -196,6 +196,12 @@
|
||||
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
|
||||
<provider
|
||||
android:name=".FileShareProvider"
|
||||
android:authorities="com.jens.automation2"
|
||||
android:exported="true"
|
||||
/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -3,7 +3,9 @@ package com.jens.automation2;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -14,6 +16,7 @@ import com.jens.automation2.receivers.ConnectivityReceiver;
|
||||
import com.jens.automation2.receivers.HeadphoneJackListener;
|
||||
import com.jens.automation2.receivers.NfcReceiver;
|
||||
import com.jens.automation2.receivers.NoiseListener;
|
||||
import com.jens.automation2.receivers.NotificationListener;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
import com.jens.automation2.receivers.ProcessListener;
|
||||
|
||||
@ -22,6 +25,9 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.jens.automation2.Trigger.triggerParameter2Split;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TEXT;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TITLE;
|
||||
|
||||
public class Rule implements Comparable<Rule>
|
||||
{
|
||||
@ -831,6 +837,8 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
private class ActivateRuleTask extends AsyncTask<Object, String, Void>
|
||||
{
|
||||
boolean wasActivated = false;
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Object... params)
|
||||
{
|
||||
@ -863,16 +871,23 @@ public class Rule implements Comparable<Rule>
|
||||
@Override
|
||||
protected void onPostExecute(Void result)
|
||||
{
|
||||
AutomationService.updateNotification();
|
||||
ActivityMainScreen.updateMainScreen();
|
||||
super.onPostExecute(result);
|
||||
/*
|
||||
Only update if the rules was actually executed. Became necessary for the notification trigger. If a user created a rule
|
||||
with a notification trigger and this app creates a notification itself this will otherwise end in an infinite loop.
|
||||
*/
|
||||
if(wasActivated)
|
||||
{
|
||||
AutomationService.updateNotification();
|
||||
ActivityMainScreen.updateMainScreen();
|
||||
super.onPostExecute(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Will activate the rule. Should be called by a separate execution thread
|
||||
* @param automationService
|
||||
*/
|
||||
protected void activateInternally(AutomationService automationService, boolean force)
|
||||
protected boolean activateInternally(AutomationService automationService, boolean force)
|
||||
{
|
||||
boolean isActuallyToggable = isActuallyToggable();
|
||||
|
||||
@ -919,8 +934,11 @@ public class Rule implements Comparable<Rule>
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Rule", "Request to activate rule " + Rule.this.getName() + ", but it is the last one that was activated. Won't do it again.", 3);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void activate(AutomationService automationService, boolean force)
|
||||
|
@ -126,12 +126,12 @@
|
||||
<receiver android:name=".receivers.TimeZoneListener" />
|
||||
|
||||
<activity android:name=".ActivityManageRule" />
|
||||
<activity android:name=".ActivityEditTriggerUrl" />
|
||||
<activity android:name=".ActivityManageActionTriggerUrl" />
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityEditSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageTimeFrame" />
|
||||
<activity android:name=".ActivityManageBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
@ -169,10 +169,10 @@
|
||||
<activity android:name=".ActivityMainPoi" />
|
||||
<activity android:name=".ActivityMainRules" />
|
||||
<activity android:name=".ActivityGeneric" />
|
||||
<activity android:name=".ActivityManageStartActivity" />
|
||||
<activity android:name=".ActivityManageNfc" />
|
||||
<activity android:name=".ActivityEditSpeakText" />
|
||||
<activity android:name=".ActivityManageBluetoothTrigger" />
|
||||
<activity android:name=".ActivityManageActionStartActivity" />
|
||||
<activity android:name=".ActivityManageTriggerNfc" />
|
||||
<activity android:name=".ActivityManageActionSpeakText" />
|
||||
<activity android:name=".ActivityManageTriggerBluetooth" />
|
||||
<activity android:name=".ActivityMainProfiles" />
|
||||
<activity android:name=".ActivityManageProfile" />
|
||||
<activity android:name=".ActivityVolumeTest" />
|
||||
@ -204,6 +204,12 @@
|
||||
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
|
||||
<provider
|
||||
android:name=".FileShareProvider"
|
||||
android:authorities="com.jens.automation2"
|
||||
android:exported="true"
|
||||
/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -3,7 +3,9 @@ package com.jens.automation2;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -16,6 +18,7 @@ import com.jens.automation2.receivers.ConnectivityReceiver;
|
||||
import com.jens.automation2.receivers.HeadphoneJackListener;
|
||||
import com.jens.automation2.receivers.NfcReceiver;
|
||||
import com.jens.automation2.receivers.NoiseListener;
|
||||
import com.jens.automation2.receivers.NotificationListener;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
import com.jens.automation2.receivers.ProcessListener;
|
||||
|
||||
@ -24,6 +27,9 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.jens.automation2.Trigger.triggerParameter2Split;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TEXT;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TITLE;
|
||||
|
||||
public class Rule implements Comparable<Rule>
|
||||
{
|
||||
|
@ -217,11 +217,11 @@ public class Action
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.playSound))
|
||||
{
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound) + ": " + getParameter2());
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound));
|
||||
}
|
||||
else
|
||||
returnString.append(action.toString());
|
||||
|
||||
|
||||
if(this.getAction().equals(Action_Enum.triggerUrl))
|
||||
{
|
||||
String[] components = parameter2.split(";");
|
||||
|
@ -7,9 +7,12 @@ import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.content.res.AssetManager;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
@ -473,7 +476,17 @@ public class Actions
|
||||
MediaPlayer mp = new MediaPlayer();
|
||||
try
|
||||
{
|
||||
mp.setDataSource(soundFileLocation);
|
||||
Uri fileUri = Uri.parse(soundFileLocation);
|
||||
mp.setLooping(false);
|
||||
mp.setDataSource(Miscellaneous.getAnyContext(), fileUri);
|
||||
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
|
||||
{
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp)
|
||||
{
|
||||
mp.release();
|
||||
}
|
||||
});
|
||||
mp.prepare();
|
||||
mp.start();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@ -29,6 +30,8 @@ import com.jens.automation2.AutomationService.serviceCommands;
|
||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
import com.jens.automation2.location.LocationProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
@ -39,7 +42,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
|
||||
private static ActivityMainScreen activityMainScreenInstance = null;
|
||||
private ToggleButton toggleService, tbLockSound;
|
||||
private Button bShowHelp, bPrivacy, bSettingsErase, bSettingsSetToDefault, bVolumeTest, bAddSoundLockTIme;
|
||||
private Button bShowHelp, bPrivacy, bSettingsErase, bSettingsSetToDefault, bVolumeTest, bAddSoundLockTIme, bShareConfigAndLog;
|
||||
private TextView tvActivePoi, tvClosestPoi, tvLastRule, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvlockSoundDuration, tvFileStoreLocation;
|
||||
|
||||
private ListView lvRuleHistory;
|
||||
@ -76,6 +79,9 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
tvlockSoundDuration = (TextView)findViewById(R.id.tvlockSoundDuration);
|
||||
tvFileStoreLocation = (TextView)findViewById(R.id.tvFileStoreLocation);
|
||||
tbLockSound = (ToggleButton) findViewById(R.id.tbLockSound);
|
||||
bVolumeTest = (Button) findViewById(R.id.bVolumeTest);
|
||||
bSettingsSetToDefault = (Button) findViewById(R.id.bSettingsSetToDefault);
|
||||
bShareConfigAndLog = (Button) findViewById(R.id.bShareConfigAndLog);
|
||||
toggleService = (ToggleButton) findViewById(R.id.tbArmMastListener);
|
||||
toggleService.setChecked(AutomationService.isMyServiceRunning(this));
|
||||
toggleService.setOnCheckedChangeListener(new OnCheckedChangeListener()
|
||||
@ -135,7 +141,6 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
}
|
||||
});
|
||||
|
||||
Button bVolumeTest = (Button) findViewById(R.id.bVolumeTest);
|
||||
bVolumeTest.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -179,16 +184,6 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
}
|
||||
});
|
||||
|
||||
/*bSettingsErase = (Button)findViewById(R.id.bSettingsErase);
|
||||
bSettingsErase.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
getEraseSettingsDialog(ActivityMainScreen.this).show();
|
||||
}
|
||||
});*/
|
||||
bSettingsSetToDefault = (Button) findViewById(R.id.bSettingsSetToDefault);
|
||||
bSettingsSetToDefault.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -198,6 +193,15 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
}
|
||||
});
|
||||
|
||||
bShareConfigAndLog.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
getShareConfigAndLogDialogue(ActivityMainScreen.this).show();
|
||||
}
|
||||
});
|
||||
|
||||
lvRuleHistory.setOnTouchListener(new OnTouchListener()
|
||||
{
|
||||
@Override
|
||||
@ -279,6 +283,58 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
AlertDialog getShareConfigAndLogDialogue(final Context context)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
|
||||
alertDialogBuilder.setTitle(context.getResources().getString(R.string.shareConfigAndLogFilesWithDev));
|
||||
alertDialogBuilder.setMessage(context.getResources().getString(R.string.shareConfigAndLogExplanation));
|
||||
alertDialogBuilder.setPositiveButton(context.getResources().getString(R.string.yes), new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
File dstZipFile = new File(Miscellaneous.getAnyContext().getCacheDir() + "/" + Settings.zipFileName);
|
||||
|
||||
ArrayList<String> srcFilesList = new ArrayList<>();
|
||||
srcFilesList.add(Miscellaneous.getWriteableFolder() + "/" + XmlFileInterface.settingsFileName);
|
||||
|
||||
String logFilePath = Miscellaneous.getWriteableFolder() + "/" + Miscellaneous.logFileName;
|
||||
if((new File(logFilePath)).exists())
|
||||
srcFilesList.add(logFilePath);
|
||||
|
||||
String[] srcFiles = srcFilesList.toArray(new String[srcFilesList.size()]);
|
||||
|
||||
if(dstZipFile.exists())
|
||||
dstZipFile.delete();
|
||||
|
||||
Miscellaneous.zip(srcFiles, dstZipFile.getAbsolutePath());
|
||||
|
||||
/*
|
||||
Without root the zip file in the cache directory is not directly accessible.
|
||||
But have to route it through this content provider crap.
|
||||
*/
|
||||
|
||||
String subject = "Automation logs";
|
||||
|
||||
StringBuilder emailBody = new StringBuilder();
|
||||
emailBody.append("Device details" + Miscellaneous.lineSeparator);
|
||||
emailBody.append("OS version: " + System.getProperty("os.version") + Miscellaneous.lineSeparator);
|
||||
emailBody.append("API Level: " + android.os.Build.VERSION.SDK + Miscellaneous.lineSeparator);
|
||||
emailBody.append("Device: " + android.os.Build.DEVICE + Miscellaneous.lineSeparator);
|
||||
emailBody.append("Model: " + android.os.Build.MODEL + Miscellaneous.lineSeparator);
|
||||
emailBody.append("Product: " + android.os.Build.PRODUCT);
|
||||
|
||||
Uri uri = Uri.parse("content://com.jens.automation2/" + Settings.zipFileName);
|
||||
|
||||
Miscellaneous.sendEmail(ActivityMainScreen.this, "android-development@gmx.de", "Automation logs", emailBody.toString(), uri);
|
||||
}
|
||||
});
|
||||
alertDialogBuilder.setNegativeButton(context.getResources().getString(R.string.no), null);
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
public static ActivityMainScreen getActivityMainScreenInstance()
|
||||
{
|
||||
return activityMainScreenInstance;
|
||||
@ -458,7 +514,31 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
|
||||
String folder = Miscellaneous.getWriteableFolder();
|
||||
if(folder != null && folder.length() > 0)
|
||||
{
|
||||
activityMainScreenInstance.tvFileStoreLocation.setText(String.format(activityMainScreenInstance.getResources().getString(R.string.filesStoredAt), folder));
|
||||
activityMainScreenInstance.tvFileStoreLocation.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Uri selectedUri = Uri.parse(folder);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(selectedUri, "resource/folder");
|
||||
|
||||
if (intent.resolveActivityInfo(activityMainScreenInstance.getPackageManager(), 0) != null)
|
||||
{
|
||||
activityMainScreenInstance.startActivity(intent);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if you reach this place, it means there is no any file
|
||||
// explorer app installed on your device
|
||||
Toast.makeText(activityMainScreenInstance, activityMainScreenInstance.getResources().getString(R.string.noFileManageInstalled), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ActivityManageBrightnessSetting extends Activity
|
||||
public class ActivityManageActionBrightnessSetting extends Activity
|
||||
{
|
||||
CheckBox chkAutoBrightness;
|
||||
SeekBar sbBrightness;
|
@ -7,17 +7,20 @@ import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ActivityManageActionPlaySound extends Activity
|
||||
{
|
||||
final static int PICKFILE_RESULT_CODE = 4711;
|
||||
|
||||
CheckBox chkPlaySoundAlwaysPlay;
|
||||
TextView tvSelectedSoundFile;
|
||||
EditText etSelectedSoundFile;
|
||||
Button bSelectSoundFile, bSavePlaySound;
|
||||
|
||||
@Override
|
||||
@ -27,7 +30,7 @@ public class ActivityManageActionPlaySound extends Activity
|
||||
setContentView(R.layout.activity_manage_play_sound);
|
||||
|
||||
chkPlaySoundAlwaysPlay = (CheckBox)findViewById(R.id.chkPlaySoundAlwaysPlay);
|
||||
tvSelectedSoundFile = (TextView)findViewById(R.id.tvSelectedSoundFile);
|
||||
etSelectedSoundFile = (EditText)findViewById(R.id.etSelectedSoundFile);
|
||||
bSelectSoundFile = (Button)findViewById(R.id.bSelectSoundFile);
|
||||
bSavePlaySound = (Button)findViewById(R.id.bSavePlaySound);
|
||||
|
||||
@ -38,7 +41,7 @@ public class ActivityManageActionPlaySound extends Activity
|
||||
boolean param1 = getIntent().getBooleanExtra("actionParameter1", false);
|
||||
String param2 = getIntent().getStringExtra("actionParameter2");
|
||||
chkPlaySoundAlwaysPlay.setChecked(param1);
|
||||
tvSelectedSoundFile.setText(param2);
|
||||
etSelectedSoundFile.setText(param2);
|
||||
}
|
||||
|
||||
bSelectSoundFile.setOnClickListener(new View.OnClickListener()
|
||||
@ -66,15 +69,24 @@ public class ActivityManageActionPlaySound extends Activity
|
||||
|
||||
void savePlaySoundSettings()
|
||||
{
|
||||
if(tvSelectedSoundFile.getText().toString() == null || tvSelectedSoundFile.getText().toString().length() == 0)
|
||||
if(etSelectedSoundFile.getText().toString() == null || etSelectedSoundFile.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionPlaySound.this, getResources().getString(R.string.selectSoundFile), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
File soundFile = new File(etSelectedSoundFile.getText().toString());
|
||||
if(!soundFile.exists())
|
||||
{
|
||||
Toast.makeText(ActivityManageActionPlaySound.this, getResources().getString(R.string.fileDoesNotExist), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Intent returnData = new Intent();
|
||||
returnData.putExtra("actionParameter1", chkPlaySoundAlwaysPlay.isChecked());
|
||||
returnData.putExtra("actionParameter2", tvSelectedSoundFile.getText().toString());
|
||||
returnData.putExtra("actionParameter2", etSelectedSoundFile.getText().toString());
|
||||
|
||||
setResult(RESULT_OK, returnData);
|
||||
finish();
|
||||
@ -90,8 +102,8 @@ public class ActivityManageActionPlaySound extends Activity
|
||||
if(requestCode == PICKFILE_RESULT_CODE)
|
||||
{
|
||||
Uri fileUri = data.getData();
|
||||
String filePath = fileUri.getPath();
|
||||
tvSelectedSoundFile.setText(filePath);
|
||||
String filePath = CompensateCrappyAndroidPaths.getPath(ActivityManageActionPlaySound.this, fileUri);
|
||||
etSelectedSoundFile.setText(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ import androidx.annotation.NonNull;
|
||||
import com.jens.automation2.Action.Action_Enum;
|
||||
|
||||
|
||||
public class ActivityEditSendTextMessage extends Activity
|
||||
public class ActivityManageActionSendTextMessage extends Activity
|
||||
{
|
||||
Button bSaveSendTextMessage, bImportNumberFromContacts;
|
||||
EditText etPhoneNumber, etSendTextMessage;
|
||||
@ -67,7 +67,7 @@ public class ActivityEditSendTextMessage extends Activity
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
if(!ActivityPermissions.havePermission("android.permission.READ_CONTACTS", ActivityEditSendTextMessage.this))
|
||||
if(!ActivityPermissions.havePermission("android.permission.READ_CONTACTS", ActivityManageActionSendTextMessage.this))
|
||||
{
|
||||
requestPermissions("android.permission.READ_CONTACTS");
|
||||
}
|
||||
@ -76,10 +76,10 @@ public class ActivityEditSendTextMessage extends Activity
|
||||
}
|
||||
});
|
||||
|
||||
ActivityEditSendTextMessage.edit = getIntent().getBooleanExtra("edit", false);
|
||||
ActivityManageActionSendTextMessage.edit = getIntent().getBooleanExtra("edit", false);
|
||||
if(edit)
|
||||
{
|
||||
String[] parameters = ActivityEditSendTextMessage.resultingAction.getParameter2().split(Actions.smsSeparator);
|
||||
String[] parameters = ActivityManageActionSendTextMessage.resultingAction.getParameter2().split(Actions.smsSeparator);
|
||||
etPhoneNumber.setText(parameters[0]);
|
||||
etSendTextMessage.setText(parameters[1]);
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class ActivityEditSendTextMessage extends Activity
|
||||
|
||||
if(edit && resultingAction != null)
|
||||
{
|
||||
ActivityEditSendTextMessage.resultingAction.setParameter2(etPhoneNumber.getText().toString() + Actions.smsSeparator + etSendTextMessage.getText().toString());
|
||||
ActivityManageActionSendTextMessage.resultingAction.setParameter2(etPhoneNumber.getText().toString() + Actions.smsSeparator + etSendTextMessage.getText().toString());
|
||||
}
|
||||
|
||||
setResult(RESULT_OK);
|
||||
@ -162,7 +162,7 @@ public class ActivityEditSendTextMessage extends Activity
|
||||
String name = null;
|
||||
|
||||
Uri uri = data.getData();
|
||||
Cursor cursor = ActivityEditSendTextMessage.this.getContentResolver().query(uri, null, null, null, null);
|
||||
Cursor cursor = ActivityManageActionSendTextMessage.this.getContentResolver().query(uri, null, null, null, null);
|
||||
|
||||
if (cursor.moveToFirst())
|
||||
{
|
@ -10,7 +10,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.Action.Action_Enum;
|
||||
|
||||
public class ActivityEditSpeakText extends Activity
|
||||
public class ActivityManageActionSpeakText extends Activity
|
||||
{
|
||||
private Button bSaveSpeakText;
|
||||
private EditText etSpeakText;
|
||||
@ -48,9 +48,9 @@ public class ActivityEditSpeakText extends Activity
|
||||
}
|
||||
});
|
||||
|
||||
ActivityEditSpeakText.edit = getIntent().getBooleanExtra("edit", false);
|
||||
ActivityManageActionSpeakText.edit = getIntent().getBooleanExtra("edit", false);
|
||||
if(edit)
|
||||
etSpeakText.setText(ActivityEditSpeakText.resultingAction.getParameter2());
|
||||
etSpeakText.setText(ActivityManageActionSpeakText.resultingAction.getParameter2());
|
||||
|
||||
|
||||
// String url = getIntent().getStringExtra("urlToTrigger");
|
||||
@ -66,7 +66,7 @@ public class ActivityEditSpeakText extends Activity
|
||||
// setResult(RESULT_OK, returnIntent);
|
||||
|
||||
if(edit && resultingAction != null)
|
||||
ActivityEditSpeakText.resultingAction.setParameter2(etSpeakText.getText().toString());
|
||||
ActivityManageActionSpeakText.resultingAction.setParameter2(etSpeakText.getText().toString());
|
||||
|
||||
setResult(RESULT_OK);
|
||||
|
@ -35,7 +35,7 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityManageStartActivity extends Activity
|
||||
public class ActivityManageActionStartActivity extends Activity
|
||||
{
|
||||
ListView lvIntentPairs;
|
||||
EditText etParameterName, etParameterValue;
|
||||
@ -56,12 +56,12 @@ public class ActivityManageStartActivity extends Activity
|
||||
ApplicationInfo aInfo1 = this.applicationInfo;
|
||||
if (aInfo1 != null)
|
||||
{
|
||||
name1 = (String) ActivityManageStartActivity.this.getPackageManager().getApplicationLabel(aInfo1);
|
||||
name1 = (String) ActivityManageActionStartActivity.this.getPackageManager().getApplicationLabel(aInfo1);
|
||||
}
|
||||
ApplicationInfo aInfo2 = another.applicationInfo;
|
||||
if (aInfo2 != null)
|
||||
{
|
||||
name2 = (String) ActivityManageStartActivity.this.getPackageManager().getApplicationLabel(aInfo2);
|
||||
name2 = (String) ActivityManageActionStartActivity.this.getPackageManager().getApplicationLabel(aInfo2);
|
||||
}
|
||||
|
||||
return name1.compareTo(name2);
|
||||
@ -224,7 +224,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectApplication));
|
||||
final String[] applicationArray = ActivityManageStartActivity.getApplicationNameListString(this);
|
||||
final String[] applicationArray = ActivityManageActionStartActivity.getApplicationNameListString(this);
|
||||
alertDialogBuilder.setItems(applicationArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -242,14 +242,14 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication));
|
||||
final String[] packageArray = ActivityManageStartActivity.getPackageListString(this, applicationName);
|
||||
final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(this, applicationName);
|
||||
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
getActionStartActivityDialog3(packageArray[which]).show();
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageStartActivity.this).show();
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
|
||||
|
||||
}
|
||||
});
|
||||
@ -261,13 +261,13 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectActivityToBeStarted));
|
||||
final String activityArray[] = ActivityManageStartActivity.getActivityListForPackageName(packageName);
|
||||
final String activityArray[] = ActivityManageActionStartActivity.getActivityListForPackageName(packageName);
|
||||
alertDialogBuilder.setItems(activityArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
ActivityInfo ai = ActivityManageStartActivity.getActivityInfoForPackageNameAndActivityName(packageName, activityArray[which]);
|
||||
ActivityInfo ai = ActivityManageActionStartActivity.getActivityInfoForPackageNameAndActivityName(packageName, activityArray[which]);
|
||||
tvSelectedActivity.setText(ai.packageName + ";" + ai.name);
|
||||
}
|
||||
});
|
||||
@ -291,7 +291,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
spinnerParameterType = (Spinner)findViewById(R.id.spinnerParameterType);
|
||||
tvSelectedActivity = (TextView)findViewById(R.id.tvSelectedApplication);
|
||||
|
||||
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageStartActivity.supportedIntentTypes);
|
||||
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionStartActivity.supportedIntentTypes);
|
||||
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
||||
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
||||
|
||||
@ -304,7 +304,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
GetActivityListTask getActivityListTask = new GetActivityListTask();
|
||||
getActivityListTask.execute();
|
||||
progressDialog = ProgressDialog.show(ActivityManageStartActivity.this, "", ActivityManageStartActivity.this.getResources().getString(R.string.gettingListOfInstalledApplications));
|
||||
progressDialog = ProgressDialog.show(ActivityManageActionStartActivity.this, "", ActivityManageActionStartActivity.this.getResources().getString(R.string.gettingListOfInstalledApplications));
|
||||
}
|
||||
});
|
||||
|
||||
@ -316,19 +316,19 @@ public class ActivityManageStartActivity extends Activity
|
||||
// type;name;value
|
||||
if(spinnerParameterType.getSelectedItem().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageStartActivity.this, getResources().getString(R.string.selectTypeOfIntentPair), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.selectTypeOfIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterName.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageStartActivity.this, getResources().getString(R.string.enterNameForIntentPair), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterNameForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterValue.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageStartActivity.this, getResources().getString(R.string.enterValueForIntentPair), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterValueForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -360,7 +360,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
if(saveAction())
|
||||
{
|
||||
ActivityManageStartActivity.this.setResult(RESULT_OK);
|
||||
ActivityManageActionStartActivity.this.setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@ -382,9 +382,9 @@ public class ActivityManageStartActivity extends Activity
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
if(supportedIntentTypes[arg2].equals("double") | supportedIntentTypes[arg2].equals("float") | supportedIntentTypes[arg2].equals("int") | supportedIntentTypes[arg2].equals("long") | supportedIntentTypes[arg2].equals("short"))
|
||||
ActivityManageStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
else
|
||||
ActivityManageStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -436,7 +436,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
{
|
||||
if(tvSelectedActivity.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageStartActivity.this, getResources().getString(R.string.selectApplication), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.selectApplication), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -462,7 +462,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
|
||||
private AlertDialog getIntentPairDialog(final int itemPosition)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ActivityManageStartActivity.this);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ActivityManageActionStartActivity.this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.whatToDoWithIntentPair));
|
||||
alertDialogBuilder.setItems(new String[]{getResources().getString(R.string.delete)}, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@ -470,7 +470,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
// Only 1 choice at the moment, no need to check
|
||||
ActivityManageStartActivity.this.intentPairList.remove(itemPosition);
|
||||
ActivityManageActionStartActivity.this.intentPairList.remove(itemPosition);
|
||||
updateIntentPairList();
|
||||
}
|
||||
});
|
||||
@ -484,7 +484,7 @@ public class ActivityManageStartActivity extends Activity
|
||||
@Override
|
||||
protected Void doInBackground(Void... params)
|
||||
{
|
||||
getActivityList(ActivityManageStartActivity.this);
|
||||
getActivityList(ActivityManageActionStartActivity.this);
|
||||
return null;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import com.jens.automation2.Action.Action_Enum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ActivityEditTriggerUrl extends Activity
|
||||
public class ActivityManageActionTriggerUrl extends Activity
|
||||
{
|
||||
Button bSaveTriggerUrl;
|
||||
EditText etTriggerUrl, etTriggerUrlUsername, etTriggerUrlPassword;
|
||||
@ -70,7 +70,7 @@ public class ActivityEditTriggerUrl extends Activity
|
||||
if(password == null)
|
||||
password = "";
|
||||
|
||||
ActivityEditTriggerUrl.resultingAction.setParameter2(
|
||||
ActivityManageActionTriggerUrl.resultingAction.setParameter2(
|
||||
username + ";" +
|
||||
password + ";" +
|
||||
etTriggerUrl.getText().toString().trim()
|
||||
@ -110,16 +110,16 @@ public class ActivityEditTriggerUrl extends Activity
|
||||
updateListView();
|
||||
|
||||
|
||||
ActivityEditTriggerUrl.edit = getIntent().getBooleanExtra("edit", false);
|
||||
ActivityManageActionTriggerUrl.edit = getIntent().getBooleanExtra("edit", false);
|
||||
if(edit)
|
||||
{
|
||||
// username,password,URL
|
||||
String[] components = ActivityEditTriggerUrl.resultingAction.getParameter2().split(";");
|
||||
String[] components = ActivityManageActionTriggerUrl.resultingAction.getParameter2().split(";");
|
||||
|
||||
if(components.length >= 3)
|
||||
{
|
||||
etTriggerUrl.setText(components[2]);
|
||||
chkTriggerUrlUseAuthentication.setChecked(ActivityEditTriggerUrl.resultingAction.getParameter1());
|
||||
chkTriggerUrlUseAuthentication.setChecked(ActivityManageActionTriggerUrl.resultingAction.getParameter1());
|
||||
etTriggerUrlUsername.setText(components[0]);
|
||||
etTriggerUrlPassword.setText(components[1]);
|
||||
}
|
||||
@ -141,9 +141,9 @@ public class ActivityEditTriggerUrl extends Activity
|
||||
if(password == null)
|
||||
password = "";
|
||||
|
||||
ActivityEditTriggerUrl.resultingAction.setParameter1(chkTriggerUrlUseAuthentication.isChecked());
|
||||
ActivityManageActionTriggerUrl.resultingAction.setParameter1(chkTriggerUrlUseAuthentication.isChecked());
|
||||
|
||||
ActivityEditTriggerUrl.resultingAction.setParameter2(
|
||||
ActivityManageActionTriggerUrl.resultingAction.setParameter2(
|
||||
username + ";" +
|
||||
password + ";" +
|
||||
etTriggerUrl.getText().toString()
|
@ -237,8 +237,8 @@ public class ActivityManageRule extends Activity
|
||||
// case speed:
|
||||
// break;
|
||||
case timeFrame:
|
||||
ActivityManageTimeFrame.editedTimeFrameTrigger = selectedTrigger;
|
||||
Intent timeFrameEditor = new Intent(ActivityManageRule.this, ActivityManageTimeFrame.class);
|
||||
ActivityManageTriggerTimeFrame.editedTimeFrameTrigger = selectedTrigger;
|
||||
Intent timeFrameEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerTimeFrame.class);
|
||||
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeEdit);
|
||||
break;
|
||||
// case usb_host_connection:
|
||||
@ -246,8 +246,8 @@ public class ActivityManageRule extends Activity
|
||||
// case wifiConnection:
|
||||
// break;
|
||||
case bluetoothConnection:
|
||||
ActivityManageBluetoothTrigger.editedBluetoothTrigger = selectedTrigger;
|
||||
Intent bluetoothEditor = new Intent(ActivityManageRule.this, ActivityManageBluetoothTrigger.class);
|
||||
ActivityManageTriggerBluetooth.editedBluetoothTrigger = selectedTrigger;
|
||||
Intent bluetoothEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerBluetooth.class);
|
||||
startActivityForResult(bluetoothEditor, requestCodeTriggerBluetoothEdit);
|
||||
break;
|
||||
case notification:
|
||||
@ -298,15 +298,15 @@ public class ActivityManageRule extends Activity
|
||||
// case setAirplaneMode:
|
||||
// break;
|
||||
case startOtherActivity:
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageStartActivity.class);
|
||||
ActivityManageStartActivity.resultingAction = a;
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
|
||||
ActivityManageActionStartActivity.resultingAction = a;
|
||||
intent.putExtra("edit", true);
|
||||
startActivityForResult(intent, requestCodeActionStartActivityEdit);
|
||||
break;
|
||||
case triggerUrl:
|
||||
Intent activityEditTriggerUrlIntent = new Intent(ActivityManageRule.this, ActivityEditTriggerUrl.class);
|
||||
Intent activityEditTriggerUrlIntent = new Intent(ActivityManageRule.this, ActivityManageActionTriggerUrl.class);
|
||||
// activityEditTriggerUrlIntent.putExtra("urlToTrigger", a.getParameter2());
|
||||
ActivityEditTriggerUrl.resultingAction = a;
|
||||
ActivityManageActionTriggerUrl.resultingAction = a;
|
||||
activityEditTriggerUrlIntent.putExtra("edit", true);
|
||||
startActivityForResult(activityEditTriggerUrlIntent, requestCodeActionTriggerUrlEdit);
|
||||
break;
|
||||
@ -331,19 +331,19 @@ public class ActivityManageRule extends Activity
|
||||
// case wakeupDevice:
|
||||
// break;
|
||||
case speakText:
|
||||
Intent activitySpeakTextIntent = new Intent(ActivityManageRule.this, ActivityEditSpeakText.class);
|
||||
ActivityEditSpeakText.resultingAction = a;
|
||||
Intent activitySpeakTextIntent = new Intent(ActivityManageRule.this, ActivityManageActionSpeakText.class);
|
||||
ActivityManageActionSpeakText.resultingAction = a;
|
||||
activitySpeakTextIntent.putExtra("edit", true);
|
||||
startActivityForResult(activitySpeakTextIntent, requestCodeActionSpeakTextEdit);
|
||||
break;
|
||||
case sendTextMessage:
|
||||
Intent activitySendTextMessageIntent = new Intent(ActivityManageRule.this, ActivityEditSendTextMessage.class);
|
||||
ActivityEditSendTextMessage.resultingAction = a;
|
||||
Intent activitySendTextMessageIntent = new Intent(ActivityManageRule.this, ActivityManageActionSendTextMessage.class);
|
||||
ActivityManageActionSendTextMessage.resultingAction = a;
|
||||
activitySendTextMessageIntent.putExtra("edit", true);
|
||||
startActivityForResult(activitySendTextMessageIntent, requestCodeActionSendTextMessage);
|
||||
break;
|
||||
case setScreenBrightness:
|
||||
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageBrightnessSetting.class);
|
||||
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageActionBrightnessSetting.class);
|
||||
// ActivityEditTriggerUrl.resultingAction = a;
|
||||
activityEditScreenBrightnessIntent.putExtra("autoBrightness", a.getParameter1());
|
||||
activityEditScreenBrightnessIntent.putExtra("brightnessValue", Integer.parseInt(a.getParameter2()));
|
||||
@ -540,8 +540,8 @@ public class ActivityManageRule extends Activity
|
||||
else if(triggerType == Trigger_Enum.timeFrame)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.timeFrame);
|
||||
ActivityManageTimeFrame.editedTimeFrameTrigger = newTrigger;
|
||||
Intent timeFrameEditor = new Intent(myContext, ActivityManageTimeFrame.class);
|
||||
ActivityManageTriggerTimeFrame.editedTimeFrameTrigger = newTrigger;
|
||||
Intent timeFrameEditor = new Intent(myContext, ActivityManageTriggerTimeFrame.class);
|
||||
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeAdd);
|
||||
return;
|
||||
}
|
||||
@ -598,7 +598,7 @@ public class ActivityManageRule extends Activity
|
||||
if(NfcReceiver.checkNfcRequirements(ActivityManageRule.this, true))
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.nfcTag);
|
||||
Intent nfcEditor = new Intent(myContext, ActivityManageNfc.class);
|
||||
Intent nfcEditor = new Intent(myContext, ActivityManageTriggerNfc.class);
|
||||
startActivityForResult(nfcEditor, requestCodeTriggerNfcTagAdd);
|
||||
return;
|
||||
}
|
||||
@ -609,8 +609,8 @@ public class ActivityManageRule extends Activity
|
||||
Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();;
|
||||
|
||||
newTrigger.setTriggerType(Trigger_Enum.bluetoothConnection);
|
||||
ActivityManageBluetoothTrigger.editedBluetoothTrigger = newTrigger;
|
||||
Intent bluetoothEditor = new Intent(myContext, ActivityManageBluetoothTrigger.class);
|
||||
ActivityManageTriggerBluetooth.editedBluetoothTrigger = newTrigger;
|
||||
Intent bluetoothEditor = new Intent(myContext, ActivityManageTriggerBluetooth.class);
|
||||
startActivityForResult(bluetoothEditor, requestCodeTriggerBluetoothAdd);
|
||||
return;
|
||||
}
|
||||
@ -1005,7 +1005,7 @@ public class ActivityManageRule extends Activity
|
||||
protected String[] doInBackground(ActivityManageRule... params)
|
||||
{
|
||||
// Looper.prepare();
|
||||
final String[] applicationArray = ActivityManageStartActivity.getApplicationNameListString(params[0]);
|
||||
final String[] applicationArray = ActivityManageActionStartActivity.getApplicationNameListString(params[0]);
|
||||
return applicationArray;
|
||||
}
|
||||
|
||||
@ -1052,7 +1052,7 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(myContext);
|
||||
alertDialogBuilder.setTitle(myContext.getResources().getString(R.string.selectPackageOfApplication));
|
||||
final String[] packageArray = ActivityManageStartActivity.getPackageListString(myContext, applicationName);
|
||||
final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(myContext, applicationName);
|
||||
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -1072,7 +1072,7 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(myContext);
|
||||
alertDialogBuilder.setTitle(myContext.getResources().getString(R.string.selectActivityToBeStarted));
|
||||
final String activityArray[] = ActivityManageStartActivity.getActivityListForPackageName(packageName);
|
||||
final String activityArray[] = ActivityManageActionStartActivity.getActivityListForPackageName(packageName);
|
||||
alertDialogBuilder.setItems(activityArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -1100,7 +1100,7 @@ public class ActivityManageRule extends Activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
//add TriggerUrl
|
||||
ruleToEdit.getActionSet().add(ActivityEditTriggerUrl.resultingAction);
|
||||
ruleToEdit.getActionSet().add(ActivityManageActionTriggerUrl.resultingAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
@ -1115,7 +1115,7 @@ public class ActivityManageRule extends Activity
|
||||
else if(requestCode == requestCodeTriggerTimeframeAdd)
|
||||
{
|
||||
//add TimeFrame
|
||||
if(resultCode == RESULT_OK && ActivityManageTimeFrame.editedTimeFrameTrigger != null)
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null)
|
||||
{
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
this.refreshTriggerList();
|
||||
@ -1126,7 +1126,7 @@ public class ActivityManageRule extends Activity
|
||||
else if(requestCode == requestCodeTriggerTimeframeEdit)
|
||||
{
|
||||
//edit TimeFrame
|
||||
if(resultCode == RESULT_OK && ActivityManageTimeFrame.editedTimeFrameTrigger != null)
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null)
|
||||
{
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
@ -1138,7 +1138,7 @@ public class ActivityManageRule extends Activity
|
||||
// manage start of other activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction = ActivityManageStartActivity.resultingAction;
|
||||
newAction = ActivityManageActionStartActivity.resultingAction;
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
@ -1148,7 +1148,7 @@ public class ActivityManageRule extends Activity
|
||||
// manage start of other activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction = ActivityManageStartActivity.resultingAction;
|
||||
newAction = ActivityManageActionStartActivity.resultingAction;
|
||||
// ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
@ -1156,9 +1156,9 @@ public class ActivityManageRule extends Activity
|
||||
else if(requestCode == requestCodeTriggerNfcTagAdd)
|
||||
{
|
||||
//add TimeFrame
|
||||
if(resultCode == RESULT_OK && ActivityManageNfc.generatedId != null)
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerNfc.generatedId != null)
|
||||
{
|
||||
newTrigger.setNfcTagId(ActivityManageNfc.generatedId);
|
||||
newTrigger.setNfcTagId(ActivityManageTriggerNfc.generatedId);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
@ -1198,7 +1198,7 @@ public class ActivityManageRule extends Activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
//add SpeakText
|
||||
ruleToEdit.getActionSet().add(ActivityEditSpeakText.resultingAction);
|
||||
ruleToEdit.getActionSet().add(ActivityManageActionSpeakText.resultingAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
@ -1207,14 +1207,14 @@ public class ActivityManageRule extends Activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
//add SpeakText
|
||||
ruleToEdit.getActionSet().add(ActivityEditSendTextMessage.resultingAction);
|
||||
ruleToEdit.getActionSet().add(ActivityManageActionSendTextMessage.resultingAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerBluetoothAdd)
|
||||
{
|
||||
//add bluetooth trigger
|
||||
if(resultCode == RESULT_OK && ActivityManageBluetoothTrigger.editedBluetoothTrigger != null)
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerBluetooth.editedBluetoothTrigger != null)
|
||||
{
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
this.refreshTriggerList();
|
||||
@ -1225,7 +1225,7 @@ public class ActivityManageRule extends Activity
|
||||
else if(requestCode == requestCodeTriggerBluetoothEdit)
|
||||
{
|
||||
//edit bluetooth trigger
|
||||
if(resultCode == RESULT_OK && ActivityManageBluetoothTrigger.editedBluetoothTrigger != null)
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerBluetooth.editedBluetoothTrigger != null)
|
||||
{
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
@ -1260,7 +1260,7 @@ public class ActivityManageRule extends Activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParameter1(data.getBooleanExtra("actionParameter1", false));
|
||||
newAction.setParameter2(String.valueOf(data.getIntExtra("actionParameter2", 0)));
|
||||
newAction.setParameter2(data.getStringExtra("actionParameter2"));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
@ -1273,7 +1273,7 @@ public class ActivityManageRule extends Activity
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra("actionParameter1", false));
|
||||
|
||||
if(data.hasExtra("actionParameter2"))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(String.valueOf(data.getIntExtra("actionParameter2", 0)));
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra("actionParameter2"));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
@ -1374,8 +1374,8 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
//launch other activity to enter a url and parameters;
|
||||
newAction.setAction(Action_Enum.triggerUrl);
|
||||
ActivityEditTriggerUrl.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityEditTriggerUrl.class);
|
||||
ActivityManageActionTriggerUrl.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityManageActionTriggerUrl.class);
|
||||
startActivityForResult(editTriggerIntent, 1000);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifi.toString()))
|
||||
@ -1422,7 +1422,7 @@ public class ActivityManageRule extends Activity
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.startOtherActivity.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.startOtherActivity);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageStartActivity.class);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
|
||||
startActivityForResult(intent, 3000);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.waitBeforeNextAction.toString()))
|
||||
@ -1455,8 +1455,8 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
//launch other activity to enter a url and parameters;
|
||||
newAction.setAction(Action_Enum.speakText);
|
||||
ActivityEditSpeakText.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityEditSpeakText.class);
|
||||
ActivityManageActionSpeakText.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityManageActionSpeakText.class);
|
||||
startActivityForResult(editTriggerIntent, 5000);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.sendTextMessage.toString()))
|
||||
@ -1466,8 +1466,8 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
//launch other activity to enter parameters;
|
||||
newAction.setAction(Action_Enum.sendTextMessage);
|
||||
ActivityEditSendTextMessage.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityEditSendTextMessage.class);
|
||||
ActivityManageActionSendTextMessage.resultingAction = null;
|
||||
Intent editTriggerIntent = new Intent(context, ActivityManageActionSendTextMessage.class);
|
||||
startActivityForResult(editTriggerIntent, 5001);
|
||||
}
|
||||
}
|
||||
@ -1480,7 +1480,7 @@ public class ActivityManageRule extends Activity
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setScreenBrightness.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.setScreenBrightness);
|
||||
Intent actionScreenBrightnessIntent = new Intent(context, ActivityManageBrightnessSetting.class);
|
||||
Intent actionScreenBrightnessIntent = new Intent(context, ActivityManageActionBrightnessSetting.class);
|
||||
startActivityForResult(actionScreenBrightnessIntent, requestCodeActionScreenBrightnessAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.playSound.toString()))
|
||||
|
@ -16,7 +16,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.receivers.BluetoothReceiver;
|
||||
|
||||
public class ActivityManageBluetoothTrigger extends Activity
|
||||
public class ActivityManageTriggerBluetooth extends Activity
|
||||
{
|
||||
protected static Trigger editedBluetoothTrigger;
|
||||
RadioButton radioAnyBluetoothDevice, radioNoDevice, radioDeviceFromList, radioBluetoothConnected, radioBluetoothDisconnected, radioBluetoothInRange, radioBluetoothOutRange;
|
||||
@ -109,7 +109,7 @@ public class ActivityManageBluetoothTrigger extends Activity
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.makeText(ActivityManageBluetoothTrigger.this, getResources().getString(R.string.selectDeviceOption), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerBluetooth.this, getResources().getString(R.string.selectDeviceOption), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ public class ActivityManageBluetoothTrigger extends Activity
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.makeText(ActivityManageBluetoothTrigger.this, getResources().getString(R.string.selectConnectionOption), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerBluetooth.this, getResources().getString(R.string.selectConnectionOption), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import android.widget.Toast;
|
||||
import com.jens.automation2.receivers.NfcReceiver;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class ActivityManageNfc extends Activity
|
||||
public class ActivityManageTriggerNfc extends Activity
|
||||
{
|
||||
public static String generatedId = null;
|
||||
private static Tag discoveredTag = null;
|
||||
@ -39,7 +39,7 @@ public class ActivityManageNfc extends Activity
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.manage_nfc);
|
||||
setContentView(R.layout.activity_manage_trigger_nfc);
|
||||
|
||||
etNewNfcIdValue = (EditText)findViewById(R.id.etNewNfcIdValue);
|
||||
bReadNfcTag = (Button)findViewById(R.id.bReadNfcTag);
|
||||
@ -59,7 +59,7 @@ public class ActivityManageNfc extends Activity
|
||||
}
|
||||
else
|
||||
{
|
||||
progressDialog = ProgressDialog.show(ActivityManageNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
progressDialog = ProgressDialog.show(ActivityManageTriggerNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
{
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog)
|
||||
@ -88,7 +88,7 @@ public class ActivityManageNfc extends Activity
|
||||
}
|
||||
else
|
||||
{
|
||||
progressDialog = ProgressDialog.show(ActivityManageNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
progressDialog = ProgressDialog.show(ActivityManageTriggerNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
{
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog)
|
||||
@ -118,7 +118,7 @@ public class ActivityManageNfc extends Activity
|
||||
}
|
||||
else
|
||||
{
|
||||
progressDialog = ProgressDialog.show(ActivityManageNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
progressDialog = ProgressDialog.show(ActivityManageTriggerNfc.this, null, getResources().getString(R.string.nfcBringTagIntoRange), false, true, new OnCancelListener()
|
||||
{
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog)
|
||||
@ -255,7 +255,7 @@ public class ActivityManageNfc extends Activity
|
||||
if(generatedId.length() == 0)
|
||||
{
|
||||
generatedId = null;
|
||||
Toast.makeText(ActivityManageNfc.this, getResources().getString(R.string.nfcEnterValidIdentifier), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerNfc.this, getResources().getString(R.string.nfcEnterValidIdentifier), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@ -267,14 +267,14 @@ public class ActivityManageNfc extends Activity
|
||||
if(NfcReceiver.writeTag(generatedId, discoveredTag))
|
||||
{
|
||||
currentStatus = 0;
|
||||
Toast.makeText(ActivityManageNfc.this, getResources().getString(R.string.nfcTagWrittenSuccessfully), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerNfc.this, getResources().getString(R.string.nfcTagWrittenSuccessfully), Toast.LENGTH_LONG).show();
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentStatus = 0;
|
||||
Toast.makeText(ActivityManageNfc.this, getResources().getString(R.string.nfcTagWriteError), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerNfc.this, getResources().getString(R.string.nfcTagWriteError), Toast.LENGTH_LONG).show();
|
||||
Miscellaneous.logEvent("e", "NFC", getResources().getString(R.string.nfcTagWriteError), 2);
|
||||
}
|
||||
}
|
||||
@ -285,14 +285,14 @@ public class ActivityManageNfc extends Activity
|
||||
if(checkEnteredText(false))
|
||||
{
|
||||
currentStatus = 0;
|
||||
Toast.makeText(ActivityManageNfc.this, getResources().getString(R.string.nfcTagReadSuccessfully), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerNfc.this, getResources().getString(R.string.nfcTagReadSuccessfully), Toast.LENGTH_LONG).show();
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentStatus = 0;
|
||||
Toast.makeText(ActivityManageNfc.this, getResources().getString(R.string.nfcValueNotSuitable), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityManageTriggerNfc.this, getResources().getString(R.string.nfcValueNotSuitable), Toast.LENGTH_LONG).show();
|
||||
generatedId = null;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ import java.sql.Time;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class ActivityManageTimeFrame extends Activity
|
||||
public class ActivityManageTriggerTimeFrame extends Activity
|
||||
{
|
||||
Button bSaveTimeFrame;
|
||||
TimePicker startPicker, stopPicker;
|
@ -244,6 +244,12 @@ public class ActivityPermissions extends Activity
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
else if(s.equalsIgnoreCase("android.permission.ACTIVITY_RECOGNITION") || s.equalsIgnoreCase("com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
|
||||
{
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("fdroidFlavor"))
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
@ -302,12 +308,15 @@ public class ActivityPermissions extends Activity
|
||||
// if (!havePermission(ActivityPermissions.writeExternalStoragePermissionName, workingContext))
|
||||
// addToArrayListUnique(ActivityPermissions.writeExternalStoragePermissionName, requiredPermissions);
|
||||
|
||||
for(Profile profile : Profile.getProfileCollection())
|
||||
if(!havePermission(writeSystemSettingsPermissionName, workingContext))
|
||||
{
|
||||
if(profile.changeIncomingCallsRingtone)
|
||||
{
|
||||
addToArrayListUnique("android.permission.WRITE_SETTINGS", requiredPermissions);
|
||||
}
|
||||
for (Profile profile : Profile.getProfileCollection())
|
||||
{
|
||||
if (profile.changeIncomingCallsRingtone)
|
||||
{
|
||||
addToArrayListUnique(writeSystemSettingsPermissionName, requiredPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!onlyGeneral)
|
||||
@ -329,6 +338,11 @@ public class ActivityPermissions extends Activity
|
||||
if (!Miscellaneous.googleToBlameForLocation(true))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
else if(singlePermission.equalsIgnoreCase("android.permission.ACTIVITY_RECOGNITION") || singlePermission.equalsIgnoreCase("com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
|
||||
{
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("fdroidFlavor"))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
else
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ public class CompensateCrappyAndroidPaths
|
||||
* @param uri The Uri to query.
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
public static String getPath(final Context context, final Uri uri) {
|
||||
public static String getPath(final Context context, final Uri uri)
|
||||
{
|
||||
// check here to KITKAT or new version
|
||||
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
||||
String selection = null;
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.security.Provider;
|
||||
|
||||
public class FileShareProvider extends ContentProvider
|
||||
{
|
||||
@Override
|
||||
public boolean onCreate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getType(@NonNull Uri uri)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Uri insert(@NonNull Uri uri, @Nullable ContentValues values)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException
|
||||
{
|
||||
File cacheDir = getContext().getCacheDir();
|
||||
File privateFile = new File(cacheDir, Settings.zipFileName);
|
||||
|
||||
return ParcelFileDescriptor.open(privateFile, ParcelFileDescriptor.MODE_READ_ONLY);
|
||||
}
|
||||
}
|
@ -22,6 +22,7 @@ import android.provider.MediaStore;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.location.LocationProvider;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
@ -42,6 +43,8 @@ import org.w3c.dom.Element;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
@ -71,6 +74,9 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Scanner;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
@ -84,11 +90,12 @@ import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import static android.provider.CalendarContract.CalendarCache.URI;
|
||||
import static com.jens.automation2.AutomationService.NOTIFICATION_CHANNEL_ID;
|
||||
import static com.jens.automation2.AutomationService.channelName;
|
||||
|
||||
public class Miscellaneous extends Service
|
||||
{
|
||||
{
|
||||
protected static String writeableFolderStringCache = null;
|
||||
public static final String lineSeparator = System.getProperty("line.separator");
|
||||
|
||||
@ -1226,4 +1233,98 @@ public class Miscellaneous extends Service
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void zip(String[] _files, String zipFileName)
|
||||
{
|
||||
int BUFFER = 2048;
|
||||
try
|
||||
{
|
||||
BufferedInputStream origin = null;
|
||||
FileOutputStream dest = new FileOutputStream(zipFileName);
|
||||
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
|
||||
dest));
|
||||
byte data[] = new byte[BUFFER];
|
||||
|
||||
for (int i = 0; i < _files.length; i++)
|
||||
{
|
||||
Log.v("Compress", "Adding: " + _files[i]);
|
||||
FileInputStream fi = new FileInputStream(_files[i]);
|
||||
origin = new BufferedInputStream(fi, BUFFER);
|
||||
|
||||
ZipEntry entry = new ZipEntry(_files[i].substring(_files[i].lastIndexOf("/") + 1));
|
||||
out.putNextEntry(entry);
|
||||
int count;
|
||||
|
||||
while ((count = origin.read(data, 0, BUFFER)) != -1)
|
||||
{
|
||||
out.write(data, 0, count);
|
||||
}
|
||||
origin.close();
|
||||
}
|
||||
|
||||
out.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void unzip(String _zipFile, String _targetLocation)
|
||||
{
|
||||
int BUFFER = 2048;
|
||||
|
||||
try
|
||||
{
|
||||
FileInputStream fin = new FileInputStream(_zipFile);
|
||||
ZipInputStream zin = new ZipInputStream(fin);
|
||||
ZipEntry ze = null;
|
||||
while ((ze = zin.getNextEntry()) != null)
|
||||
{
|
||||
//create dir if required while unzipping
|
||||
if (ze.isDirectory())
|
||||
{
|
||||
// dirChecker(ze.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
FileOutputStream fout = new FileOutputStream(_targetLocation + ze.getName());
|
||||
for (int c = zin.read(); c != -1; c = zin.read())
|
||||
{
|
||||
fout.write(c);
|
||||
}
|
||||
|
||||
zin.closeEntry();
|
||||
fout.close();
|
||||
}
|
||||
|
||||
}
|
||||
zin.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendEmail(Context context, String targetAddress, String subject, String message, Uri fileAttachment)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
emailIntent.setType("plain/text");
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{targetAddress});
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
|
||||
if (fileAttachment != null)
|
||||
{
|
||||
emailIntent.putExtra(Intent.EXTRA_STREAM, fileAttachment);
|
||||
}
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
|
||||
context.startActivity(Intent.createChooser(emailIntent, "Sending email..."));
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
Toast.makeText(context, "Request failed try again: "+ t.toString(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
@ -68,7 +68,13 @@ public class News
|
||||
Calendar now = Calendar.getInstance();
|
||||
String newsContent;
|
||||
|
||||
String filePath = context.getFilesDir() + "/appNews.xml";
|
||||
String newsFileName = "appNews.xml";
|
||||
|
||||
String filePath = context.getCacheDir() + "/" + newsFileName;
|
||||
|
||||
File oldFilePath = new File(context.getFilesDir() + "/" + newsFileName);
|
||||
if(oldFilePath.exists())
|
||||
oldFilePath.delete();
|
||||
|
||||
if (!(new File(filePath)).exists() || Settings.lastNewsPolltime == -1 || now.getTimeInMillis() >= Settings.lastNewsPolltime + (long)(Settings.newsDisplayForXDays * 24 * 60 * 60 * 1000))
|
||||
{
|
||||
@ -80,14 +86,14 @@ public class News
|
||||
{
|
||||
Settings.lastNewsPolltime = now.getTimeInMillis();
|
||||
Settings.writeSettings(context);
|
||||
Miscellaneous.logEvent("i", "appNews.xml", "File stored to " + filePath, 5);
|
||||
Miscellaneous.logEvent("i", newsFileName, "File stored to " + filePath, 5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just read local cache file
|
||||
newsContent = Miscellaneous.readFileToString(filePath);
|
||||
Miscellaneous.logEvent("i", "appNews.xml", "Using cache to retrieve news: " + filePath, 5);
|
||||
Miscellaneous.logEvent("i", newsFileName, "Using cache to retrieve news: " + filePath, 5);
|
||||
}
|
||||
|
||||
ArrayList<News> returnList = new ArrayList<>();
|
||||
|
@ -16,6 +16,7 @@ public class Settings implements SharedPreferences
|
||||
public static final int newsPollEveryXDays = 3;
|
||||
public static final int newsDisplayForXDays = 3;
|
||||
public static final String folderName = "Automation";
|
||||
public static final String zipFileName = "automation.zip";
|
||||
|
||||
public static final String constNewsOptInDone ="newsOptInDone";
|
||||
|
||||
|
@ -379,7 +379,7 @@ public class XmlFileInterface
|
||||
}
|
||||
catch (XmlPullParserException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
catch(FileNotFoundException e)
|
||||
{
|
||||
@ -394,12 +394,12 @@ public class XmlFileInterface
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@ -534,11 +534,11 @@ public class XmlFileInterface
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -751,13 +751,11 @@ public class XmlFileInterface
|
||||
}
|
||||
catch (XmlPullParserException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
else if (name.equals("ActionCollection"))
|
||||
@ -768,13 +766,11 @@ public class XmlFileInterface
|
||||
}
|
||||
catch (XmlPullParserException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Miscellaneous.logEvent("e", "XmlFileInterface", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -865,42 +861,45 @@ public class XmlFileInterface
|
||||
if (name.equals("TriggerEvent"))
|
||||
{
|
||||
String triggerEventString = readTag(parser, "TriggerEvent");
|
||||
if(triggerEventString.equals("pointOfInterest"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.pointOfInterest);
|
||||
else if(triggerEventString.equals("timeFrame"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.timeFrame);
|
||||
else if(triggerEventString.equals("charging"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.charging);
|
||||
else if(triggerEventString.equals("usb_host_connection"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.usb_host_connection);
|
||||
else if(triggerEventString.equals("batteryLevel"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.batteryLevel);
|
||||
else if(triggerEventString.equals("speed"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.speed);
|
||||
else if(triggerEventString.equals("noiseLevel"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.noiseLevel);
|
||||
else if(triggerEventString.equals("wifiConnection"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.wifiConnection);
|
||||
else if(triggerEventString.equals("process_started_stopped") | triggerEventString.equals("process_running"))
|
||||
// if(triggerEventString.equals("pointOfInterest"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.pointOfInterest);
|
||||
// else if(triggerEventString.equals("timeFrame"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.timeFrame);
|
||||
// else if(triggerEventString.equals("charging"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.charging);
|
||||
// else if(triggerEventString.equals("usb_host_connection"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.usb_host_connection);
|
||||
// else if(triggerEventString.equals("batteryLevel"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.batteryLevel);
|
||||
// else if(triggerEventString.equals("speed"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.speed);
|
||||
// else if(triggerEventString.equals("noiseLevel"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.noiseLevel);
|
||||
// else if(triggerEventString.equals("wifiConnection"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.wifiConnection);
|
||||
// else
|
||||
if(triggerEventString.equals("process_started_stopped") | triggerEventString.equals("process_running"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.process_started_stopped);
|
||||
else if(triggerEventString.equals("airplaneMode"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.airplaneMode);
|
||||
else if(triggerEventString.equals("roaming"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.roaming);
|
||||
else if(triggerEventString.equals("phoneCall"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.phoneCall);
|
||||
else if(triggerEventString.equals("nfcTag"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.nfcTag);
|
||||
else if(triggerEventString.equals("notification"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
else if(triggerEventString.equals("activityDetection"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.activityDetection);
|
||||
else if(triggerEventString.equals("bluetoothConnection"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.bluetoothConnection);
|
||||
else if(triggerEventString.equals("headsetPlugged"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.headsetPlugged);
|
||||
else if(triggerEventString.equals("notification"))
|
||||
newTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
// else if(triggerEventString.equals("airplaneMode"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.airplaneMode);
|
||||
// else if(triggerEventString.equals("roaming"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.roaming);
|
||||
// else if(triggerEventString.equals("phoneCall"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.phoneCall);
|
||||
// else if(triggerEventString.equals("nfcTag"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.nfcTag);
|
||||
// else if(triggerEventString.equals("notification"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
// else if(triggerEventString.equals("activityDetection"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.activityDetection);
|
||||
// else if(triggerEventString.equals("bluetoothConnection"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.bluetoothConnection);
|
||||
// else if(triggerEventString.equals("headsetPlugged"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.headsetPlugged);
|
||||
// else if(triggerEventString.equals("notification"))
|
||||
// newTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
else
|
||||
newTrigger.setTriggerType(Trigger_Enum.valueOf(triggerEventString));
|
||||
}
|
||||
else if (name.equals("TriggerParameter1"))
|
||||
{
|
||||
@ -1080,19 +1079,20 @@ public class XmlFileInterface
|
||||
{
|
||||
String actionNameString = readTag(parser, "ActionName");
|
||||
|
||||
if(actionNameString.equals("setWifi"))
|
||||
newAction.setAction(Action_Enum.setWifi);
|
||||
else if(actionNameString.equals("setBluetooth"))
|
||||
newAction.setAction(Action_Enum.setBluetooth);
|
||||
else if(actionNameString.equals("setUsbTethering"))
|
||||
newAction.setAction(Action_Enum.setUsbTethering);
|
||||
else if(actionNameString.equals("setWifiTethering"))
|
||||
newAction.setAction(Action_Enum.setWifiTethering);
|
||||
else if(actionNameString.equals("setDisplayRotation"))
|
||||
newAction.setAction(Action_Enum.setDisplayRotation);
|
||||
// if(actionNameString.equals("setWifi"))
|
||||
// newAction.setAction(Action_Enum.setWifi);
|
||||
// else if(actionNameString.equals("setBluetooth"))
|
||||
// newAction.setAction(Action_Enum.setBluetooth);
|
||||
// else if(actionNameString.equals("setUsbTethering"))
|
||||
// newAction.setAction(Action_Enum.setUsbTethering);
|
||||
// else if(actionNameString.equals("setWifiTethering"))
|
||||
// newAction.setAction(Action_Enum.setWifiTethering);
|
||||
// else if(actionNameString.equals("setDisplayRotation"))
|
||||
// newAction.setAction(Action_Enum.setDisplayRotation);
|
||||
|
||||
// *** deprecated
|
||||
else if(actionNameString.equals("turnWifiOn"))
|
||||
//else
|
||||
if(actionNameString.equals("turnWifiOn"))
|
||||
newAction.setAction(Action_Enum.turnWifiOn);
|
||||
else if(actionNameString.equals("turnWifiOff"))
|
||||
newAction.setAction(Action_Enum.turnWifiOff);
|
||||
@ -1114,28 +1114,30 @@ public class XmlFileInterface
|
||||
newAction.setAction(Action_Enum.disableScreenRotation);
|
||||
// *** deprecated
|
||||
|
||||
else if(actionNameString.equals("triggerUrl"))
|
||||
newAction.setAction(Action_Enum.triggerUrl);
|
||||
else if(actionNameString.equals("changeSoundProfile"))
|
||||
newAction.setAction(Action_Enum.changeSoundProfile);
|
||||
else if(actionNameString.equals("startOtherActivity"))
|
||||
newAction.setAction(Action_Enum.startOtherActivity);
|
||||
else if(actionNameString.equals("waitBeforeNextAction"))
|
||||
newAction.setAction(Action_Enum.waitBeforeNextAction);
|
||||
else if(actionNameString.equals("wakeupDevice"))
|
||||
newAction.setAction(Action_Enum.wakeupDevice);
|
||||
else if(actionNameString.equals("setAirplaneMode"))
|
||||
newAction.setAction(Action_Enum.setAirplaneMode);
|
||||
else if(actionNameString.equals("setDataConnection"))
|
||||
newAction.setAction(Action_Enum.setDataConnection);
|
||||
else if(actionNameString.equals("speakText"))
|
||||
newAction.setAction(Action_Enum.speakText);
|
||||
else if(actionNameString.equals("sendTextMessage"))
|
||||
newAction.setAction(Action_Enum.sendTextMessage);
|
||||
else if(actionNameString.equals("playMusic"))
|
||||
newAction.setAction(Action_Enum.playMusic);
|
||||
else if(actionNameString.equals("setScreenBrightness"))
|
||||
newAction.setAction(Action_Enum.setScreenBrightness);
|
||||
// else if(actionNameString.equals("triggerUrl"))
|
||||
// newAction.setAction(Action_Enum.triggerUrl);
|
||||
// else if(actionNameString.equals("changeSoundProfile"))
|
||||
// newAction.setAction(Action_Enum.changeSoundProfile);
|
||||
// else if(actionNameString.equals("startOtherActivity"))
|
||||
// newAction.setAction(Action_Enum.startOtherActivity);
|
||||
// else if(actionNameString.equals("waitBeforeNextAction"))
|
||||
// newAction.setAction(Action_Enum.waitBeforeNextAction);
|
||||
// else if(actionNameString.equals("wakeupDevice"))
|
||||
// newAction.setAction(Action_Enum.wakeupDevice);
|
||||
// else if(actionNameString.equals("setAirplaneMode"))
|
||||
// newAction.setAction(Action_Enum.setAirplaneMode);
|
||||
// else if(actionNameString.equals("setDataConnection"))
|
||||
// newAction.setAction(Action_Enum.setDataConnection);
|
||||
// else if(actionNameString.equals("speakText"))
|
||||
// newAction.setAction(Action_Enum.speakText);
|
||||
// else if(actionNameString.equals("sendTextMessage"))
|
||||
// newAction.setAction(Action_Enum.sendTextMessage);
|
||||
// else if(actionNameString.equals("playMusic"))
|
||||
// newAction.setAction(Action_Enum.playMusic);
|
||||
// else if(actionNameString.equals("setScreenBrightness"))
|
||||
// newAction.setAction(Action_Enum.setScreenBrightness);
|
||||
else
|
||||
newAction.setAction(Action_Enum.valueOf(actionNameString));
|
||||
}
|
||||
else if (name.equals("ActionParameter1"))
|
||||
{
|
||||
|
@ -24,8 +24,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/alwaysPlayExplanation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSelectedSoundFile"
|
||||
<EditText
|
||||
android:id="@+id/etSelectedSoundFile"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
@ -376,6 +376,13 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bShareConfigAndLog"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/shareConfigAndLogFilesWithDev" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -10,6 +10,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/notification"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginBottom="@dimen/default_margin" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -79,7 +86,7 @@
|
||||
android:text="@string/title" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@ -108,7 +115,7 @@
|
||||
android:text="@string/text" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
<CheckBoxPreference
|
||||
android:key="writeLogFile"
|
||||
android:summary="@string/onOff"
|
||||
android:title="@string/writeLogFileToSd" />
|
||||
android:title="@string/writeLogFile" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="logLevel"
|
||||
|
@ -98,7 +98,7 @@
|
||||
<string name="generalSettings">Allgemeine Einstellungen</string>
|
||||
<string name="startAtSystemBoot">Beim Gerätestart mitstarten</string>
|
||||
<string name="onOff">Ein/aus</string>
|
||||
<string name="writeLogFileToSd">Protokoll auf SD Karte schreiben</string>
|
||||
<string name="writeLogFile">Protokoll schreiben</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">TTS auf normal</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">TTS auf vibration</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">TTS auf stumm</string>
|
||||
@ -603,4 +603,35 @@
|
||||
<string name="directionStringStartsWith">beginnt mit</string>
|
||||
<string name="directionStringEndsWith">endet mit</string>
|
||||
<string name="directionStringNotEquals">ist nicht gleich</string>
|
||||
<string name="positioningEngine">Ortungsroutine</string>
|
||||
<string name="googleSarcasm">Dank Google\'s unendlicher Weisheit und konstantem Unterfangen jederman\'s Privatsphäre zu schützen (Sarkasmus) müssen Auslöser und Aktionen, die SMS oder den Telefoniestatus betreffen, entfernt werden.</string>
|
||||
<string name="screenLockSoundNotice">Die Töne bei der Bildschirmsperre können ab Android 6 nicht mehr verändert werden. Was immer Sie hier einstellen, wird voraussichtlich nicht mehr funktionieren.</string>
|
||||
<string name="googleLocationChicaneryOld">Diese Anwendung sammelt Positionsdaten, um festzustellen, ob Sie sich gerade an einem der Orte aufhalten, die Sie definiert haben. Außerdem wird es benutzt, um Ihre Geschwindigkeit zu ermitteln, falls Sie diese in Regeln verwenden. Das wird auch dann gemacht, wenn das Programm nicht im Vordergrund ist (aber nur, wenn der Dienst aktiv ist).</string>
|
||||
<string name="error">Fehler</string>
|
||||
<string name="featureNotInFdroidVersion">Diese Funktion basiert auf nicht-freier Software (Google Bibliotheken). Daher ist sie in der F-Droid Version nicht verfügbar.</string>
|
||||
<string name="settingsReferringToRestrictedFeatures">Ihre Einstellungen und Regeln verwenden derzeit nicht-freie Funktionen (Google Bibliotheken). Diese sind in der F-Droid Version nicht funktionsfähig. Das schließt die Erkennung Ihrer gegenwärtigen körperlichen Aktivität ein.</string>
|
||||
<string name="displayNewsOnMainScreen">Nachrichten auf dem Hauptbildschirm anzeigen</string>
|
||||
<string name="displayNewsOnMainScreenDescription">Nachrichten ausschließlich über diese Anwendung, wir sprechen von 1-2 pro Jahr, nicht mehr.</string>
|
||||
<string name="newsOptIn">Möchten Sie wichtige Nachrichten über diese Anwendung auf dem Hauptbildschirm angezeigt bekommen? Diese werden von der Webseite des Entwicklers heruntergeladen. Es gibt keine aufdringliche Benachrichtigung, etc., lediglich eine stille Anzeige auf dem Hauptbildschirm.</string>
|
||||
<string name="locationDisabled">Ortung deaktiviert</string>
|
||||
<string name="notification">Benachrichtigung</string>
|
||||
<string name="title">Titel</string>
|
||||
<string name="text">Text</string>
|
||||
<string name="anyApp">Irgendeine Anwendung</string>
|
||||
<string name="postsNotification">%1$s zeigt eine Benachrichtung an</string>
|
||||
<string name="removedNotification">Benachrichtigung von %1$s wurde entfernt</string>
|
||||
<string name="notificationAppears">Benachrichtigung wird angezeigt</string>
|
||||
<string name="notificationDisappears">Benachrichtigung wird entfernt</string>
|
||||
<string name="direction">Richtung</string>
|
||||
<string name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">Systembenachrichtigungen lesen</string>
|
||||
<string name="playSound">Tondatei abspielen</string>
|
||||
<string name="alwaysPlay">immer abspielen</string>
|
||||
<string name="selectSoundFile">Tondatei auswählen</string>
|
||||
<string name="fileDoesNotExist">Datei existiert nicht.</string>
|
||||
<string name="noFileManageInstalled">Kein Dateimanager installiert.</string>
|
||||
<string name="alwaysPlayExplanation">Wenn diese Einstellung aktiv ist, wird der Ton immer abgespielt. Wenn die Einstellung inaktiv ist, wird der Ton nur dann abgespielt, wenn das Telefon weder auf stumm noch auf Vibration steht, d.h. Klingeltöne aktiv sind. Allerdings hat es keinen Einfluß auf die Medien-Lautstärke. D.h., wenn diese stumm ist, werden Sie so oder so nichts zu hören bekommen.</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Konfigurations- und Logdatei mit Entwickler teilen (via email).</string>
|
||||
<string name="shareConfigAndLogExplanation">Dies wird eine neue Email öffnen mit Konfigurations- und Logdateien als Zip-Anhang. Sie wird nicht automatisch versendet. D.h. Sie können so z.B. auch den Adressaten zu sich selbst ändern.</string>
|
||||
<string name="notificationTriggerExplanation">Dieser Auslöser reagiert auf Benachrichtigungen anderer Anwendung im Benachrichtigungsbereich von Android (oder wenn diese geschlossen werden). Sie können eine bestimmte Anwendung festlegen, von die Nachricht stammen muß. Wenn nicht, zählt jede Benachrichtigung. Sie können auch Zeichenketten für Titel oder Nachrichteninhalt festlegen, die enthalten sein müssen. Die Groß-/Kleinschreibung wird hierbei nicht berücksichtigt.</string>
|
||||
<string name="ruleActivationComplete">Regel \"%1$s\" wurde fertig ausgeführt.</string>
|
||||
</resources>
|
@ -98,7 +98,7 @@
|
||||
<string name="generalSettings">General settings</string>
|
||||
<string name="startAtSystemBoot">Start at system boot</string>
|
||||
<string name="onOff">On/Off</string>
|
||||
<string name="writeLogFileToSd">Write log file to SD card</string>
|
||||
<string name="writeLogFile">Write log file</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">Use TextToSpeech on normal</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">Use TextToSpeech on vibrate</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">Use TextToSpeech on silent</string>
|
||||
|
@ -562,7 +562,7 @@ Selezionare su “Continua” quando si è pronti a procedere.</string>
|
||||
<string name="wifiState">Stato Wifi</string>
|
||||
<string name="with">con</string>
|
||||
<string name="withLabel">con etichetta</string>
|
||||
<string name="writeLogFileToSd">Memorizza un file di log su SD card</string>
|
||||
<string name="writeLogFile">Memorizza un file di log</string>
|
||||
<string name="writingSettingsToPersistentMemory">Scrivo le impostazioni nella memoria di massa.</string>
|
||||
<string name="yes">Si</string>
|
||||
<string name="edit">Elaborare</string>
|
||||
|
@ -98,7 +98,7 @@
|
||||
<string name="generalSettings">General settings</string>
|
||||
<string name="startAtSystemBoot">Start at system boot</string>
|
||||
<string name="onOff">On/Off</string>
|
||||
<string name="writeLogFileToSd">Write log file to SD card</string>
|
||||
<string name="writeLogFile">Write log file</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">Use TextToSpeech on normal</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">Use TextToSpeech on vibrate</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">Use TextToSpeech on silent</string>
|
||||
@ -601,7 +601,7 @@
|
||||
<string name="manageLocations">Create or edit locations</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="featureNotInFdroidVersion">This feature is based on non-free software. Therefore is is not available in the F-Droid version.</string>
|
||||
<string name="settingsReferringToRestrictedFeatures">Your settings and or rules are currently referencing non-free features that cannot be provided in the F-Droid version.</string>
|
||||
<string name="settingsReferringToRestrictedFeatures">Your settings and or rules are currently referencing non-free features that cannot be provided in the F-Droid version. That includes detecting your current physical activity.</string>
|
||||
<string name="publishedOn">published on</string>
|
||||
<string name="displayNewsOnMainScreen">Display application news on main screen</string>
|
||||
<string name="displayNewsOnMainScreenDescription">Announcements about this app only, we\'re probably talking about 1-2 per year, not more.</string>
|
||||
@ -610,7 +610,7 @@
|
||||
<string name="locationDisabled">Location disabled</string>
|
||||
<string name="locationEngineDisabledShort">Location cannot be determined anymore. Click here to find out why.</string>
|
||||
<string name="locationEngineDisabledLong">Unfortunately your location cannot be determined anymore. A debt of gratitude is owed to Google for its infinite wisdom and amiableness.\\n\\nLet me explain this further. Starting with Android 10 a new permission was introduced that is needed to determine your location in the background (which of course is required for an app like this). Whilst I consider that a good idea in general the chicanery it involves for developers are not.\\n\\nWhen developing an app you can try to qualify for this permission by abiding to a catalog of requirements. Unfortunately new versions of my app have been rejected over a period of three months. I fulfilled all these requirements, Google\'s shitty development support claimed I would not. After giving them proof that I did after all - I got a response like \"I cannot help you anymore\". Eventually I gave up. \\n\\nAs a consequence the Google Play version can NOT use your location as a trigger anymore. My only alternative option would have been to have this application removed from the store entirely.\\n\\nI\'m very sorry about that, but I\'ve tried my best arguing with a \"support\" that repeatedly failed to pass the Turing test.\\n\\nThe good news: You can still have it all!\\n\\nAutomation is now open source and can be found in F-Droid. That is an app store that really cares about your privacy - rather than just acting like that. Simply backup your config file, uninstall this app, install it again from F-Droid, restore your config file - done.\\n\\nClick here to find out more:</string>
|
||||
<string name="filesStoredAt">Config and log files are stored in folder %1$s</string>
|
||||
<string name="filesStoredAt">Config and log files are stored in folder %1$s. Click on this text to open a file explorer. Unfortunately this will only work with a rooted device or a debug version. If you want to send me or yourself the config- and logfiles you can use the below button.</string>
|
||||
<string name="notification">Notification</string>
|
||||
<string name="title">Title</string>
|
||||
<string name="text">Text</string>
|
||||
@ -620,7 +620,7 @@
|
||||
<string name="directionStringEndsWith">ends with</string>
|
||||
<string name="directionStringNotEquals">not equals</string>
|
||||
<string name="anyApp">Any app</string>
|
||||
<string name="notificationTriggerExplanation">This trigger will respond to other applications opening notifications in the notification area. You can specify another application from which the notification has to come from. If you don\'t the notifications from any other application will count.\nYou can also specify strings that must be or must not be in the notification title or notification body.</string>
|
||||
<string name="notificationTriggerExplanation">This trigger will respond to other applications opening notifications in the notification area (or such being closed). You can specify another application from which the notification has to come from. If you don\'t the notifications from any other application will count. You can also specify strings that must be or must not be in their title or notification body. The comparison is done case-INsensitive.</string>
|
||||
<string name="postsNotification">%1$s posts notification</string>
|
||||
<string name="removedNotification">notification from %1$s removed</string>
|
||||
<string name="notificationAppears">Notification appears</string>
|
||||
@ -629,6 +629,10 @@
|
||||
<string name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">Read system notifications</string>
|
||||
<string name="playSound">Play sound</string>
|
||||
<string name="alwaysPlay">always play</string>
|
||||
<string name="alwaysPlayExplanation">If this settings is active the sound will always be played. If it is deactivated it will only play if your phone is neither on mute nor vibrate.\nHowever if active it will not have an effect on the volume. So if your phone is on ring mode it will not increase the media volume for example.</string>
|
||||
<string name="alwaysPlayExplanation">If this settings is active the sound will always be played. If it is deactivated it will only play if your phone is neither on mute nor vibrate. However if active it will not have an effect on the volume. So if your phone is on ring mode it will not increase the media volume for example. So if media volume is on mute you won\'t hear anything either.</string>
|
||||
<string name="selectSoundFile">Select sound file</string>
|
||||
<string name="fileDoesNotExist">File does not exist.</string>
|
||||
<string name="noFileManageInstalled">No file manager installed.</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Share config and log files with developer (via email).</string>
|
||||
<string name="shareConfigAndLogExplanation">This will start a new email with your config and log files attached as zip file. It will not be sent automatically, you still need to hit \"send\". You can also change the recipient to yourself for example.</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user