155344342de211db4c99d57ddfc550864d9113376Santos Cordon/*
255344342de211db4c99d57ddfc550864d9113376Santos Cordon * Copyright (C) 2015 The Android Open Source Project
355344342de211db4c99d57ddfc550864d9113376Santos Cordon *
455344342de211db4c99d57ddfc550864d9113376Santos Cordon * Licensed under the Apache License, Version 2.0 (the "License");
555344342de211db4c99d57ddfc550864d9113376Santos Cordon * you may not use this file except in compliance with the License.
655344342de211db4c99d57ddfc550864d9113376Santos Cordon * You may obtain a copy of the License at
755344342de211db4c99d57ddfc550864d9113376Santos Cordon *
855344342de211db4c99d57ddfc550864d9113376Santos Cordon *      http://www.apache.org/licenses/LICENSE-2.0
955344342de211db4c99d57ddfc550864d9113376Santos Cordon *
1055344342de211db4c99d57ddfc550864d9113376Santos Cordon * Unless required by applicable law or agreed to in writing, software
1155344342de211db4c99d57ddfc550864d9113376Santos Cordon * distributed under the License is distributed on an "AS IS" BASIS,
1255344342de211db4c99d57ddfc550864d9113376Santos Cordon * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1355344342de211db4c99d57ddfc550864d9113376Santos Cordon * See the License for the specific language governing permissions and
1455344342de211db4c99d57ddfc550864d9113376Santos Cordon * limitations under the License.
1555344342de211db4c99d57ddfc550864d9113376Santos Cordon */
1655344342de211db4c99d57ddfc550864d9113376Santos Cordon
1755344342de211db4c99d57ddfc550864d9113376Santos Cordonpackage com.android.server.telecom.settings;
1855344342de211db4c99d57ddfc550864d9113376Santos Cordon
19ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordonimport android.app.ActionBar;
2055344342de211db4c99d57ddfc550864d9113376Santos Cordonimport android.app.Activity;
21638f05cb620a17ae7334486d2f53e223ac65eef5Santos Cordonimport android.content.ComponentName;
22638f05cb620a17ae7334486d2f53e223ac65eef5Santos Cordonimport android.content.Intent;
2355344342de211db4c99d57ddfc550864d9113376Santos Cordonimport android.os.Bundle;
24638f05cb620a17ae7334486d2f53e223ac65eef5Santos Cordonimport android.telecom.Log;
25638f05cb620a17ae7334486d2f53e223ac65eef5Santos Cordonimport android.telecom.PhoneAccountHandle;
26638f05cb620a17ae7334486d2f53e223ac65eef5Santos Cordonimport android.telecom.TelecomManager;
27ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordonimport android.view.MenuItem;
2855344342de211db4c99d57ddfc550864d9113376Santos Cordon
2955344342de211db4c99d57ddfc550864d9113376Santos Cordonpublic class EnableAccountPreferenceActivity extends Activity {
3055344342de211db4c99d57ddfc550864d9113376Santos Cordon    @Override
3155344342de211db4c99d57ddfc550864d9113376Santos Cordon    public void onCreate(Bundle savedInstanceState) {
3255344342de211db4c99d57ddfc550864d9113376Santos Cordon        super.onCreate(savedInstanceState);
3355344342de211db4c99d57ddfc550864d9113376Santos Cordon
3455344342de211db4c99d57ddfc550864d9113376Santos Cordon        getFragmentManager().beginTransaction()
3555344342de211db4c99d57ddfc550864d9113376Santos Cordon                .replace(android.R.id.content, new EnableAccountPreferenceFragment())
3655344342de211db4c99d57ddfc550864d9113376Santos Cordon                .commit();
37ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon
38ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        ActionBar actionBar = getActionBar();
39ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        if (actionBar != null) {
40ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon            actionBar.setDisplayHomeAsUpEnabled(true);
41ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        }
4255344342de211db4c99d57ddfc550864d9113376Santos Cordon    }
43ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon
44ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon    /** ${inheritDoc} */
45ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon    @Override
46ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon    public boolean onOptionsItemSelected(MenuItem item) {
47ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        switch (item.getItemId()) {
48ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon            case android.R.id.home:
49ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon                onBackPressed();
50ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon                return true;
51ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        }
52ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon        return super.onOptionsItemSelected(item);
53ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon    }
54ea5cb93d81099f17654e0fdf9b8eda3bfa89f081Santos Cordon
5555344342de211db4c99d57ddfc550864d9113376Santos Cordon}
56