Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee44fae1 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Prevent out of range magnification scale to be persisted.

1. If a bad magnification scale is persisted, i.e. it is
   not between the min and max, the screen magnifier gets
   into a bad state which even a reboot does not fix since
   the scale is persisted in settings.

   This change ensures that only valid scales are presisted.
   In general a bad value should not be attempted to be
   persisted but at this point this is the safest change.

bug:7288239

Change-Id: I3e9c7c091772fa64128ab8403c2127ce65cb94b8
parent 9aefa145
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -376,7 +376,8 @@ public final class ScreenMagnifier implements EventStreamTransformation {
            }
            if (event.getActionMasked() == MotionEvent.ACTION_UP) {
                clear();
                final float scale = mMagnificationController.getScale();
                final float scale = Math.min(Math.max(mMagnificationController.getScale(),
                        MIN_SCALE), MAX_SCALE);
                if (scale != getPersistedScale()) {
                    persistScale(scale);
                }