aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2015-07-22 11:33:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-22 11:33:25 -0700
commit425535f1626932e4e22f61a2571f9c3c2b1c5977 (patch)
treeabea4aaaf77ea00c9f424ff8e003dffa9a4ce50f /platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java
parent404d9d620d98b186890f9dbdd3498557206c2793 (diff)
Update Android Apps to use gradle
This CL replaces ant with gradle for the task of building APKs. The primary driver of this change is that it now allow us to develop and test our apps using Android Studio. DOCS_PREVIEW= https://skia.org/?cl=1215023017 Review URL: https://codereview.chromium.org/1215023017
Diffstat (limited to 'platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java')
-rw-r--r--platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java b/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java
new file mode 100644
index 0000000000..90f70bfe0a
--- /dev/null
+++ b/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+package com.skia;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.View;
+import android.view.WindowManager;
+
+public class VisualBenchActivity extends android.app.NativeActivity {
+ static {
+ System.loadLibrary("skia_android");
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ // Setup a bunch of window parameters. We have to do this here to prevent our backend from
+ // getting spurious term / init messages when we relayout
+
+ // Layout fullscreen and keep screen on
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
+ WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar
+ View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar
+ View.SYSTEM_UI_FLAG_IMMERSIVE);
+
+ // Disable backlight to keep the system as cool as possible
+ // TODO make this configurable
+ Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE,
+ Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
+
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
+ lp.screenBrightness = 0; // 0f - no backlight
+ getWindow().setAttributes(lp);
+ }
+}