From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbZBTCjk (ORCPT ); Thu, 19 Feb 2009 21:39:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752097AbZBTCjb (ORCPT ); Thu, 19 Feb 2009 21:39:31 -0500 Received: from mail-gx0-f174.google.com ([209.85.217.174]:36890 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbZBTCja convert rfc822-to-8bit (ORCPT ); Thu, 19 Feb 2009 21:39:30 -0500 MIME-Version: 1.0 In-Reply-To: References: <200902192215.18365.rjw@sisk.pl> Date: Thu, 19 Feb 2009 18:39:29 -0800 Message-ID: Subject: Re: [RFD] Automatic suspend From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: Alan Stern Cc: "Rafael J. Wysocki" , "Woodruff, Richard" , Arjan van de Ven , Kyle Moffett , Oliver Neukum , Benjamin Herrenschmidt , pm list , LKML , Pavel Machek , Nigel Cunningham , Matthew Garrett , mark gross , Uli Luckas , Igor Stoppa , Brian Swetland , Len Brown Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 19, 2009 at 2:08 PM, Alan Stern wrote: >> > It might have to be platform-specific. The Android people seem to have a >> > pretty good idea of what criteria will work for them. >> >> I'd really like to know in what situations Androind is supposed to suspend >> automatically. > > It might be better to ask in what situations Android is _not_ supposed > to sleep automatically. In other words, in what situations is a > wakelock acquired? Since the whole system is only a phone, this > question should have a reasonably well-defined answer. On an android phone, any code that needs to run when the screen is off must hold a wakelock (directly or indirectly). In general if an application or the system is processing an event that may cause a user notification (new email, incoming phone call, alarm, etc.) it needs to prevent suspend. But, we also use wakelocks to upload stats or download system updates in the background, and for media player or (gps) data logging applications. -- Arve Hjønnevåg