Fix SonarCube issues 05/239905/4
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 30 Jul 2020 11:03:52 +0000 (13:03 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 30 Jul 2020 23:12:57 +0000 (23:12 +0000)
Change-Id: I5d0684f5d0e98803cfa6ec7c3d4ca1a58330717c

Oobe/Oobe.Common/Controls/ScrollableBase.cs
Oobe/Oobe.Common/Services/Interop/Interop.VConf.cs
Oobe/Oobe.Common/Services/Vconf.cs
Oobe/Oobe.Wifi/Controls/Wifi/ApManager.cs
Oobe/Oobe.Wifi/Controls/Wifi/PasswordEntry.cs

index cc36176fd36f2573a4cc82c5a013fbfd97178b8d..89c3005467864419b0227d5c8bff3e4f1b6d6aa9 100644 (file)
@@ -422,7 +422,10 @@ namespace Oobe.Common.Controls
             mScrollingChild.Relayout += OnChildRelayout;
 
             propertyNotification = mScrollingChild?.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
-            propertyNotification.Notified += OnPropertyChanged;
+            if (propertyNotification != null)
+            {
+                propertyNotification.Notified += OnPropertyChanged;
+            }
 
             {
                 if (Children.Count > 1)
index 9bb4854fa37424f96cbce0c94c2d41edc8cb2b39..73e3cfab7abac4c21ee2a326023db183d4daa0e3 100644 (file)
 using System.Runtime.InteropServices;
 using static Oobe.Common.Services.Vconf;
 
-internal static partial class Interop
+namespace Oobe.Common.Services.Interoperability
 {
-    internal static partial class Vconf
+    internal static partial class Interop
     {
-        private const string LIBRARY_VCONF = "libvconf.so.0";
+        internal static partial class Vconf
+        {
+            private const string LIBRARY_VCONF = "libvconf.so.0";
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_bool")]
-        internal static extern int VconfGetBool(string key, out bool val);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_bool")]
+            internal static extern int VconfGetBool(string key, out bool val);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_bool")]
-        internal static extern int VconfSetBool(string key, bool intval);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_bool")]
+            internal static extern int VconfSetBool(string key, bool intval);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_int")]
-        internal static extern int VconfGetInt(string key, out int val);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_int")]
+            internal static extern int VconfGetInt(string key, out int val);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_int")]
-        internal static extern int VconfSetInt(string key, int intval);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_int")]
+            internal static extern int VconfSetInt(string key, int intval);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_str")]
-        internal static extern string VconfGetStr(string key);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_str")]
+            internal static extern string VconfGetStr(string key);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_str")]
-        internal static extern int VconfSetStr(string key, string value);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_str")]
+            internal static extern int VconfSetStr(string key, string value);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_notify_key_changed")]
-        internal static extern void VconfNotifyKeyChanged(string key, NotificationCallback callback, IntPtr userData);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_notify_key_changed")]
+            internal static extern void VconfNotifyKeyChanged(string key, NotificationCallback callback, IntPtr userData);
 
-        [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_ignore_key_changed")]
-        internal static extern void VconfIgnoreKeyChanged(string key, NotificationCallback callback);
+            [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_ignore_key_changed")]
+            internal static extern void VconfIgnoreKeyChanged(string key, NotificationCallback callback);
+        }
     }
 }
index 652c999e18c3c57028d2138f5e753856ed3c49d6..87b2ba158662942687085f4c2a192e797fcf0882 100644 (file)
@@ -17,7 +17,7 @@
 using System;
 using System.Runtime.InteropServices;
 using Oobe.Common.Utils;
-using static Interop.Vconf;
+using static Oobe.Common.Services.Interoperability.Interop.Vconf;
 
 namespace Oobe.Common.Services
 {
index 8f1496f3f10ff7d99451778eddce49d9b1512954..cafd8e01c2f501c828dc6da1c6b82bbe3e8d8a8c 100644 (file)
@@ -39,7 +39,7 @@ namespace Oobe.Wifi.Controls.Wifi
         {
             this.onTapped = onTapped;
             WiFiManager.ConnectionStateChanged += OnConnectionStateChanged;
-            RunUpdatingAps();
+            _ = RunUpdatingAps();
         }
 
         private void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
@@ -95,7 +95,7 @@ namespace Oobe.Wifi.Controls.Wifi
             }
         }
 
-        private async void RunUpdatingAps()
+        private async Task RunUpdatingAps()
         {
             while (await Delay())
             {
index 1c8fa4edfaf458251f1a903c7bd211bc83c44827..94d8546e803f742c2074a189c698b3f110ef4a5b 100644 (file)
@@ -33,7 +33,9 @@ namespace Oobe.Wifi.Controls.Wifi
                     revealPassword();
                 else
                     hidePassword();
+#pragma warning disable S1656
                 Text = Text; //for refreshing - causes resetting cursor
+#pragma warning restore S1656
             }
         }