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/AndroidManifest.xml b/AndroidManifest.xml
index 61eaa2c..ce9ea49 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -146,7 +146,7 @@
</intent-filter>
</activity>
- <activity android:name="FdnList"
+ <activity android:name="com.android.phone.settings.fdn.FdnList"
android:label="@string/fdnListLabel"
android:theme="@style/DialerSettingsLight">
<intent-filter>
@@ -357,7 +357,7 @@
</activity>
<!-- fdn setting -->
- <activity android:name="FdnSetting"
+ <activity android:name="com.android.phone.settings.fdn.FdnSetting"
android:label="@string/fdn"
android:theme="@style/DialerSettingsLight">
<intent-filter>
@@ -365,7 +365,7 @@
</intent-filter>
</activity>
- <activity android:name="EnableFdnScreen"
+ <activity android:name="com.android.phone.settings.fdn.EnableFdnScreen"
android:label=""
android:theme="@style/DialerSettingsLight">
</activity>
@@ -389,18 +389,18 @@
</intent-filter>
</activity>
- <activity android:name="GetPin2Screen"
+ <activity android:name="com.android.phone.settings.fdn.GetPin2Screen"
android:label="@string/get_pin2"
android:theme="@style/SettingsLight"
android:windowSoftInputMode="stateVisible">
</activity>
- <activity android:name="EditFdnContactScreen"
+ <activity android:name="com.android.phone.settings.fdn.EditFdnContactScreen"
android:theme="@style/DialerSettingsLight"
android:windowSoftInputMode="stateVisible">
</activity>
- <activity android:name="DeleteFdnContactScreen"
+ <activity android:name="com.android.phone.settings.fdn.DeleteFdnContactScreen"
android:theme="@style/DialerSettingsLight"
android:label="@string/delete_fdn_contact">
</activity>
diff --git a/res/xml/call_feature_setting.xml b/res/xml/call_feature_setting.xml
index f958c1a..bcda6b0 100644
--- a/res/xml/call_feature_setting.xml
+++ b/res/xml/call_feature_setting.xml
@@ -85,7 +85,7 @@
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.FdnSetting" />
+ android:targetClass="com.android.phone.settings.fdn.FdnSetting" />
</PreferenceScreen>
diff --git a/res/xml/fdn_setting.xml b/res/xml/fdn_setting.xml
index 4c62cf5..d03cf7c 100644
--- a/res/xml/fdn_setting.xml
+++ b/res/xml/fdn_setting.xml
@@ -16,31 +16,31 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Rearranged to use EditPinPreference -->
- <com.android.phone.EditPinPreference
- android:key="button_fdn_enable_key"
+ <com.android.phone.settings.fdn.EditPinPreference
+ android:key="button_fdn_enable_key"
android:persistent="false"
android:dialogMessage="@string/enter_pin2_text"
android:title="@string/fdn_activation"/>
-
+
<!-- Rearranged to use EditPinPreference -->
- <com.android.phone.EditPinPreference
- android:key="button_change_pin2_key"
+ <com.android.phone.settings.fdn.EditPinPreference
+ android:key="button_change_pin2_key"
android:title="@string/change_pin2"
android:dialogTitle="@string/change_pin2"
android:summary="@string/sum_fdn_change_pin"
android:persistent="false"/>
-
- <PreferenceScreen
- android:key="button_fdn_list_key"
+
+ <PreferenceScreen
+ android:key="button_fdn_list_key"
android:title="@string/manage_fdn_list"
android:summary="@string/sum_fdn_manage_list"
android:persistent="false">
-
+
<!-- Intent to lauch the FDN list. -->
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.FdnList" />
-
+ android:targetClass="com.android.phone.settings.fdn.FdnList" />
+
</PreferenceScreen>
-
+
</PreferenceScreen>
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.
*/