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 // Setup a bunch of window parameters. We have to do this here to preve
nt our backend from | |
29 // getting spurious term / init messages when we relayout | |
30 | |
31 // Layout fullscreen and keep screen on | |
32 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | | |
33 WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | |
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(), Settings.System.SCREEN_BRIG
HTNESS_MODE, | |
43 Settings.System.SCREEN_BRIG
HTNESS_MODE_MANUAL); | |
44 | |
45 WindowManager.LayoutParams lp = getWindow().getAttributes(); | |
46 lp.screenBrightness = 0; // 0f - no backlight | |
47 getWindow().setAttributes(lp); | |
48 } | |
49 } | |
OLD | NEW |