aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-06-22 10:44:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-22 10:44:46 -0700
commitfef3fad272699ecc1363664bfb4c121462761c06 (patch)
treebc897dddda01cbba789212dd69afb2b4f63907c7 /platform_tools
parent0a4c3cbfd77e11901c66ac29bf1417a42b87fd31 (diff)
fix spurious init on VisualBench startup
Diffstat (limited to 'platform_tools')
-rw-r--r--platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java b/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
index 00f2cb0df9..90f70bfe0a 100644
--- a/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
+++ b/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
@@ -24,24 +24,23 @@ public class VisualBenchActivity extends android.app.NativeActivity {
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- }
-
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
- if (!hasFocus) {
- return;
- }
+
+ // 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);
+ 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);
+ 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