Not using a WakeLock so why does the device stay awake?

by Dianne Hackborn » Wed, 14 Apr 2010 15:36:31 GMT


Sponsored Links
 Use this to see what wake locks are being held in user space:

adb shell dumpsys power

Note that the device never goes to sleep while plugged in to USB.  Also the
system will never hold a wake lock for you just because you have an activity
or service running.  You can have it do so for you in an activity via
FLAG_KEEP_SCREEN_ON in a window, and the alarm manager will temporarily hold
one for you while sending an alarm broadcast to a broadcast receiver.







>



Not using a WakeLock so why does the device stay awake?

by Dianne Hackborn » Fri, 23 Apr 2010 01:59:22 GMT


 It is possible for the kernel to hold wake locks for various reasons.  If
you want to see what was holding wake locks while you were unplugged, use
"adb shell dumpsys batteryinfo" and look at the last set of stats (this is
the raw information used to generate the battery usage UI).  However the
kernel wake lock information is extremely hard to understand, and
unfortunately I can't say for sure off-hand how to interpret it. :}







>


Sponsored Links


Other Threads

1. Problem with the sqlite database

Hi AndroidDev,
11-24 19:27:38.287: ERROR/Database(5891): Leak found
11-24 19:27:38.287: ERROR/Database(5891): java.lang.IllegalStateException:
/data/data/com.vista.examples.List/databases/ev_data SQLiteDatabase created
and never closed

i got the above error .how to resolve the problem.?

Also ,please check my code below to create the database and accessign the
database.

[/code]public void onCreate(Bundle icicle) {
super.onCreate(icicle);
initDB(this);
//mOpenHelper=new DatabaseHelper(this);
itla = new IconifiedTextListAdapter(this);
showEventList();
}
public void initDB(Context ctx) {
db = ctx.openOrCreateDatabase(EVENT_DATA,
Context.MODE_WORLD_WRITEABLE,null);
db.execSQL("CREATE TABLE IF NOT EXISTS " + EVENT_DATA
+ " (EventType VARCHAR,Description VARCHAR, Image INTEGER,Msg_Template
TEXT);");

}
public void showEventList() {
SQLiteDatabase vDB=null;
try{
vDB=SQLiteDatabase.openDatabase(getDatabasePath(EVENT_DATA).toString(),
null,SQLiteDatabase.OPEN_READONLY ); }catch(SQLiteException sqe){
sqe.printStackTrace();
}
Cursor cursor=vDB.query(EVENT_DATA, new
String[]{"EventType,Image,Description"}, null, null, null, null, null);
cursor.moveToFirst();
for(int position=0;(position!=cursor.getCount())&&
cursor.getCount()!=0;position++){
String text=cursor.getString(0);
int im=cursor.getInt(1);
itla.addItem(new IconifiedText(text, getResources().getDrawable(im)));
cursor.moveToNext();
}
setListAdapter(itla);
[code]

I am using getDatabasePath to connect to db
Is this is the proper way to create as well as accessing the database?

Please suggest...

Regards
Bharat.

--~--~---------~--~----~------------~-------~--~----~

2. About ZygoteInit.acceptCommandPeer

Hi:

I have a small question about the API "ZygoteInit.acceptCommandPeer"

In the main of Java ZygoteInit class.
Two APIs are called:
1) ZygoteInit.startSystemServer
2) ZygoteInit.runSelectLoopMode
My understanding is:
1) would fork "system server" as child process of zygote through JNI.
2) would fork other child process in a loop.
in ZygoteInit.runSelectLoopMode seem ZygoteInit.acceptCommandPeer
used to read something and create new child process accordingly.
(Is there something wrong with my understanding?)

My question is who(which API in which file) would send the Command
that received by ZygoteInit.acceptCommandPeer?

Thanks&BstRgds
gan
--~--~---------~--~----~------------~-------~--~----~

3. G1 owners: "A system update is available" - is it safe?

4. GetLastKnownLocation vs. requestLocationUpdates

5. Why "requestWindowFeature(Window.FEATURE_LEFT_ICON)" always return false?

6. JUnit

7. Issues while using putExtra