Resolve bt modified name not retained after app restart issue. 71/293071/2 accepted/tizen/unified/20230601.163003
authorAnuj Kumar Singh <anujk.singh@samsung.com>
Fri, 19 May 2023 06:00:30 +0000 (11:30 +0530)
committerAnuj Kumar Singh <anujk.singh@samsung.com>
Fri, 19 May 2023 08:39:04 +0000 (14:09 +0530)
Change-Id: I51de780089451dc2905e1fc612657bc5a5282623
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
SettingBluetooth/SettingBluetooth/Model/BtDevice.cs
SettingBluetooth/SettingBluetooth/View/BtDetailView.cs
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index 241a8332b75317c9ccb99ce46cb53af0276d68fc..434738a636c65337b572319fb3d4987c557ddc17 100644 (file)
@@ -477,5 +477,17 @@ namespace SettingBluetooth
                 Log.Error(SettingBluetooth.LogTag, "DisconnectHid failed: " + e.ToString());
             }
         }
+
+        internal void RenameRemoteBtDevice(string deviceName)
+        {
+            try
+            {
+                mBluetoothDevice.SetAlias(deviceName);
+            }
+            catch (Exception e)
+            {
+                Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message);
+            }
+        }
     }
 }
index 189bfd295e93ffa8c44413bdee7c9756d46276aa..a02292d69f6cf30ed6af3310a14504bc19c23d6b 100644 (file)
@@ -178,9 +178,9 @@ namespace SettingBluetooth
         {
             try
             {
-                Log.Debug(SettingBluetooth.LogTag, "Device name before rename: " + mDevice.Name);
                 mDevice.Name = mRenameField.Text;
-                Log.Debug(SettingBluetooth.LogTag, "Device Name after rename: " + mDevice.Name);
+                mDevice.BtDevice.RenameRemoteBtDevice(mDevice.Name);
+                Log.Debug(SettingBluetooth.LogTag, "Updated Device Name: " + mDevice.Name);
             }
             catch(Exception e)
             {
index 26990a975b538d1e10b9fd96187f0b11c0bbf041..2d94d00fdc071f6ad708a6ea9fcb4fc9d848de2e 100644 (file)
@@ -21,7 +21,7 @@ namespace SettingBluetooth
         //private bool connected;
         //private bool registered;
         public event PropertyChangedEventHandler PropertyChanged;
-        BtDevice mBtDevice;
+        private BtDevice mBtDevice;
         private string mState;
         private int mRssi;
 
index a855a7f32b16be54c6c35759f66402c0a80661e4..c9255a9557a07405adc08ad7f90acb7ede08be58 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