The acquisition of fps can refer to
https://segmentfault.com/a/1190000005089412
The 1013 method in the surfaceflinger service can get the number of frames,
10|root@ge:/ # service call SurfaceFlinger 1013
Result: Parcel(00000b5e '^...')
The service call call directly obtains the parcel print,
Here you can write a method to call the 1013 service, then sleep for 1 second, then take the value and calculate the difference to get the frame rate.