Freigeben über


PowerManager Class

Definition

This class lets you query and request control of aspects of the device's power state.

[Android.Runtime.Register("android/os/PowerManager", DoNotGenerateAcw=true)]
public class PowerManager : Java.Lang.Object
[<Android.Runtime.Register("android/os/PowerManager", DoNotGenerateAcw=true)>]
type PowerManager = class
    inherit Object
Inheritance
PowerManager
Attributes

Remarks

This class lets you query and request control of aspects of the device's power state.

Java documentation for android.os.PowerManager.

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.

Constructors

PowerManager(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ActionDeviceIdleModeChanged

Intent that is broadcast when the state of #isDeviceIdleMode() changes.

ActionDeviceLightIdleModeChanged

Intent that is broadcast when the state of #isDeviceLightIdleMode() changes.

ActionLowPowerStandbyEnabledChanged

Intent that is broadcast when Low Power Standby is enabled or disabled.

ActionLowPowerStandbyPolicyChanged

Intent that is broadcast when Low Power Standby policy is changed.

ActionPowerSaveModeChanged

Intent that is broadcast when the state of #isPowerSaveMode() changes.

FeatureWakeOnLanInLowPowerStandby

Signals that wake-on-lan/wake-on-wlan is allowed in Low Power Standby.

LowPowerStandbyAllowedReasonOngoingCall
Obsolete.

Exempts apps with ongoing calls.

LowPowerStandbyAllowedReasonTempPowerSaveAllowlist
Obsolete.

Exempts apps on the temporary powersave allowlist.

LowPowerStandbyAllowedReasonVoiceInteraction
Obsolete.

Exempts active Voice Interaction Sessions in Low Power Standby.

Properties

BatteryDischargePrediction

Returns the current battery life remaining estimate.

Class

Returns the runtime class of this Object.

(Inherited from Object)
CurrentThermalStatus

This function returns the current thermal status of the device.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsBatteryDischargePredictionPersonalized

Returns whether the current battery life remaining estimate is personalized based on device usage history or not.

IsDeviceIdleMode

Returns true if the device is currently in idle mode.

IsDeviceLightIdleMode

Returns true if the device is currently in light idle mode.

IsExemptFromLowPowerStandby

Returns true if the calling package is exempt from Low Power Standby restrictions or Low Power Standby is disabled (so Low Power Standby does not restrict apps), false otherwise.

IsInteractive

Returns true if the device is in an interactive state.

IsLowPowerStandbyEnabled

Returns true if Low Power Standby is enabled.

IsPowerSaveMode

Returns true if the device is currently in power save mode.

IsRebootingUserspaceSupported

Returns true if this device supports rebooting userspace.

IsScreenOn
Obsolete.

Returns true if the device is in an interactive state.

IsSustainedPerformanceModeSupported

This function checks if the device has implemented Sustained Performance Mode.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddThermalStatusListener(IExecutor, PowerManager+IOnThermalStatusChangedListener)

This function adds a listener for thermal status change, listen call back will be enqueued tasks on the main thread

AddThermalStatusListener(PowerManager+IOnThermalStatusChangedListener)

This function adds a listener for thermal status change, listen call back will be enqueued tasks on the main thread

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FromContext(Context)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetThermalHeadroom(Int32)

Provides an estimate of how much thermal headroom the device currently has before hitting severe throttling.

GoToSleep(Int64)

Forces the android.view.Display#DEFAULT_DISPLAY_GROUP default display group to turn off.

IsAllowedInLowPowerStandby(LowPowerStandbyAllowedReasons)

Returns true if Low Power Standby is disabled (so Low Power Standby does not restrict apps), or apps may be automatically exempt from Low Power Standby restrictions for the given reason.

IsAllowedInLowPowerStandby(String)

Returns true if Low Power Standby is disabled (so Low Power Standby does not restrict apps), or apps are allowed to use a given feature during Low Power Standby.

IsIgnoringBatteryOptimizations(String)

Return whether the given application package name is on the device's power allowlist.

IsWakeLockLevelSupported(Int32)

Returns true if the specified wake lock level is supported.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
NewWakeLock(WakeLockFlags, String)

Creates a new wake lock with the specified level and flags.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Reboot(String)

Reboot the device.

RemoveThermalStatusListener(PowerManager+IOnThermalStatusChangedListener)

This function removes a listener for thermal status change

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
UserActivity(Int64, Boolean)

Notifies the power manager that user activity happened.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WakeUp(Int64)

Forces the android.view.Display#DEFAULT_DISPLAY_GROUP default display group to turn on.

Events

ThermalStatus

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to