From 9f5171989012e2fba8089847b9361ed01d341c7e Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Sun, 14 Aug 2022 20:18:00 +0200 Subject: [PATCH] OnBootReceiver: use Extras to convey info to MainService --- .../java/net/christianbeier/droidvnc_ng/OnBootReceiver.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/net/christianbeier/droidvnc_ng/OnBootReceiver.java b/app/src/main/java/net/christianbeier/droidvnc_ng/OnBootReceiver.java index 01c82c90..82b4f63b 100644 --- a/app/src/main/java/net/christianbeier/droidvnc_ng/OnBootReceiver.java +++ b/app/src/main/java/net/christianbeier/droidvnc_ng/OnBootReceiver.java @@ -43,6 +43,11 @@ public void onReceive(Context context, Intent arg1) Log.i(TAG, "onReceive: configured to start"); Intent intent = new Intent(context, MainService.class); intent.setAction(MainService.ACTION_START); + intent.putExtra(MainService.EXTRA_PASSWORD, prefs.getString(Constants.PREFS_KEY_SETTINGS_PASSWORD, Constants.DEFAULT_PASSWORD)); + intent.putExtra(MainService.EXTRA_SCALING, prefs.getFloat(Constants.PREFS_KEY_SETTINGS_SCALING, Constants.DEFAULT_SCALING)); + intent.putExtra(MainService.EXTRA_FILE_TRANSFER, prefs.getBoolean(Constants.PREFS_KEY_SETTINGS_FILE_TRANSFER, Constants.DEFAULT_FILE_TRANSFER)); + intent.putExtra(MainService.EXTRA_VIEW_ONLY, prefs.getBoolean(Constants.PREFS_KEY_SETTINGS_VIEW_ONLY, Constants.DEFAULT_VIEW_ONLY)); + intent.putExtra(MainService.EXTRA_LISTEN_PORT, prefs.getInt(Constants.PREFS_KEY_SETTINGS_PORT_LISTEN, Constants.DEFAULT_PORT_LISTEN)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(intent); } else {