blob: 81453455ff8b16ad8a0f0a9bed768484a4be6b80 [file] [log] [blame]
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -07001/*
2 * Copyright (C) 2008 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.phone2;
18
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070019import android.os.Bundle;
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070020import android.preference.Preference;
21import android.preference.PreferenceActivity;
22import android.preference.PreferenceScreen;
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070023
24import com.android.internal.telephony.Phone;
Hung-ying Tyanf7f67192010-06-29 11:32:33 -070025import com.android.internal.telephony.sip.SipPhoneFactory;
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070026
27/**
28 * List of Phone-specific settings screens.
29 */
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070030public class CdmaOptions extends PreferenceActivity {
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070031
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070032 private CdmaRoamingListPreference mButtonCdmaRoam;
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070033
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070034 private static final String BUTTON_CDMA_ROAMING_KEY = "cdma_roaming_mode_key";
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070035
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070036 @Override
37 protected void onCreate(Bundle icicle) {
38 super.onCreate(icicle);
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070039
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070040 addPreferencesFromResource(R.xml.cdma_options);
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070041
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070042 PreferenceScreen prefSet = getPreferenceScreen();
43 mButtonCdmaRoam =
44 (CdmaRoamingListPreference) prefSet.findPreference(BUTTON_CDMA_ROAMING_KEY);
45 if (SipPhoneFactory.getDefaultPhone().getPhoneType() != Phone.PHONE_TYPE_CDMA) {
46 mButtonCdmaRoam.setEnabled(false);
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070047 }
48 }
49
Hung-ying Tyanfe68ef22010-06-28 23:00:45 -070050 @Override
51 public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
52 if (preference.getKey().equals(BUTTON_CDMA_ROAMING_KEY)) {
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070053 return true;
54 }
55 return false;
56 }
Hung-ying Tyan831f9ac2010-06-23 17:07:07 -070057}