From patchwork Thu Oct 13 14:05:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 4658 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7B93223EF6 for ; Thu, 13 Oct 2011 14:13:31 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4B1D3A18538 for ; Thu, 13 Oct 2011 14:13:31 +0000 (UTC) Received: by gyf1 with SMTP id 1so67319gyf.11 for ; Thu, 13 Oct 2011 07:13:30 -0700 (PDT) Received: by 10.223.60.73 with SMTP id o9mr6415068fah.18.1318515210527; Thu, 13 Oct 2011 07:13:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs262255laf; Thu, 13 Oct 2011 07:13:30 -0700 (PDT) Received: by 10.216.159.12 with SMTP id r12mr4500126wek.87.1318515207432; Thu, 13 Oct 2011 07:13:27 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gd16si2959403wbb.127.2011.10.13.07.13.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 07:13:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1REM2I-0006X2-JE for ; Thu, 13 Oct 2011 14:13:26 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 69EA6E24E9 for ; Thu, 13 Oct 2011 14:05:20 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 152 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 152: Android: Acquire WakeLock to prevent dim screen Message-Id: <20111013140520.8587.83431.launchpad@ackee.canonical.com> Date: Thu, 13 Oct 2011 14:05:20 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14124"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: fd3ffcd287b07e31933bc574303ddc31338183a1 ------------------------------------------------------------ revno: 152 author: Jim Huang committer: Alexandros Frantzis branch nick: trunk timestamp: Thu 2011-10-13 15:43:55 +0300 message: Android: Acquire WakeLock to prevent dim screen modified: android/AndroidManifest.xml android/src/org/linaro/glmark2/Glmark2Activity.java --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'android/AndroidManifest.xml' --- android/AndroidManifest.xml 2011-08-10 20:48:56 +0000 +++ android/AndroidManifest.xml 2011-10-13 12:43:55 +0000 @@ -13,6 +13,7 @@ + === modified file 'android/src/org/linaro/glmark2/Glmark2Activity.java' --- android/src/org/linaro/glmark2/Glmark2Activity.java 2011-09-28 15:48:47 +0000 +++ android/src/org/linaro/glmark2/Glmark2Activity.java 2011-10-13 12:43:55 +0000 @@ -6,13 +6,29 @@ import android.app.Dialog; import android.app.AlertDialog; import android.content.DialogInterface; +import android.content.Context; +import android.os.PowerManager; +import android.os.PowerManager.WakeLock; public class Glmark2Activity extends Activity { public static final int DIALOG_EGLCONFIG_FAIL_ID = 0; + public static final String TAG = "GLMark2"; + private WakeLock mWakeLock; + + @Override + protected void onDestroy() { + super.onPause(); + mWakeLock.release(); + } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); + mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, TAG); + mWakeLock.acquire(); + mGLView = new Glmark2SurfaceView(this); setContentView(mGLView); }