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 super.onCreate(savedInstanceState); |
| 27 } |
| 28 |
| 29 @Override |
| 30 public void onWindowFocusChanged(boolean hasFocus) { |
| 31 super.onWindowFocusChanged(hasFocus); |
| 32 if (!hasFocus) { |
| 33 return; |
| 34 } |
| 35 getWindow().getDecorView().setSystemUiVisibility( |
| 36 View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar |
| 37 View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar |
| 38 View.SYSTEM_UI_FLAG_IMMERSIVE); |
| 39 |
| 40 // Disable backlight to keep the system as cool as possible |
| 41 // TODO make this configurable |
| 42 Settings.System.putInt(getContentResolver(), |
| 43 Settings.System.SCREEN_BRIGHTNESS_MODE, |
| 44 Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); |
| 45 |
| 46 WindowManager.LayoutParams lp = getWindow().getAttributes(); |
| 47 lp.screenBrightness = 0; // 0f - no backlight |
| 48 getWindow().setAttributes(lp); |
| 49 } |
| 50 } |
OLD | NEW |