• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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.android.server.telecom.settings;
18 
19 import android.app.ActionBar;
20 import android.app.Activity;
21 import android.content.ComponentName;
22 import android.content.Intent;
23 import android.os.Bundle;
24 import android.telecom.Log;
25 import android.telecom.PhoneAccountHandle;
26 import android.telecom.TelecomManager;
27 import android.view.MenuItem;
28 import android.view.WindowManager;
29 
30 public class EnableAccountPreferenceActivity extends Activity {
31     @Override
onCreate(Bundle savedInstanceState)32     public void onCreate(Bundle savedInstanceState) {
33         super.onCreate(savedInstanceState);
34         getWindow().addSystemFlags(
35                 android.view.WindowManager.LayoutParams
36                         .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
37 
38         getFragmentManager().beginTransaction()
39                 .replace(android.R.id.content, new EnableAccountPreferenceFragment())
40                 .commit();
41 
42         ActionBar actionBar = getActionBar();
43         if (actionBar != null) {
44             actionBar.setDisplayHomeAsUpEnabled(true);
45         }
46         SettingsConstants.setupEdgeToEdge(this);
47     }
48 
49     /** ${inheritDoc} */
50     @Override
onOptionsItemSelected(MenuItem item)51     public boolean onOptionsItemSelected(MenuItem item) {
52         switch (item.getItemId()) {
53             case android.R.id.home:
54                 onBackPressed();
55                 return true;
56         }
57         return super.onOptionsItemSelected(item);
58     }
59 
60 }
61