public static boolean isLocationRequired(final Context context) {
        final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
        return preferences.getBoolean(PREFS_LOCATION_NOT_REQUIRED, isWithinMarshmallowAndR());
    }
Location enabled is required on some phones running Android Marshmallow or newer (for example on Nexus and Pixel devices).

@param context the context
@return false if it is known that location is not required, true otherwise
app/src/main/java/no/nordicsemi/android/nrfmesh/utils/Utils.java