summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2016-01-07 15:51:15 -0800
committerDanesh M <daneshm90@gmail.com>2016-01-08 15:23:38 -0800
commit4c798e021b226a33df5dd96c5f8adb56b401b3aa (patch)
tree047a367c26de3d45e26455fbc8c0ede47ddd45a5 /src
parent11236ecf79f1df5fefc4d12564e0a54fecbd6481 (diff)
downloadpackages_apps_Settings-4c798e021b226a33df5dd96c5f8adb56b401b3aa.zip
packages_apps_Settings-4c798e021b226a33df5dd96c5f8adb56b401b3aa.tar.gz
packages_apps_Settings-4c798e021b226a33df5dd96c5f8adb56b401b3aa.tar.bz2
Settings : Disable editing existing entries for blacklist
OPO-322 Change-Id: Ib8971510c2af15b2737755c2c3f10cd31da1652e
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/blacklist/EntryEditDialogFragment.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/settings/blacklist/EntryEditDialogFragment.java b/src/com/android/settings/blacklist/EntryEditDialogFragment.java
index 9fda2ba..e124980 100644
--- a/src/com/android/settings/blacklist/EntryEditDialogFragment.java
+++ b/src/com/android/settings/blacklist/EntryEditDialogFragment.java
@@ -71,6 +71,7 @@ public class EntryEditDialogFragment extends DialogFragment
private static final String STATE_NUMBER = "number";
private static final String STATE_PHONE = "phone";
private static final String STATE_MESSAGE = "message";
+ private static final String STATE_EDIT_ENABLED = "edit_enabled";
public static EntryEditDialogFragment newInstance(long id) {
Bundle args = new Bundle();
@@ -168,6 +169,7 @@ public class EntryEditDialogFragment extends DialogFragment
if (savedState != null) {
mEditText.setText(savedState.getCharSequence(STATE_NUMBER));
+ mEditText.setEnabled(savedState.getBoolean(STATE_EDIT_ENABLED));
mBlockCalls.setChecked(savedState.getBoolean(STATE_PHONE));
mBlockMessages.setChecked(savedState.getBoolean(STATE_MESSAGE));
} else if (id >= 0) {
@@ -176,6 +178,7 @@ public class EntryEditDialogFragment extends DialogFragment
BLACKLIST_PROJECTION, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
mEditText.setText(cursor.getString(COLUMN_NUMBER));
+ mEditText.setEnabled(false);
mBlockCalls.setChecked(cursor.getInt(COLUMN_PHONE) != 0);
mBlockMessages.setChecked(cursor.getInt(COLUMN_MESSAGE) != 0);
} else {
@@ -191,6 +194,7 @@ public class EntryEditDialogFragment extends DialogFragment
mEditText.setText("");
mBlockCalls.setChecked(true);
mBlockMessages.setChecked(true);
+ mEditText.setEnabled(true);
}
return view;
@@ -251,6 +255,7 @@ public class EntryEditDialogFragment extends DialogFragment
dialogState.putCharSequence(STATE_NUMBER, mEditText.getText());
dialogState.putBoolean(STATE_PHONE, mBlockCalls.isChecked());
dialogState.putBoolean(STATE_MESSAGE, mBlockMessages.isChecked());
+ dialogState.putBoolean(STATE_EDIT_ENABLED, mEditText.isEnabled());
state.putBundle(DIALOG_STATE, dialogState);
}