Move FDN-specific classes into own package.
Trying to clean things up to have better organization while dealing
with making fdn settings SIM-specific.
The only thing which changed materially in the classes themselves...
- Rename package names to include ".settings.fdn";
- Putting in required imports (mostly for R and PhoneGlobals).
Bug: 18114923
Change-Id: I5c4b575641ef52d1ee562ca35552f2822e64e385
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 55449d7..62eb272 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -68,7 +68,7 @@
* phone process.
*/
public class PhoneGlobals extends ContextWrapper {
- /* package */ static final String LOG_TAG = "PhoneApp";
+ public static final String LOG_TAG = "PhoneApp";
/**
* Phone app-wide debug level:
@@ -481,7 +481,7 @@
/**
* Returns the Phone associated with this instance
*/
- static Phone getPhone() {
+ public static Phone getPhone() {
return getInstance().phone;
}
diff --git a/src/com/android/phone/DeleteFdnContactScreen.java b/src/com/android/phone/settings/fdn/DeleteFdnContactScreen.java
similarity index 97%
rename from src/com/android/phone/DeleteFdnContactScreen.java
rename to src/com/android/phone/settings/fdn/DeleteFdnContactScreen.java
index 074078c..c0fc1e8 100644
--- a/src/com/android/phone/DeleteFdnContactScreen.java
+++ b/src/com/android/phone/settings/fdn/DeleteFdnContactScreen.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.Activity;
import android.content.AsyncQueryHandler;
@@ -29,6 +29,9 @@
import android.view.Window;
import android.widget.Toast;
+import com.android.phone.PhoneGlobals;
+import com.android.phone.R;
+
import static android.view.Window.PROGRESS_VISIBILITY_OFF;
import static android.view.Window.PROGRESS_VISIBILITY_ON;
diff --git a/src/com/android/phone/EditFdnContactScreen.java b/src/com/android/phone/settings/fdn/EditFdnContactScreen.java
similarity index 98%
rename from src/com/android/phone/EditFdnContactScreen.java
rename to src/com/android/phone/settings/fdn/EditFdnContactScreen.java
index 753ae3f..3064a7a 100644
--- a/src/com/android/phone/EditFdnContactScreen.java
+++ b/src/com/android/phone/settings/fdn/EditFdnContactScreen.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import static android.view.Window.PROGRESS_VISIBILITY_OFF;
import static android.view.Window.PROGRESS_VISIBILITY_ON;
@@ -47,6 +47,8 @@
import android.widget.TextView;
import android.widget.Toast;
+import com.android.phone.PhoneGlobals;
+import com.android.phone.R;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
diff --git a/src/com/android/phone/EditPinPreference.java b/src/com/android/phone/settings/fdn/EditPinPreference.java
similarity index 92%
rename from src/com/android/phone/EditPinPreference.java
rename to src/com/android/phone/settings/fdn/EditPinPreference.java
index af0040d..eaa3507 100644
--- a/src/com/android/phone/EditPinPreference.java
+++ b/src/com/android/phone/settings/fdn/EditPinPreference.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.AlertDialog;
import android.content.Context;
@@ -26,27 +26,29 @@
import android.view.View;
import android.widget.EditText;
+import com.android.phone.R;
+
import java.util.Map;
/**
* Class similar to the com.android.settings.EditPinPreference
- * class, with a couple of modifications, including a different layout
+ * class, with a couple of modifications, including a different layout
* for the dialog.
*/
public class EditPinPreference extends EditTextPreference {
private boolean shouldHideButtons;
-
+
interface OnPinEnteredListener {
void onPinEntered(EditPinPreference preference, boolean positiveResult);
}
-
+
private OnPinEnteredListener mPinListener;
public void setOnPinEnteredListener(OnPinEnteredListener listener) {
mPinListener = listener;
}
-
+
public EditPinPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -54,16 +56,16 @@
public EditPinPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
-
+
/**
- * Overridden to setup the correct dialog layout, as well as setting up
+ * Overridden to setup the correct dialog layout, as well as setting up
* other properties for the pin / puk entry field.
*/
@Override
protected View onCreateDialogView() {
// set the dialog layout
setDialogLayoutResource(R.layout.pref_dialog_editpin);
-
+
View dialog = super.onCreateDialogView();
getEditText().setInputType(InputType.TYPE_CLASS_NUMBER |
@@ -71,26 +73,26 @@
return dialog;
}
-
+
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
-
+
// If the layout does not contain an edittext, hide the buttons.
shouldHideButtons = (view.findViewById(android.R.id.edit) == null);
}
-
+
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
super.onPrepareDialogBuilder(builder);
-
+
// hide the buttons if we need to.
if (shouldHideButtons) {
builder.setPositiveButton(null, this);
builder.setNegativeButton(null, this);
}
}
-
+
@Override
protected void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
@@ -98,11 +100,11 @@
mPinListener.onPinEntered(this, positiveResult);
}
}
-
+
/**
- * Externally visible method to bring up the dialog to
- * for multi-step / multi-dialog requests (like changing
- * the SIM pin).
+ * Externally visible method to bring up the dialog to
+ * for multi-step / multi-dialog requests (like changing
+ * the SIM pin).
*/
public void showPinDialog() {
showDialog(null);
diff --git a/src/com/android/phone/EnableFdnScreen.java b/src/com/android/phone/settings/fdn/EnableFdnScreen.java
similarity index 97%
rename from src/com/android/phone/EnableFdnScreen.java
rename to src/com/android/phone/settings/fdn/EnableFdnScreen.java
index 0db47c3..d774ba7 100644
--- a/src/com/android/phone/EnableFdnScreen.java
+++ b/src/com/android/phone/settings/fdn/EnableFdnScreen.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.Activity;
import android.os.AsyncResult;
@@ -31,6 +31,8 @@
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.Phone;
+import com.android.phone.PhoneGlobals;
+import com.android.phone.R;
/**
* UI to enable/disable FDN.
diff --git a/src/com/android/phone/FdnList.java b/src/com/android/phone/settings/fdn/FdnList.java
similarity index 97%
rename from src/com/android/phone/FdnList.java
rename to src/com/android/phone/settings/fdn/FdnList.java
index 9748898..0f189d4 100644
--- a/src/com/android/phone/FdnList.java
+++ b/src/com/android/phone/settings/fdn/FdnList.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.ActionBar;
import android.content.Intent;
@@ -26,6 +26,9 @@
import android.view.View;
import android.widget.ListView;
+import com.android.phone.R;
+import com.android.phone.ADNList;
+
/**
* Fixed Dialing Number (FDN) List UI for the Phone app. FDN is a feature of the service provider
* that allows a user to specify a limited set of phone numbers that the SIM can dial.
diff --git a/src/com/android/phone/FdnSetting.java b/src/com/android/phone/settings/fdn/FdnSetting.java
similarity index 98%
rename from src/com/android/phone/FdnSetting.java
rename to src/com/android/phone/settings/fdn/FdnSetting.java
index a471093..35e15e5 100644
--- a/src/com/android/phone/FdnSetting.java
+++ b/src/com/android/phone/settings/fdn/FdnSetting.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.ActionBar;
import android.app.AlertDialog;
@@ -32,6 +32,9 @@
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.Phone;
+import com.android.phone.CallFeaturesSetting;
+import com.android.phone.PhoneGlobals;
+import com.android.phone.R;
/**
* FDN settings UI for the Phone app.
diff --git a/src/com/android/phone/GetPin2Screen.java b/src/com/android/phone/settings/fdn/GetPin2Screen.java
similarity index 96%
rename from src/com/android/phone/GetPin2Screen.java
rename to src/com/android/phone/settings/fdn/GetPin2Screen.java
index bf2e170..5959a51 100644
--- a/src/com/android/phone/GetPin2Screen.java
+++ b/src/com/android/phone/settings/fdn/GetPin2Screen.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.phone;
+package com.android.phone.settings.fdn;
import android.app.Activity;
import android.content.Intent;
@@ -31,6 +31,9 @@
import android.widget.EditText;
import android.widget.TextView;
+import com.android.phone.PhoneGlobals;
+import com.android.phone.R;
+
/**
* Pin2 entry screen.
*/