Bug 1512037 - Bail out from prefersReducedMotion() if the target device is Android 4.1 or older. r=snorp a=jcristau
☠☠ backed out by b0e263db0edf ☠ ☠
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 11 Dec 2018 23:38:26 +0000
changeset 508959 ac3f8e63166b4db25b3c979f5a7f4bf0827698e4
parent 508958 7d2f238b93e57bd65203e1f56225524774cea89c
child 508960 468d6e8418c7247f7972208c32e829636953a8ba
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [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 (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+          return false;
+        }
+
         ContentResolver contentResolver = sApplicationContext.getContentResolver();
 
         return Settings.Global.getFloat(contentResolver,
                                         Settings.Global.ANIMATOR_DURATION_SCALE,
                                         1) == 0.0f;
     }
 
     @WrapForJNI(calledFrom = "gecko")