Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 package com.skia; | |
| 9 | |
| 10 import android.app.Activity; | |
| 11 import android.content.Intent; | |
| 12 import android.os.Bundle; | |
| 13 import android.provider.Settings; | |
| 14 import android.util.Log; | |
| 15 import android.view.View; | |
| 16 import android.view.WindowManager; | |
| 17 | |
| 18 public class VisualBenchActivity extends android.app.NativeActivity { | |
| 19 static { | |
| 20 System.loadLibrary("skia_android"); | |
| 21 } | |
| 22 | |
| 23 @Override | |
| 24 public void onCreate(Bundle savedInstanceState) | |
| 25 { | |
| 26 getIntent().putExtra("hmm", "woah"); | |
|
djsollen
2015/06/11 20:32:00
hmm?
joshualitt
2015/06/12 15:40:36
Acknowledged.
| |
| 27 super.onCreate(savedInstanceState); | |
| 28 } | |
| 29 | |
| 30 @Override | |
| 31 public void onWindowFocusChanged(boolean hasFocus) { | |
| 32 super.onWindowFocusChanged(hasFocus); | |
| 33 if (!hasFocus) { | |
| 34 return; | |
| 35 } | |
| 36 getWindow().getDecorView().setSystemUiVisibility( | |
| 37 View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar | |
| 38 View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar | |
| 39 View.SYSTEM_UI_FLAG_IMMERSIVE); | |
| 40 | |
| 41 // Disable backlight to keep the system as cool as possible | |
| 42 // TODO make this configurable | |
| 43 Settings.System.putInt(getContentResolver(), | |
| 44 Settings.System.SCREEN_BRIGHTNESS_MODE, | |
| 45 Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); | |
| 46 | |
| 47 WindowManager.LayoutParams lp = getWindow().getAttributes(); | |
| 48 lp.screenBrightness = 0; // 0f - no backlight | |
| 49 getWindow().setAttributes(lp); | |
| 50 } | |
| 51 } | |
| OLD | NEW |