fix spurious init on VisualBench startup

BUG=skia:

Review URL: https://codereview.chromium.org/1202023002
This commit is contained in:
joshualitt 2015-06-22 10:44:46 -07:00 committed by Commit bot
parent 0a4c3cbfd7
commit fef3fad272

View File

@ -24,24 +24,23 @@ public class VisualBenchActivity extends android.app.NativeActivity {
public void onCreate(Bundle savedInstanceState) public void onCreate(Bundle savedInstanceState)
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
}
// Setup a bunch of window parameters. We have to do this here to prevent our backend from
@Override // getting spurious term / init messages when we relayout
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus); // Layout fullscreen and keep screen on
if (!hasFocus) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
return; WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
getWindow().getDecorView().setSystemUiVisibility( getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar
View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar
View.SYSTEM_UI_FLAG_IMMERSIVE); View.SYSTEM_UI_FLAG_IMMERSIVE);
// Disable backlight to keep the system as cool as possible // Disable backlight to keep the system as cool as possible
// TODO make this configurable // TODO make this configurable
Settings.System.putInt(getContentResolver(), Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
WindowManager.LayoutParams lp = getWindow().getAttributes(); WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 0; // 0f - no backlight lp.screenBrightness = 0; // 0f - no backlight