Is it possible to determine whether mobile data usage is over and restricted by Android API?
When I checked the source of the framework for the configuration application and restriction dialog display
I think I can refer to it by using isOverLimit(), a NetworkPolicy class that can be retrieved from NetworkPolicyManager.getNetworkPolicy().
Both the NetworkPolicyManager class and the NetworkPolicy class are public, but because of the @hide class, it is not a public API, and the hurdle seems to be high.
I think it is possible to use it by using reflection, but it is not a legitimate method, so I don't think the Android version will guarantee it to work.
© 2024 OneMinuteCode. All rights reserved.