Skip to content

Commit

Permalink
InputService: init scaling from SharedPreferences
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bk138 committed Jun 12, 2023
1 parent 57f8791 commit c7e1249
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import android.view.ViewConfiguration;
import android.graphics.Path;

import androidx.preference.PreferenceManager;

public class InputService extends AccessibilityService {

/**
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit c7e1249

Please sign in to comment.