Bug 1512037 - Bail out from prefersReducedMotion() if the target device is Android 4.1 or older. r=snorp

Settings.Global can't be used on such devices.

Differential Revision: https://phabricator.services.mozilla.com/D14226

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2018-12-11 23:38:26 +00:00
Родитель 1b85c280bd
Коммит 6bebce8600
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -91,6 +91,10 @@ public class GeckoSystemStateListener
* Uses `Settings.Global` which was introduced in API version 17.
*/
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,