SecurityActivity.java revision ddb142fe3e0bd42dc03ca2052f30eaa468151433
165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane/* 265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Copyright (C) 2014 The Android Open Source Project 365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Licensed under the Apache License, Version 2.0 (the "License"); 565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * you may not use this file except in compliance with the License. 665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * You may obtain a copy of the License at 765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * http://www.apache.org/licenses/LICENSE-2.0 965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 1065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Unless required by applicable law or agreed to in writing, software 1165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * distributed under the License is distributed on an "AS IS" BASIS, 1265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * See the License for the specific language governing permissions and 1465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * limitations under the License. 1565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 1665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 1765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lanepackage com.android.tv.settings.system; 1865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 19ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantlerimport com.android.tv.settings.BaseSettingsFragment; 2065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 213150b12e5df05eec2c3ebb85360661f1d034c188Andrew Wilsonimport android.app.Activity; 2265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport android.os.Bundle; 2365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 24ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantlerpublic class SecurityActivity extends Activity { 2565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 2665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane @Override 27ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler public void onCreate(Bundle savedInstanceState) { 2865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane super.onCreate(savedInstanceState); 29ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler if (savedInstanceState == null) { 30ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler getFragmentManager().beginTransaction() 31ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler .add(android.R.id.content, SettingsFragment.newInstance()) 32ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler .commit(); 3365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 3465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 3565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 36ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler public static class SettingsFragment extends BaseSettingsFragment { 3765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 38ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler public static SettingsFragment newInstance() { 39ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler return new SettingsFragment(); 4065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 4165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 42ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler @Override 43ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler public void onPreferenceStartInitialScreen() { 44ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler final SecurityFragment fragment = SecurityFragment.newInstance(); 45ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler startPreferenceFragment(fragment); 46ddb142fe3e0bd42dc03ca2052f30eaa468151433Tony Mantler } 4765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 4865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane} 49