From: Anuj Kumar Singh Date: Fri, 19 May 2023 06:00:30 +0000 (+0530) Subject: Resolve bt modified name not retained after app restart issue. X-Git-Tag: accepted/tizen/unified/20230601.163003^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F293071%2F2;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Resolve bt modified name not retained after app restart issue. Change-Id: I51de780089451dc2905e1fc612657bc5a5282623 Signed-off-by: Anuj Kumar Singh --- diff --git a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs index 241a833..434738a 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs @@ -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); + } + } } } diff --git a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs index 189bfd2..a02292d 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs @@ -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) { diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index 26990a9..2d94d00 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -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; diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index a855a7f..c9255a9 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ