Bug 1512037 - Bail out from prefersReducedMotion() if the target device is Android 4.1 or older. r=snorp a=jcristau
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 11 Dec 2018 23:38:26 +0000
changeset 506194 022e5d97749fbc7d6dc167eebe302610d9f75edc
parent 506193 b0e263db0edfe55fb69c5dd6015f73d6b52a2d23
child 506195 ba961685a318cb2665cc65154e305ca01ef7c615
push id10328
push userarchaeopteryx@coole-files.de
push dateWed, 12 Dec 2018 19:45:38 +0000
treeherdermozilla-beta@022e5d97749f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, jcristau
bugs1512037
milestone65.0
Bug 1512037 - Bail out from prefersReducedMotion() if the target device is Android 4.1 or older. r=snorp a=jcristau Settings.Global can't be used on such devices. Differential Revision: https://phabricator.services.mozilla.com/D14226
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
@@ -79,16 +79,20 @@ public class GeckoSystemStateListener
         initialized = false;
         mInputManager = null;
         mContentObserver = null;
     }
 
     @WrapForJNI(calledFrom = "gecko")
     // For prefers-reduced-motion media queries feature.
     private static boolean prefersReducedMotion() {
+        if (SysInfo.getVersion() < 17) {
+          return false;
+        }
+
         ContentResolver contentResolver = sApplicationContext.getContentResolver();
 
         return Settings.Global.getFloat(contentResolver,
                                         Settings.Global.ANIMATOR_DURATION_SCALE,
                                         1) == 0.0f;
     }
 
     @WrapForJNI(calledFrom = "gecko")