Many fixes
This commit is contained in:
@ -1053,7 +1053,7 @@ public class Actions
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherActivity", "Starting other Activity...", 4);
|
||||
|
||||
String params[];
|
||||
String[] params;
|
||||
|
||||
if(param.contains(Action.actionParameter2Split))
|
||||
params = param.split(Action.actionParameter2Split, -1);
|
||||
@ -1113,7 +1113,7 @@ public class Actions
|
||||
externalApplicationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
// Pack intents
|
||||
if(params.length >= 4)
|
||||
if(params.length >= 5)
|
||||
{
|
||||
if(Miscellaneous.isNumeric(startupType))
|
||||
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 4);
|
||||
|
@ -243,7 +243,7 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
updateNotification();
|
||||
|
||||
if (isMainActivityRunning(this))
|
||||
if(isMainActivityRunning(this))
|
||||
ActivityMainScreen.updateMainScreen();
|
||||
|
||||
this.isRunning = true;
|
||||
@ -543,42 +543,6 @@ public class AutomationService extends Service implements OnInitListener
|
||||
centralInstance = null;
|
||||
Settings.serviceStartDone = false;
|
||||
}
|
||||
|
||||
protected static Builder createDefaultNotificationBuilderOld()
|
||||
{
|
||||
Builder builder = new Builder(AutomationService.getInstance());
|
||||
builder.setContentTitle("Automation");
|
||||
|
||||
if(Settings.showIconWhenServiceIsRunning)
|
||||
{
|
||||
if(BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_googleplay))
|
||||
builder.setSmallIcon(R.drawable.crane);
|
||||
else
|
||||
builder.setSmallIcon(R.drawable.ic_launcher);
|
||||
}
|
||||
|
||||
builder.setCategory(Notification.CATEGORY_SERVICE);
|
||||
builder.setWhen(System.currentTimeMillis());
|
||||
builder.setContentIntent(myPendingIntent);
|
||||
|
||||
Notification defaultNotification = builder.build();
|
||||
|
||||
defaultNotification.icon = R.drawable.crane;
|
||||
defaultNotification.when = System.currentTimeMillis();
|
||||
|
||||
// defaultNotification.defaults |= Notification.DEFAULT_VIBRATE;
|
||||
// defaultNotification.defaults |= Notification.DEFAULT_LIGHTS;
|
||||
|
||||
defaultNotification.flags |= Notification.FLAG_AUTO_CANCEL;
|
||||
// defaultNotification.flags |= Notification.FLAG_SHOW_LIGHTS;
|
||||
defaultNotification.flags |= Notification.FLAG_ONLY_ALERT_ONCE;
|
||||
|
||||
// defaultNotification.ledARGB = Color.YELLOW;
|
||||
// defaultNotification.ledOnMS = 1500;
|
||||
// defaultNotification.ledOffMS = 1500;
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
protected static NotificationCompat.Builder createServiceNotificationBuilder()
|
||||
{
|
||||
@ -628,6 +592,9 @@ public class AutomationService extends Service implements OnInitListener
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void updateNotification()
|
||||
{
|
||||
if(!Settings.showIconWhenServiceIsRunning && Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
||||
return;
|
||||
|
||||
AutomationService instance = getInstance();
|
||||
|
||||
if(instance != null)
|
||||
|
Reference in New Issue
Block a user