blob: 71919378e97f7dc1cf6d0c1daf2669fc2b5fa846 [file] [log] [blame]
Aida Takeshi7c3b4a32016-08-11 13:42:24 +08001/*
2 * Copyright (C) 2018 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.content.Context;
20import android.os.Bundle;
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080021import android.util.AttributeSet;
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080022import android.view.View;
23import android.widget.EditText;
24
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080025import com.android.phone.settings.fdn.EditPinPreference;
26
27/**
28 * This preference represents the status of disable all barring option.
29 */
30public class CallBarringDeselectAllPreference extends EditPinPreference {
31 private static final String LOG_TAG = "CallBarringDeselectAllPreference";
32 private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
33
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080034 /**
35 * CallBarringDeselectAllPreference constructor.
36 *
37 * @param context The context of view.
38 * @param attrs The attributes of the XML tag that is inflating EditTextPreference.
39 */
40 public CallBarringDeselectAllPreference(Context context, AttributeSet attrs) {
41 super(context, attrs);
42 }
43
44 @Override
45 protected void showDialog(Bundle state) {
Suresh Koletib74bac72019-12-16 18:11:40 +053046 setDialogMessage(getContext().getString(R.string.messageCallBarring));
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080047 super.showDialog(state);
48 }
49
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080050 @Override
51 protected void onBindDialogView(View view) {
52 super.onBindDialogView(view);
53
54 final EditText editText = (EditText) view.findViewById(android.R.id.edit);
55 if (editText != null) {
56 // Hide the input-text-line if the password is not shown.
Suresh Koletib74bac72019-12-16 18:11:40 +053057 editText.setVisibility(View.VISIBLE);
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080058 }
59 }
Aida Takeshi7c3b4a32016-08-11 13:42:24 +080060}