Resolve InfoPage issues of updated info not getting retained and 97/287397/2 accepted/tizen/unified/20230303.162802
authorAkash Kumar <akash1.kumar@samsung.com>
Fri, 27 Jan 2023 11:19:02 +0000 (16:49 +0530)
committerAkash Kumar <akash1.kumar@samsung.com>
Thu, 2 Feb 2023 11:34:28 +0000 (17:04 +0530)
not showing correct info on "static ip on".

This patch resolves following issues:
- When some field used to be updated, the updated info was not reatined on next start of app.
- On "static ip on" dns1, dns2, Gateway and SubnetMask info was not shown.
- This patch also handles the crash issue of the app when backbutton is pressed.

Change-Id: I9acc64fc688675a62d62daa579f403edd3da7a50
Signed-off-by: Akash Kumar <akash1.kumar@samsung.com>
SettingWiFi/SettingWiFi/controller/WiFi.cs
SettingWiFi/SettingWiFi/view/ApInfoSource.cs
SettingWiFi/SettingWiFi/view/InfoInputPage.cs
SettingWiFi/SettingWiFi/view/InfoPage.cs
packaging/org.tizen.cssetting-wifi-1.0.0.tpk

index a3c195af2d09dcd9c4d5923c29e4603ca75cc278..4c2d9164f86eabe4ce2463eac646852c226f1a00 100755 (executable)
@@ -248,6 +248,10 @@ namespace SettingWiFi
             }\r
 \r
             ap.StaticIPConfig = (networkInfo.IPv4Setting.IPConfigType == IPConfigType.Static);\r
+            ap.Dns1 = networkInfo.IPv4Setting.Dns1.ToString();\r
+            ap.Dns2 = networkInfo.IPv4Setting.Dns2.ToString();\r
+            ap.SubnetMask = networkInfo.IPv4Setting.SubnetMask.ToString();\r
+            ap.GatewayAddress = networkInfo.IPv4Setting.Gateway.ToString();\r
 \r
             return ap;\r
         }\r
@@ -352,17 +356,31 @@ namespace SettingWiFi
             return wpsPin;\r
         }\r
 \r
-        public void UpateIpConfigMethod(AP ap, bool isStaticIpConfig)\r
+        public void UpdateIpConfigMethod(AP ap, bool isStaticIpConfig)\r
         {\r
             if (isStaticIpConfig)\r
             {\r
-                ap.ApHandle.NetworkInformation.IPv4Setting.IPConfigType = IPConfigType.Static;\r
-                ap.ApHandle.NetworkInformation.IPv6Setting.IPConfigType = IPConfigType.Static;\r
+                try\r
+                {\r
+                    ap.ApHandle.NetworkInformation.IPv4Setting.IPConfigType = IPConfigType.Static;\r
+                    ap.ApHandle.NetworkInformation.IPv6Setting.IPConfigType = IPConfigType.Static;\r
+                }\r
+                catch (Exception e)\r
+                {\r
+                    Error("Exception occured: " + e.Message + " " + e.StackTrace);\r
+                }\r
             }\r
             else\r
             {\r
-                ap.ApHandle.NetworkInformation.IPv4Setting.IPConfigType = IPConfigType.Dynamic;\r
-                ap.ApHandle.NetworkInformation.IPv6Setting.IPConfigType = IPConfigType.Dynamic;\r
+                try\r
+                {\r
+                    ap.ApHandle.NetworkInformation.IPv4Setting.IPConfigType = IPConfigType.Dynamic;\r
+                    ap.ApHandle.NetworkInformation.IPv6Setting.IPConfigType = IPConfigType.Dynamic;\r
+                }\r
+                catch(Exception e)\r
+                {\r
+                    Error("Exception occured: " + e.Message + " " + e.StackTrace);\r
+                }\r
             }\r
         }\r
 \r
index 755aae2a66fb583c8fd97e20a3179a7330c1dfdd..ec282c1cbf4b341ce5002cf89429a466f3fa7076 100644 (file)
@@ -42,29 +42,16 @@ namespace SettingWiFi
             Add(new ApInfoText(Resources.IDS_WIFI_BODY_MAC_ADDRESS, mAp.Bssid, null));
             if (mAp.ProxyAddress?.Length > 0)
             {
-                Add(new ApInfoText(Resources.IDS_ST_SBODY_PROXY_ADDRESS, mAp.ProxyAddress, null));
+                Add(new ApInfoText(Resources.IDS_ST_SBODY_PROXY_ADDRESS, mAp.ProxyAddress, UpdateProxyAddress));
             }
             if (mAp.ProxyPort >= 0)
             {
-                Add(new ApInfoText(Resources.IDS_ST_SBODY_PROXY_PORT, "" + mAp.ProxyPort, null));
+                Add(new ApInfoText(Resources.IDS_ST_SBODY_PROXY_PORT, "" + mAp.ProxyPort, UpdateProxyPort));
             }
         }
 
         private void ShowStaticInfo(bool isConfigChanged)
         {
-            /*
-            if (isConfigChanged)
-            {
-                mAp.IPv4 = "";
-                mAp.SubnetMask = "";
-                mAp.GatewayAddress = "";
-                mAp.Dns1 = "";
-                mAp.Dns2 = "";
-                mAp.ProxyAddress = "";
-                mAp.ProxyPort = 0;
-            }
-            */
-
             Add(new ApInfoText(Resources.IDS_WIFI_BODY_IP_ADDRESS, mAp.IPv4, UpdateIPAddress));
             Add(new ApInfoText(Resources.IDS_WIFI_BODY_SUBNET_MASK, mAp.SubnetMask, UpdateSubnetMask));
             Add(new ApInfoText(Resources.IDS_WIFI_BODY_GATEWAY_ADDRESS, mAp.GatewayAddress, UpdateGatewayAddress));
@@ -107,7 +94,9 @@ namespace SettingWiFi
 
         public bool UpdateProxyAddress(string address)
         {
+            Debug("UpdateProxyAddress " + address);
             mProxyAddress = address;
+            mWifi.UpdateProxy(mAp, mProxyAddress);
             return true;
         }
 
@@ -119,8 +108,13 @@ namespace SettingWiFi
                 Error("port parsing error");
                 return false;
             }
-            mProxyAddress += ":" + port;
-            return UpdateProxyAddress(mProxyAddress);
+            else
+            {
+                mProxyAddress += ":" + port;
+                Debug("Proxy: " + mProxyAddress);
+                return UpdateProxyAddress(mProxyAddress);
+
+            }
         }
     }
 
index 89168a3bb6be5eac565c8d281f1e7887833efca2..41981b34c6905d738036e62863d5e43cd6bcd8c4 100644 (file)
@@ -38,7 +38,7 @@ namespace SettingWiFi
                 HeightSpecification = LayoutParamPolicies.WrapContent,
             };
 
-            var mValueField = new TextField()
+            mValueField = new TextField()
             {
                 WidthSpecification = 600,
                 PlaceholderText = value,
index a1eaa0c9d6ea8e923d12c39eb1c4b4520710254f..98899be65b8178cc055dbac9b63ed6c5e50d858e 100644 (file)
@@ -244,16 +244,17 @@ namespace SettingWiFi
 
         private void OnBackClicked(object source, ClickedEventArgs args)
         {
-            if (mIsOriginOnOffSwitchSelected != mOnOffSwitch.IsSelected)
-            {
-                UpdateApInfo(mOnOffSwitch.IsSelected);
-            }
+            //if (mIsOriginOnOffSwitchSelected != mOnOffSwitch.IsSelected)
+            //{
+            //    UpdateApInfo(mOnOffSwitch.IsSelected);
+            //}
+            UpdateApInfo(mOnOffSwitch.IsSelected);
             Navigator.Pop();
         }
 
         private void UpdateApInfo(bool isStaticIpConfig)
         {
-            mWifi.UpateIpConfigMethod(mAp, isStaticIpConfig);
+            mWifi.UpdateIpConfigMethod(mAp, isStaticIpConfig);
             if (isStaticIpConfig)
             {
                 GetStaticIpInfo();
index 52b40addd9857570b2fda8be95c375dee121c303..f523c8bb738a2ab5532c6276f8c5f77ca73c1622 100644 (file)
Binary files a/packaging/org.tizen.cssetting-wifi-1.0.0.tpk and b/packaging/org.tizen.cssetting-wifi-1.0.0.tpk differ