1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.android.vts;
18 
19 import android.app.Activity;
20 import android.os.Bundle;
21 import android.util.Log;
22 import android.view.View;
23 import android.view.WindowManager;
24 
25 /**
26  * The VTS Agent App - main class.
27  */
28 public class VtsAgentApp extends Activity {
29     static final String TAG="VtsAgentApp";
30 
31     /**
32      * Called with the activity is first created.
33      */
34     @Override
onCreate(Bundle savedInstanceState)35     public void onCreate(Bundle savedInstanceState) {
36         super.onCreate(savedInstanceState);
37 
38         // Set the layout for this activity.  You can find it
39         // in res/layout/vts_agent_app.xml
40         View view = getLayoutInflater().inflate(R.layout.vts_agent_app, null);
41         setContentView(view);
42 
43         WindowManager.LayoutParams params = getWindow().getAttributes();
44         params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
45         getWindow().setAttributes(params);
46 
47         view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
48             @Override public void onSystemUiVisibilityChange(int visibility) {
49                 WindowManager.LayoutParams params = getWindow().getAttributes();
50                 params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
51                 getWindow().setAttributes(params);
52             }
53         });
54 
55         VtsAgentAppNative vtsNative = new VtsAgentAppNative();
56         Log.i(TAG, "is PDK? " + vtsNative.isPDK());
57     }
58 }