From 63b79c8748120296ba1bb91a4f71fd70da4dd153 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Thu, 8 Jun 2023 16:30:23 +0200 Subject: [PATCH] InputService: init scaling from SharedPreferences When we are restarted by the OS after a crash, setScaling() is not called, so set scaling from last known setting instead of leaving it at 0. Closes #113 --- .../main/java/net/christianbeier/droidvnc_ng/InputService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java b/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java index a08b5e57..1fd1ec04 100644 --- a/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java +++ b/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java @@ -27,6 +27,8 @@ import android.view.ViewConfiguration; import android.graphics.Path; +import androidx.preference.PreferenceManager; + public class InputService extends AccessibilityService { /** @@ -79,6 +81,7 @@ public void onServiceConnected() super.onServiceConnected(); instance = this; mMainHandler = new Handler(instance.getMainLooper()); + mScaling = PreferenceManager.getDefaultSharedPreferences(this).getFloat(Constants.PREFS_KEY_SETTINGS_SCALING, new Defaults(this).getScaling()); Log.i(TAG, "onServiceConnected"); }