blob: 419e72ccd5a02822567c624d7c44dcad3c90a4ac [file] [log] [blame]
Santos Cordon7d4ddf62013-07-10 11:58:08 -07001/*
2 * Copyright (C) 2006 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
17package com.android.phone;
18
19import android.os.Bundle;
20import android.preference.CheckBoxPreference;
21import android.preference.Preference;
22import android.preference.PreferenceActivity;
23import android.preference.PreferenceScreen;
Sanket Padawee09a6f62015-03-05 11:59:39 -080024import android.view.MenuItem;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070025
26import com.android.internal.telephony.Phone;
27import com.android.internal.telephony.PhoneConstants;
28
29public class GsmUmtsCallOptions extends PreferenceActivity {
30 private static final String LOG_TAG = "GsmUmtsCallOptions";
31 private final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
32
Sanket Padawee09a6f62015-03-05 11:59:39 -080033 private static final String CALL_FORWARDING_KEY = "call_forwarding_key";
34 private static final String ADDITIONAL_GSM_SETTINGS_KEY = "additional_gsm_call_settings_key";
35
Santos Cordon7d4ddf62013-07-10 11:58:08 -070036 @Override
37 protected void onCreate(Bundle icicle) {
38 super.onCreate(icicle);
39
40 addPreferencesFromResource(R.xml.gsm_umts_call_options);
41
Sanket Padawee09a6f62015-03-05 11:59:39 -080042 SubscriptionInfoHelper subInfoHelper = new SubscriptionInfoHelper(this, getIntent());
43 subInfoHelper.setActionBarTitle(
44 getActionBar(), getResources(), R.string.labelGsmMore_with_label);
45 init(getPreferenceScreen(), subInfoHelper);
46
47 if (subInfoHelper.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_GSM) {
Santos Cordon7d4ddf62013-07-10 11:58:08 -070048 //disable the entire screen
49 getPreferenceScreen().setEnabled(false);
50 }
51 }
Sanket Padawee09a6f62015-03-05 11:59:39 -080052
53 @Override
54 public boolean onOptionsItemSelected(MenuItem item) {
55 final int itemId = item.getItemId();
56 if (itemId == android.R.id.home) {
57 onBackPressed();
58 return true;
59 }
60 return super.onOptionsItemSelected(item);
61 }
62
63 public static void init(PreferenceScreen prefScreen, SubscriptionInfoHelper subInfoHelper) {
64 Preference callForwardingPref = prefScreen.findPreference(CALL_FORWARDING_KEY);
65 callForwardingPref.setIntent(subInfoHelper.getIntent(GsmUmtsCallForwardOptions.class));
66
67 Preference additionalGsmSettingsPref =
68 prefScreen.findPreference(ADDITIONAL_GSM_SETTINGS_KEY);
69 additionalGsmSettingsPref.setIntent(
70 subInfoHelper.getIntent(GsmUmtsAdditionalCallOptions.class));
71 }
Santos Cordon7d4ddf62013-07-10 11:58:08 -070072}