|
Here is a short list of links related to this Android PowerManager.java source code file:
Android example source code file (PowerManager.java)
The PowerManager.java Android example source code/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.os; import android.util.Log; import com.android.internal.os.RuntimeInit; /** * This class gives you control of the power state of the device. * * <p>Device battery life will be significantly affected by the use of this API. Do not * acquire WakeLocks unless you really need them, use the minimum levels possible, and be sure * to release it as soon as you can. * * <p>You can obtain an instance of this class by calling * {@link android.content.Context#getSystemService(java.lang.String) Context.getSystemService()}. * * <p>The primary API you'll use is {@link #newWakeLock(int, String) newWakeLock()}. This will * create a {@link PowerManager.WakeLock} object. You can then use methods on this object to * control the power state of the device. In practice it's quite simple: * * {@samplecode * PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); * PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); * wl.acquire(); * ..screen will stay on during this section.. * wl.release(); * } * * <p>The following flags are defined, with varying effects on system power. These flags are * mutually exclusive - you may only specify one of them.</i> * <table border="2" width="85%" align="center" frame="hsides" rules="rows"> * * <thead> * <tr> | Flag Value | Screen | Keyboard | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{@link #PARTIAL_WAKE_LOCK} | Off | Off | {@link #SCREEN_DIM_WAKE_LOCK} | Dim | Off | {@link #SCREEN_BRIGHT_WAKE_LOCK} | Bright | Off | {@link #FULL_WAKE_LOCK} | Bright | Bright | Flag Value | Description |
{@link #ACQUIRE_CAUSES_WAKEUP} | {@link #ON_AFTER_RELEASE} |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.