Added in API level 31

CarWatchdogManager.ResourceOveruseListener

public static interface CarWatchdogManager.ResourceOveruseListener

android.car.watchdog.CarWatchdogManager.ResourceOveruseListener


Listener to get resource overuse notifications.

Applications implement the listener method to take action and/or log on resource overuse.

Summary

Public methods

abstract void onOveruse(ResourceOveruseStats resourceOveruseStats)

Called when a package either overuses a resource or about to overuse a resource.

Public methods

onOveruse

Added in API level 31
public abstract void onOveruse (ResourceOveruseStats resourceOveruseStats)

Called when a package either overuses a resource or about to overuse a resource.

The listener is called at the executor which is specified in CarWatchdogManager.addResourceOveruseListener(Executor, int, CarWatchdogManager.ResourceOveruseListener) or addResourceOveruseListenerForSystem.

The listener is called only on overusing one of the resources specified at the resourceOveruseFlag in CarWatchdogManager#addResourceOveruseListener or addResourceOveruseListenerForSystem.

Parameters
resourceOveruseStats ResourceOveruseStats: Resource overuse stats containing stats only for resources overuse types that are either overused or about to be overused by the package. Implementations must check for null value in each resource overuse stats before reading the stats.