Santos Cordon | 7d4ddf6 | 2013-07-10 11:58:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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.phone; |
| 18 | |
| 19 | import com.android.internal.telephony.Phone; |
| 20 | import com.android.internal.telephony.PhoneConstants; |
| 21 | |
| 22 | import android.content.DialogInterface; |
| 23 | import android.os.AsyncResult; |
| 24 | import android.os.Bundle; |
| 25 | import android.os.Handler; |
| 26 | import android.os.Message; |
| 27 | import android.preference.CheckBoxPreference; |
| 28 | import android.preference.Preference; |
| 29 | import android.preference.PreferenceActivity; |
| 30 | import android.preference.PreferenceScreen; |
| 31 | import android.util.Log; |
| 32 | |
| 33 | public class CdmaCallOptions extends PreferenceActivity { |
| 34 | private static final String LOG_TAG = "CdmaCallOptions"; |
| 35 | private final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2); |
| 36 | |
| 37 | private static final String BUTTON_VP_KEY = "button_voice_privacy_key"; |
| 38 | private CheckBoxPreference mButtonVoicePrivacy; |
| 39 | |
| 40 | @Override |
| 41 | protected void onCreate(Bundle icicle) { |
| 42 | super.onCreate(icicle); |
| 43 | |
| 44 | addPreferencesFromResource(R.xml.cdma_call_privacy); |
| 45 | |
| 46 | mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY); |
| 47 | if (PhoneGlobals.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA |
| 48 | || getResources().getBoolean(R.bool.config_voice_privacy_disable)) { |
| 49 | //disable the entire screen |
| 50 | getPreferenceScreen().setEnabled(false); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { |
| 56 | if (preference.getKey().equals(BUTTON_VP_KEY)) { |
| 57 | return true; |
| 58 | } |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | } |