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. Missing application icon in All Application drawer





I am asking this because I am trying to get IM application for
'cupcake' branch emulator.
I did a 'make -j4' and then 'make IM' but the IM is not in All app,
but i see that in Settings->manage application.

Here is the AndroidManifest.xml, It has action.MAIN:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.im" android:sharedUserId="android.uid.im"
    android:sharedUserLabel="@string/perm_label">

    <uses-permission
android:name="com.android.providers.im.permission.READ_ONLY" />
    <uses-permission
android:name="com.android.providers.im.permission.WRITE_ONLY" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="com.android.im.permission.IM_SERVICE" />

    <permission android:name="com.android.im.permission.IM_SERVICE"
            android:permissionGroup="android.permission-group.MESSAGES"
            android:protectionLevel="dangerous"
            android:label="@string/perm_label"
            android:description="@string/perm_desc" />

    <application android:name=".app.ImApp"
             android:label="@string/im_label"
             android:icon="@drawable/ic_launcher_im"
             android:taskAffinity="android.task.im">
        <uses-library android:name="com.android.im.plugin" />
        <!-- TODO: Remove dependency of application on the test runner
             (android.test) library. -->
        <uses-library android:name="android.test.runner" />

        <service android:name=".app.FrontDoorPlugin">
            <intent-filter>
                <action android:name="android.im.plugin" />
            </intent-filter>
        </service>

        <service android:name=".service.RemoteImService"
            android:process="android.process.im"
            android:exported="true"
            android:permission="com.android.im.permission.IM_SERVICE">
            <intent-filter>
                <action android:name="com.android.im.IRemoteImService" />
                <action android:name="com.android.im.SERVICE" />
            </intent-filter>
        </service>

        <activity android:name=".app.ChooseAccountActivity"
                android:theme="@android:style/Theme.NoDisplay">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".app.ImUrlActivity" >
            <intent-filter>
                <action android:name="android.intent.action.SENDTO" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.android.im.category.AIM" />
                <category android:name="com.android.im.category.MSN" />
                <category android:name="com.android.im.category.YAHOO" />
                <data android:scheme="im" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.SENDTO" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="imto" android:host="aim"/>
                <data android:scheme="imto" android:host="yahoo"/>
                <data android:scheme="imto" android:host="msn"/>
            </intent-filter>
        </activity>

        <activity android:name=".app.AccountActivity">
            <intent-filter>
                <action android:name="android.intent.action.EDIT" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.android.im.IMPS_CATEGORY" />
                <data android:mimeType="vnd.android.cursor.item/im-accounts" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.INSERT" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.android.im.IMPS_CATEGORY" />
                <data android:mimeType="vnd.android.cursor.item/im-providers" />
            </intent-filter>
        </activity>

        <activity android:name=".app.SigningInActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".app.SignoutActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".app.ContactListActivity"
android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="com.android.im.IMPS_CATEGORY" />
                <data android:mimeType="vnd.android.cursor.dir/im-contacts"/>
            </intent-filter>
        </activity>

        <activity android:name=".app.AddContactActivity"
            android:label="@string/add_contact_title"/>

        <activity android:name=".app.NewChatActivity"
                android:configChanges="orientation|keyboardHidden"
                android:windowSoftInputMode="stateUnchanged">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.android.im.IMPS_CATEGORY" />
                <data android:mimeType="vnd.android.cursor.item/im-chats" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data
android:mimeType="vnd.android.cursor.item/im-invitations" />
            </intent-filter>
            <intent-filter>
                <action
android:name="android.intent.action.IM_MANAGE_SUBSCRIPTION"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.item/im-contacts"/>
            </intent-filter>
        </activity>

        <activity android:name=".app.ContactsPickerActivity"
android:label="@string/contacts_picker_title">
            <intent-filter>
                <action android:name="android.intent.action.PICK" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.dir/im-contacts" />
            </intent-filter>
        </activity>

        <activity android:name=".app.BlockedContactsActivity"
android:label="@string/blocked_list_title">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data
android:mimeType="vnd.android.cursor.dir/im-blockedList" />
            </intent-filter>
        </activity>

        <activity android:name=".app.ContactPresenceActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.item/im-contacts" />
            </intent-filter>
        </activity>

        <activity android:name=".app.PreferenceActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>

        <activity android:name=".app.SettingActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="com.android.im.IMPS_CATEGORY" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android-dir/im-providerSettings" />
            </intent-filter>
        </activity>

        <activity android:name=".app.SimpleInputActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>

        <receiver android:name=".receiver.ImServiceAutoStarter"
            android:process="android.process.im">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>

    </application>

</manifest>






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

2. How to customize android by creating a new target product definition

I remember there is a document in PDK directory describing how to add a new
product definition, you can have a check on it. the PDK is generated after
you have made a building.

Good Luck!






--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. how to create apk file in android ,like in j2me we create jar and jad files

4. Is 768MB RAM sufficient to install and build Android ?

5. Is 768MB RAM sufficient to install and build Android ?

6. Feature request / Defect report declined with no comment

7. Keeping track of database row ID's