Autostart error fixed

This commit is contained in:
Jens 2023-01-16 23:44:28 +01:00
parent 52edfa32df
commit a9646cbf28
4 changed files with 12 additions and 5 deletions

View File

@ -111,6 +111,8 @@ import androidx.documentfile.provider.DocumentFile;
public class Miscellaneous extends Service public class Miscellaneous extends Service
{ {
protected static String writeableFolderStringCache = null; protected static String writeableFolderStringCache = null;
public static Context startupContext;
public static final String lineSeparator = System.getProperty("line.separator"); public static final String lineSeparator = System.getProperty("line.separator");
public static String downloadURL(String url, String username, String password) public static String downloadURL(String url, String username, String password)
@ -558,6 +560,9 @@ public class Miscellaneous extends Service
if(returnContext != null) if(returnContext != null)
return returnContext; return returnContext;
if(startupContext != null)
return startupContext;
return null; return null;
} }

View File

@ -11,12 +11,13 @@ import com.jens.automation2.Settings;
public class StartupIntentReceiver extends BroadcastReceiver public class StartupIntentReceiver extends BroadcastReceiver
{ {
@Override @Override
public void onReceive(Context context, Intent intent) public void onReceive(Context context, Intent intent)
{ {
Settings.readFromPersistentStorage(context); Settings.readFromPersistentStorage(context);
Miscellaneous.startupContext = context;
// Miscellaneous.logEvent("i", "Boot event", "Received event: " + intent.getAction(), 5); // Miscellaneous.logEvent("i", "Boot event", "Received event: " + intent.getAction(), 5);
if(Settings.startServiceAtSystemBoot) if(Settings.startServiceAtSystemBoot)

View File

@ -1,2 +1,3 @@
* Fixed: Now allowing negative integers as intent data * Fixed: Now allowing negative integers as intent data
* Fixed: Multiple time frames with reoccurence configured would trigger to early executions * Fixed: Multiple time frames with reoccurence configured would trigger to early executions
* Fixed: Automatic app start at boot might fail in some cases