blob: 8f7b1b12ab4e7962e0c7df6e653ab36aa380fe9d [file] [log] [blame]
Santos Cordon7d4ddf62013-07-10 11:58:08 -07001/*
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
17package com.android.phone;
18
19import com.android.internal.telephony.Phone;
20import com.android.internal.telephony.PhoneConstants;
21
22import android.content.DialogInterface;
23import android.os.AsyncResult;
24import android.os.Bundle;
25import android.os.Handler;
26import android.os.Message;
27import android.preference.CheckBoxPreference;
28import android.preference.Preference;
29import android.preference.PreferenceActivity;
30import android.preference.PreferenceScreen;
31import android.util.Log;
Sanket Padawee09a6f62015-03-05 11:59:39 -080032import android.view.MenuItem;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070033
34public class CdmaCallOptions extends PreferenceActivity {
35 private static final String LOG_TAG = "CdmaCallOptions";
36 private final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
37
38 private static final String BUTTON_VP_KEY = "button_voice_privacy_key";
39 private CheckBoxPreference mButtonVoicePrivacy;
40
41 @Override
42 protected void onCreate(Bundle icicle) {
43 super.onCreate(icicle);
44
45 addPreferencesFromResource(R.xml.cdma_call_privacy);
46
Sanket Padawee09a6f62015-03-05 11:59:39 -080047 SubscriptionInfoHelper subInfoHelper = new SubscriptionInfoHelper(this, getIntent());
48 subInfoHelper.setActionBarTitle(
49 getActionBar(), getResources(), R.string.labelCdmaMore_with_label);
50
Santos Cordon7d4ddf62013-07-10 11:58:08 -070051 mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
Sanket Padawee09a6f62015-03-05 11:59:39 -080052 if (subInfoHelper.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA
Santos Cordon7d4ddf62013-07-10 11:58:08 -070053 || getResources().getBoolean(R.bool.config_voice_privacy_disable)) {
54 //disable the entire screen
55 getPreferenceScreen().setEnabled(false);
56 }
57 }
58
59 @Override
Sanket Padawee09a6f62015-03-05 11:59:39 -080060 public boolean onOptionsItemSelected(MenuItem item) {
61 final int itemId = item.getItemId();
62 if (itemId == android.R.id.home) {
63 onBackPressed();
64 return true;
65 }
66 return super.onOptionsItemSelected(item);
67 }
68
69 @Override
Santos Cordon7d4ddf62013-07-10 11:58:08 -070070 public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
71 if (preference.getKey().equals(BUTTON_VP_KEY)) {
72 return true;
73 }
74 return false;
75 }
76
77}