Modify menu key grand, adding debugging console logs
authorcskim <charles0.kim@samsung.com>
Tue, 9 May 2017 01:50:52 +0000 (10:50 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:54 +0000 (18:34 +0900)
Change-Id: I868f2150e90ab130ebf37af4fef5480bc77d2f4e

LibTVRefCommonTizen/Ports/DbgPort.cs
TVApps/TVApps.TizenTV/TVApps.TizenTV.cs
TVApps/TVApps/TVApps.cs
TVHome/TVHome.TizenTV/TVHome.TizenTV.cs
TVHome/TVHome/TVHome.cs

index ebad4b3..3076dc5 100644 (file)
@@ -47,6 +47,12 @@ namespace LibTVRefCommonTizen.Ports
         /// </summary>
         public static string TAG = "home";
 
+
+        /// <summary>
+        /// A flag which enables console log writting
+        /// </summary>
+        private static readonly bool IsNeedToShowInConsole = true;
+
         public static string Prefix
         {
             set;
@@ -108,6 +114,10 @@ namespace LibTVRefCommonTizen.Ports
         public static void D(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
             Log.Debug(TAG, Prefix + ", " + message, file, func, line);
+            if (IsNeedToShowInConsole)
+            {
+                Console.WriteLine(String.Format("{0}, {1}:{2},{3}", message, file.Substring(file.LastIndexOf("\\")), line, func));
+            }
 
         }
 
@@ -121,6 +131,10 @@ namespace LibTVRefCommonTizen.Ports
         public static void E(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
             Log.Error(TAG, Prefix + ", " + message, file, func, line);
+            if (IsNeedToShowInConsole)
+            {
+                Console.WriteLine(String.Format("{0}, {1}:{2},{3}", message, file.Substring(file.LastIndexOf("\\")), line, func));
+            }
         }
     }
 }
\ No newline at end of file
index d758527..f8a2f19 100755 (executable)
@@ -62,6 +62,7 @@ namespace TVApps.TizenTV
             MainWindow.KeyUp += KeyUpListener;
 
             MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName, true);
+            MainWindow.KeyGrab("XF86Info", true);
         }
 
         /// <summary>
@@ -73,7 +74,8 @@ namespace TVApps.TizenTV
         private void KeyUpListener(object sender, ElmSharp.EvasKeyEventArgs args)
         {
             DebuggingUtils.Dbg("[TVApps.TizenTV.cs] Key Pressed :" + args.KeyName);
-            if (args.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0)
+            if (args.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0 ||
+                args.KeyName.CompareTo("XF86Info") == 0)
             {
                 if (notification != null)
                 {
@@ -92,6 +94,7 @@ namespace TVApps.TizenTV
             notification = null;
             PackageManagerPort.UnregisterCallbacks();
             MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
+            MainWindow.KeyUngrab("XF86Info");
         }
 
         /// <summary>
index 1263ddd..5025b15 100755 (executable)
@@ -71,10 +71,17 @@ namespace TVApps
             SizeUtils.Dpi = dpi;
             SizeUtils.ScaleRatio = scaleRatio;
 
-            string modelName;
-            if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+            try
             {
-                SizeUtils.SetModelName(modelName);
+                string modelName;
+                if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+                {
+                    SizeUtils.SetModelName(modelName);
+                }
+            }
+            catch(Exception e)
+            {
+                DebuggingUtils.Err("Cant get model name!!!, " + e.Message);
             }
 
             MainPage = new MainPage();
index 82f0fea..a7774e0 100755 (executable)
@@ -71,7 +71,7 @@ namespace TVHome.TizenTV
             /// Grab key events
             MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName, true);
             MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName, true);
-            MainWindow.KeyGrab("XF86SysMenu", true);
+            MainWindow.KeyGrab("XF86Info", true);
             MainWindow.KeyGrab("Up", false);
             MainWindow.KeyGrab("Down", false);
             MainWindow.KeyGrab("Left", false);
@@ -125,7 +125,7 @@ namespace TVHome.TizenTV
                 }
             }
             else if (e.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0 ||
-                e.KeyName.CompareTo("XF86SysMenu") == 0)
+                e.KeyName.CompareTo("XF86Info") == 0)
             {
                 if (notification != null)
                 {
@@ -152,6 +152,7 @@ namespace TVHome.TizenTV
             PackageManagerPort.UnregisterCallbacks();
             MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName);
             MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
+            MainWindow.KeyUngrab("XF86Info");
             MainWindow.KeyUngrab("Up");
             MainWindow.KeyUngrab("Down");
             MainWindow.KeyUngrab("Left");
index e40033c..e614b25 100755 (executable)
@@ -89,10 +89,17 @@ namespace TVHome
             SizeUtils.Dpi = dpi;
             SizeUtils.ScaleRatio = scaleRatio;
 
-            string modelName;
-            if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+            try
             {
-                SizeUtils.SetModelName(modelName);
+                string modelName;
+                if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+                {
+                    SizeUtils.SetModelName(modelName);
+                }
+            }
+            catch (Exception e)
+            {
+                DebuggingUtils.Err("Cant get model name!!!, " + e.Message);
             }
 
             MainPage = new MainPage();