Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2012-07-13 01:19:46 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:40:58 +0300
commit24bf99738240f4ab08b88672f8c9dc191aa5e340 (patch)
treea46fc4b20ae45fec93f8cda50536beb15c89704a /android/src/com/mapswithme/maps/MWMApplication.java
parent132f07f8bef9ee51582c71f4d3fb079b5ebaddb2 (diff)
added consistent benchmarking for all RenderPolicies.
Diffstat (limited to 'android/src/com/mapswithme/maps/MWMApplication.java')
-rw-r--r--android/src/com/mapswithme/maps/MWMApplication.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/android/src/com/mapswithme/maps/MWMApplication.java b/android/src/com/mapswithme/maps/MWMApplication.java
index fa80e883ca..38b3b6abe8 100644
--- a/android/src/com/mapswithme/maps/MWMApplication.java
+++ b/android/src/com/mapswithme/maps/MWMApplication.java
@@ -10,6 +10,8 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Environment;
+import android.os.PowerManager;
+import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.mapswithme.maps.location.LocationService;
@@ -114,6 +116,28 @@ public class MWMApplication extends android.app.Application
return getFilesDir().getAbsolutePath() + "/";
}
+ private WakeLock mWakeLock = null;
+
+ public void disableAutomaticStandby()
+ {
+ if (mWakeLock == null)
+ {
+ PowerManager pm = (PowerManager) getSystemService(android.content.Context.POWER_SERVICE);
+ mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, TAG);
+ mWakeLock.acquire();
+ }
+ }
+
+ public void enableAutomaticStandby()
+ {
+ if (mWakeLock != null)
+ {
+ mWakeLock.release();
+ mWakeLock = null;
+ }
+ }
+
+
static
{
System.loadLibrary("mapswithme");
@@ -125,4 +149,6 @@ public class MWMApplication extends android.app.Application
String extTmpPath,
String settingsPath,
boolean isPro);
+
+ public native boolean nativeIsBenchmarking();
}