Backed out changeset 491709a630ef (bug 1544517) for geckoview failures
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Tue, 30 Apr 2019 07:55:35 +0300
changeset 530687 ad1f76c891a3bf85e961fb811a73c58cabecacea
parent 530686 ebbfc83259094cb4ef11929388172e78d20c30a4
child 530688 d49e716056f8835ac626f1bb9e6aaf2844c545fb
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1544517
milestone68.0a1
backs out491709a630ef1fab61c5d33bd46b918996c08a7a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 491709a630ef (bug 1544517) for geckoview failures
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
modules/libpref/init/all.js
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
@@ -1,25 +1,20 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.geckoview;
 
-import org.mozilla.gecko.GeckoAppShell;
-import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.annotation.WrapForJNI;
 import org.mozilla.gecko.mozglue.JNIObject;
 import org.mozilla.gecko.util.GeckoBundle;
 import org.mozilla.gecko.util.ThreadUtils;
 
-import android.app.UiModeManager;
-import android.content.Context;
-import android.content.res.Configuration;
 import android.graphics.Rect;
 import android.os.SystemClock;
 import android.support.annotation.NonNull;
 import android.support.annotation.UiThread;
 import android.support.annotation.IntDef;
 import android.util.Log;
 import android.util.Pair;
 import android.view.MotionEvent;
@@ -31,24 +26,22 @@ import java.lang.annotation.RetentionPol
 import java.util.ArrayList;
 
 @UiThread
 public class PanZoomController {
     private static final String LOGTAG = "GeckoNPZC";
     private static final int EVENT_SOURCE_SCROLL = 0;
     private static final int EVENT_SOURCE_MOTION = 1;
     private static final int EVENT_SOURCE_MOUSE = 2;
-    private static final String PREF_MOUSE_AS_TOUCH = "ui.android.mouse_as_touch";
 
     private final GeckoSession mSession;
     private final Rect mTempRect = new Rect();
     private boolean mAttached;
     private float mPointerScrollFactor = 64.0f;
     private long mLastDownTime;
-    private boolean mTreatMouseAsTouch;
 
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({SCROLL_BEHAVIOR_SMOOTH, SCROLL_BEHAVIOR_AUTO})
     /* package */ @interface ScrollBehaviorType {}
 
     /**
      * Specifies smooth scrolling which animates content to the desired scroll position.
      */
@@ -230,42 +223,16 @@ public class PanZoomController {
 
         return mNative.handleMouseEvent(event.getActionMasked(), event.getEventTime(),
                                         event.getMetaState(), x, y, event.getButtonState());
     }
 
     protected PanZoomController(final GeckoSession session) {
         mSession = session;
         enableEventQueue();
-        initMouseAsTouch();
-    }
-
-    private void initMouseAsTouch() {
-        mTreatMouseAsTouch = true;
-
-        PrefsHelper.PrefHandler prefHandler = new PrefsHelper.PrefHandlerBase() {
-            @Override
-            public void prefValue(final String pref, final int value) {
-                if (!PREF_MOUSE_AS_TOUCH.equals(pref)) {
-                    return;
-                }
-                if (value == 0) {
-                    mTreatMouseAsTouch = false;
-                } else if (value == 1) {
-                    mTreatMouseAsTouch = true;
-                } else if (value == 2) {
-                    Context c = GeckoAppShell.getApplicationContext();
-                    UiModeManager m = (UiModeManager)c.getSystemService(Context.UI_MODE_SERVICE);
-                    // on TV devices, treat mouse as touch. everywhere else, don't
-                    mTreatMouseAsTouch = (m.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION);
-                }
-            }
-        };
-        PrefsHelper.addObserver(new String[] { PREF_MOUSE_AS_TOUCH }, prefHandler);
-        PrefsHelper.getPref(PREF_MOUSE_AS_TOUCH, prefHandler);
     }
 
     /**
      * Set the current scroll factor. The scroll factor is the maximum scroll amount that
      * one scroll event may generate, in device pixels.
      *
      * @param factor Scroll factor.
      */
@@ -289,20 +256,16 @@ public class PanZoomController {
      * "touch" rather than as "mouse". Pointer coordinates should be relative to the
      * display surface.
      *
      * @param event MotionEvent to process.
      * @return True if the event was handled.
      */
     public boolean onTouchEvent(final @NonNull MotionEvent event) {
         ThreadUtils.assertOnUiThread();
-
-        if (!mTreatMouseAsTouch && event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) {
-            return handleMouseEvent(event);
-        }
         return handleMotionEvent(event);
     }
 
     /**
      * Process a touch event through the pan-zoom controller. Treat any mouse events as
      * "mouse" rather than as "touch". Pointer coordinates should be relative to the
      * display surface.
      *
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -279,18 +279,16 @@ pref("dom.script_loader.binast_encoding.
 pref("dom.window.event.enabled", true);
 
 // Fastback caching - if this pref is negative, then we calculate the number
 // of content viewers to cache based on the amount of available memory.
 pref("browser.sessionhistory.max_total_viewers", -1);
 
 pref("ui.use_native_colors", true);
 pref("ui.click_hold_context_menus", false);
-// 0 = false, 1 = true, 2 = autodetect.
-pref("ui.android.mouse_as_touch", 1);
 
 // Pop up context menu on mouseup instead of mousedown, if that's the OS default.
 // Note: ignored on Windows (context menus always use mouseup)
 pref("ui.context_menus.after_mouseup", false);
 // Duration of timeout of incremental search in menus (ms).  0 means infinite.
 pref("ui.menu.incremental_search.timeout", 1000);
 // If true, all popups won't hide automatically on blur
 pref("ui.popup.disable_autohide", false);