Resolve bt device rename issue. 21/293021/1
authorAnuj Kumar Singh <anujk.singh@samsung.com>
Thu, 18 May 2023 06:06:35 +0000 (11:36 +0530)
committerAnuj Kumar Singh <anujk.singh@samsung.com>
Thu, 18 May 2023 06:06:35 +0000 (11:36 +0530)
Change-Id: I6997ca75e87e2eedfe3e8209c72c485a5740931f
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
SettingBluetooth/SettingBluetooth/View/BtDetailView.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index a9b33ce99a929b7ebe86de45ef93d11161c3c632..189bfd295e93ffa8c44413bdee7c9756d46276aa 100644 (file)
@@ -13,10 +13,12 @@ namespace SettingBluetooth
         static View mDetailView;
         static ContentPage mDetailPage;
         static string mBtDeviceName;
+        static Device mDevice;
 
         internal static void CreateDetailView(Device device)
         {
             Window window = NUIApplication.GetDefaultWindow();
+            mDevice = device;
 
             var appBar = new AppBar()
             {
@@ -108,26 +110,27 @@ namespace SettingBluetooth
         {
             DefaultLinearItem deviceItem = (DefaultLinearItem)sender;
             var deviceName = deviceItem.BindingContext as string;
+            deviceName = mBtDeviceName;
             Log.Debug(SettingBluetooth.LogTag, "Name: " + deviceName);
-            /*
+
             Window window = NUIApplication.GetDefaultWindow();
-            var connectPage = new RenamePage(device);
+            var connectPage = new RenamePage(deviceName, mDevice);
             mBtDeviceName =  connectPage.CreateComponents(mBtDeviceName);
-            window.GetDefaultNavigator().Push(connectPage);*/
+            window.GetDefaultNavigator().Push(connectPage);
         }
     }
 
     internal class RenamePage : DialogPage
     {
         TextField mRenameField;
-        Device mDevice;
+        static Device mDevice;
         private static void PopDialog()
         {
             Navigator navigator = NUIApplication.GetDefaultWindow().GetDefaultNavigator();
             navigator?.Pop();
         }
 
-        internal RenamePage(Device device)
+        internal RenamePage(string deviceName, Device device)
         {
             mDevice = device;
         }
@@ -175,16 +178,17 @@ namespace SettingBluetooth
         {
             try
             {
-                Log.Debug(SettingBluetooth.LogTag, "Old Name " + mDevice.Name + " field value; " + mRenameField.Text);
+                Log.Debug(SettingBluetooth.LogTag, "Device name before rename: " + mDevice.Name);
                 mDevice.Name = mRenameField.Text;
-                Log.Debug(SettingBluetooth.LogTag, "New Name " + mDevice.Name);
-                Navigator.Pop();
+                Log.Debug(SettingBluetooth.LogTag, "Device Name after rename: " + mDevice.Name);
             }
             catch(Exception e)
             {
                 Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message);
             }
-            Navigator.Pop();
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+            BtDetailView.CreateDetailView(mDevice);
         }
     }
 }
index 4d62c5ab7a9611c22fc7bc6908ac34029f323b46..a855a7f32b16be54c6c35759f66402c0a80661e4 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ