android – Alternative to the deprecated FileObserver constructor for API level

According to the documentation, both FileObserver(path: String!) and FileObserver(path: String!, mask: Int) are deprecated (I don’t know when). However, all other constructors were only added in API 29 (10/Q) and I’m trying to support from API 19 (4/KitKat) onwards.

What will be the alternative to monitor a file once these two constructors get removed in later APIs?