Freigeben über


UsageStatsManager.AppStandbyBucket Property

Definition

Returns the current standby bucket of the calling app.

public Android.App.Usage.StandbyBucket AppStandbyBucket { [Android.Runtime.Register("getAppStandbyBucket", "()I", "", ApiSince=28)] get; }
[<get: Android.Runtime.Register("getAppStandbyBucket", "()I", "", ApiSince=28)>]
member this.AppStandbyBucket : Android.App.Usage.StandbyBucket

Property Value

the current standby bucket of the calling app. One of STANDBY_BUCKET_* constants.

Attributes

Remarks

Returns the current standby bucket of the calling app. The system determines the standby state of the app based on app usage patterns. Standby buckets determine how much an app will be restricted from running background tasks such as jobs and alarms.

Restrictions increase progressively from #STANDBY_BUCKET_ACTIVE to #STANDBY_BUCKET_RESTRICTED, with #STANDBY_BUCKET_ACTIVE being the least restrictive. The battery level of the device might also affect the restrictions.

Apps in buckets &le; #STANDBY_BUCKET_ACTIVE have no standby restrictions imposed. Apps in buckets &gt; #STANDBY_BUCKET_FREQUENT may have network access restricted when running in the background.

The standby state of an app can change at any time either due to a user interaction or a system interaction or some algorithm determining that the app can be restricted for a period of time before the user has a need for it.

You can also query the recent history of standby bucket changes by calling #queryEventsForSelf(long, long) and searching for UsageEvents.Event#STANDBY_BUCKET_CHANGED.

Java documentation for android.app.usage.UsageStatsManager.getAppStandbyBucket().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to