[Smart forwarding] Add string and layout resource
Add string and layout resource
Bug: 170178144
Test: By manual
1. Test turn on/turn off flow
2. Test enter phone number flow
Change-Id: I343b705b0491003d8a3e77ac65630966f02d3546
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f399fc8..8b3160f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3672,6 +3672,12 @@
<service android:name=".sim.SimNotificationService"
android:permission="android.permission.BIND_JOB_SERVICE" />
+ <activity android:name=".sim.smartForwarding.SmartForwardingActivity"
+ android:theme="@style/Theme.SubSettings.Base"
+ android:exported="true"
+ android:launchMode="singleTask">
+ </activity>
+
<!-- This is the longest AndroidManifest.xml ever. -->
</application>
</manifest>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bcae9a5..fb80f293f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12627,4 +12627,29 @@
<!-- Default preference title for showing all apps on device [CHAR_LIMIT=50]-->
<string name="default_see_all_apps_title">See all apps</string>
+
+ <!-- Title for smart forwarding [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_title">Smart Forwarding</string>
+ <!-- Summary for smart forwarding enabled [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_summary_enabled">Smart Forwarding Enabled</string>
+ <!-- Summary for smart forwarding disabled [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_summary_disabled">Smart Forwarding Disabled</string>
+ <!-- Dialog title for smart forwarding ongoing [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_ongoing_title">Call Settings</string>
+ <!-- Subtext for smart forwarding ongoing [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_ongoing_text">Updating Settings...</string>
+ <!-- Dialog title for smart forwarding failed [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_failed_title">Call Settings error</string>
+ <!-- Subtext for smart forwarding failed [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_failed_text">Network or SIM card error.</string>
+ <!-- Subtext for sim is not activated [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_failed_not_activated_text">Sim is not activated.</string>
+ <!-- Title when smart forwarding can't get the phone number [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_input_mdn_title">Enter Phone numbers</string>
+ <!-- Dialog title when user update the phone number [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_input_mdn_dialog_title">Enter Phone number</string>
+ <!-- Alert Dialog text when user didn't input the phone number [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_missing_mdn_text">Phone number is missing.</string>
+ <!-- Alert Dialog text when user didn't input the phone number [CHAR LIMIT=50]-->
+ <string name="smart_forwarding_missing_alert_dialog_text">OK</string>
</resources>
diff --git a/res/xml/smart_forwarding_mdn_handler.xml b/res/xml/smart_forwarding_mdn_handler.xml
new file mode 100644
index 0000000..cefbcbf
--- /dev/null
+++ b/res/xml/smart_forwarding_mdn_handler.xml
@@ -0,0 +1,27 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <fragment android:id="@+id/fragment_settings"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@+id/cancel"
+ android:name="com.android.settings.sim.smartForwarding.MDNHandlerHeaderFragment"
+ android:layout_marginBottom="15dp" />
+
+ <Button android:id="@+id/process"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_margin="5dip"
+ android:text="process" />
+
+ <Button android:id="@+id/cancel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_margin="5dip"
+ android:text="cancel" />
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/xml/smart_forwarding_mdn_handler_header.xml b/res/xml/smart_forwarding_mdn_handler_header.xml
new file mode 100644
index 0000000..30e873f
--- /dev/null
+++ b/res/xml/smart_forwarding_mdn_handler_header.xml
@@ -0,0 +1,18 @@
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:key="network_and_internet_screen"
+ android:title="@string/smart_forwarding_input_mdn_title">
+
+ <EditTextPreference
+ android:key="slot0_phone_number"
+ android:title="SIM 1"
+ android:dialogTitle="@string/smart_forwarding_input_mdn_dialog_title"
+ android:persistent="false" />
+
+ <EditTextPreference
+ android:key="slot1_phone_number"
+ android:title="SIM 2"
+ android:dialogTitle="@string/smart_forwarding_input_mdn_dialog_title"
+ android:persistent="false" />
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/smart_forwarding_switch.xml b/res/xml/smart_forwarding_switch.xml
new file mode 100644
index 0000000..dda9d5a
--- /dev/null
+++ b/res/xml/smart_forwarding_switch.xml
@@ -0,0 +1,14 @@
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
+ android:key="smart_forwarding_preference"
+ android:title="@string/smart_forwarding_title">
+
+ <SwitchPreference
+ android:key="smart_forwarding_switch"
+ android:title="Smart forwarding"
+ android:summaryOff="@string/smart_forwarding_summary_disabled"
+ android:summaryOn="@string/smart_forwarding_summary_enabled"
+ android:disableDependentsState="true" />
+
+</PreferenceScreen>
\ No newline at end of file