"get rotation rate" doesn't work on my old phone(Android)

It worked well when I use 4.12, but after I updated to 4.19 it doesn’t work. Actually, it works but mostly prints(0,0,0) and only catches the censor value twice or three times in ten frames(tick?). I tested the other device but had same problem. Is there any way to solve this problem?