Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.phone; |
| 18 | |
| 19 | import android.content.Context; |
| 20 | import android.os.Bundle; |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 21 | import android.util.AttributeSet; |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 22 | import android.view.View; |
| 23 | import android.widget.EditText; |
| 24 | |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 25 | import com.android.phone.settings.fdn.EditPinPreference; |
| 26 | |
| 27 | /** |
| 28 | * This preference represents the status of disable all barring option. |
| 29 | */ |
| 30 | public class CallBarringDeselectAllPreference extends EditPinPreference { |
| 31 | private static final String LOG_TAG = "CallBarringDeselectAllPreference"; |
| 32 | private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2); |
| 33 | |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 34 | /** |
| 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 Koleti | b74bac7 | 2019-12-16 18:11:40 +0530 | [diff] [blame] | 46 | setDialogMessage(getContext().getString(R.string.messageCallBarring)); |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 47 | super.showDialog(state); |
| 48 | } |
| 49 | |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 50 | @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 Koleti | b74bac7 | 2019-12-16 18:11:40 +0530 | [diff] [blame] | 57 | editText.setVisibility(View.VISIBLE); |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 58 | } |
| 59 | } |
Aida Takeshi | 7c3b4a3 | 2016-08-11 13:42:24 +0800 | [diff] [blame] | 60 | } |