首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

通译 android.os.PowerManager

2014-07-12 
翻译 android.os.PowerManager

翻译 android.os.PowerManager

<!--@page { margin: 0.79in }P { margin-bottom: 0.08in }H1 { margin-bottom: 0.08in }H1.western { font-family: "Times New Roman", serif }H1.cjk { font-family: "DejaVu Sans" }H1.ctl { font-family: "Lohit Hindi" }TD P { margin-bottom: 0in }H2 { margin-bottom: 0.08in }H2.ctl { font-family: "Lohit Hindi" }PRE.cjk { font-family: "DejaVu Sans", monospace }TH P { margin-bottom: 0in }CODE.cjk { font-family: "DejaVu Sans", monospace }-->

publicclass

java.lang.Object

????

android.os.PowerManager

开On*

关Off

关Off

开On

暗Dim

关Off

开On

亮Bright

关Off

开On

亮Bright

亮Bright

?

*如果你获得一个不完整的wakelock,则CPU会继续运行,不必顾及任何计时器甚至用户按下power键后。对于所有的其他的wakelock,CPU在运行,但用户可以直接用power键使设备休眠。

*Ifyou hold a partial wakelock, the CPU will continue to run,irrespective of any timers and even after the user presses the powerbutton. In all other wakelocks, the CPU will run, but the user canstill put the device to sleep using the power button.

?

另外,你能加两个以上的标志,这些仅能影响屏幕的行为。这些标志当组合中有一个PARTIAL_WAKE_LOCK时将没有效果。

Inaddition, you can add two more flags, which affect behavior of thescreen only.?Theseflags have no effect when combined with a?

?

正常的wakelock不会实际转到照明。反而,他们使照明保持自他打开时(例如,来自用户activity)。这个标志会强制屏幕和/或键盘立即打开,当这个wakelock已获取时。一个典型用法是将哪些重要的通知立即让用户看到。

Normal wakelocks don't actually turn on the illumination. Instead, theycause the illumination to remain on once it turns on (e.g. fromuser activity). This flag will force the screen and/or keyboardto turn on immediately, when the WakeLock is acquired. Atypical use would be for notifications which are important forthe user to see immediately.

?

如果这个标志被设置,用户activity计时器当WakeLock被释放时会重新设定,因为照明保持一点长。这个可以用于降低闪烁如果你是在wakelock状态下循环。

If this flagis set, the user activity timer will be reset when the WakeLockis released, causing the illumination to remain on a bitlonger. This can be used to reduce flicker if you are cyclingbetween wake lock conditions.

class

PowerManager.WakeLock

类让你说你需要有这个设备。

Class lets yousay that you need to have the device on.?

Constants

int

ACQUIRE_CAUSES_WAKEUP

正常的wakelock不会实际的唤醒设备,他们自他准备好则保持着。

Normally wakelocks don't actually wake the device, they just cause it toremain on once it's already on.

int

FULL_WAKE_LOCK

Wake lock以确保屏幕和键盘全部点亮。

Wake lock thatensures that the screen and keyboard are on at full brightness.

int

ON_AFTER_RELEASE

当这个wakelock已释放时,拨开了用户界面的计时器所以屏幕停留稍微长。

When this wakelock is released, poke the user activity timer so the screenstays on for a little longer.

int

PARTIAL_WAKE_LOCK

Wakelock以确保CPU运行。

Wake lock thatensures that the CPU is running.

int

SCREEN_BRIGHT_WAKE_LOCK

Wakelock以确保屏幕全亮;键盘背光允许关闭。

Wake lock thatensures that the screen is on at full brightness; the keyboardbacklight will be allowed to go off.

int

SCREEN_DIM_WAKE_LOCK

Wakelock以确保屏幕打开(但可以是暗淡的);键盘背光将允许关闭。

Wake lock thatensures that the screen is on (but may be dimmed); the keyboardbacklight will be allowed to go off.

Public Methods

void

goToSleep(longtime)

强制设备进入休眠。

Force the deviceto go to sleep.

boolean

IsScreenOn()

返回屏幕是否当前亮着。

Returns whetherthe screen is currently on.

PowerManager.WakeLock

newWakeLock(intflags,?String?tag)

得到一个Wake lock在这个标志参数的级别。

Get a wake lockat the level of the flags parameter.

void

reboot(String?reason)

重启设备

Reboot thedevice.

void

userActivity(longwhen, boolean noChangeLights)

用户界面发生。

User activityhappened.

?