Clean up Tizen.Applications
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 25 Apr 2016 00:22:56 +0000 (09:22 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Mon, 25 Apr 2016 07:25:11 +0000 (16:25 +0900)
Change-Id: I8f18560a6282ac077ace99afa8d65eec4ecd8869

Tizen.Applications/CustomDictionary.xml [new file with mode: 0755]
Tizen.Applications/GlobalSuppressions.cs [new file with mode: 0755]
Tizen.Applications/Tizen.Applications.csproj
Tizen.Applications/Tizen.Applications/Application.cs
Tizen.Applications/Tizen.Applications/ApplicationInfo.cs
Tizen.Applications/Tizen.Applications/ApplicationInfoFilter.cs
Tizen.Applications/Tizen.Applications/ApplicationManager.cs
Tizen.Applications/Tizen.Applications/LowMemoryStatus.cs
Tizen.Applications/Tizen.Applications/TizenSynchronizationContext.cs [changed mode: 0644->0755]

diff --git a/Tizen.Applications/CustomDictionary.xml b/Tizen.Applications/CustomDictionary.xml
new file mode 100755 (executable)
index 0000000..ca9eb94
--- /dev/null
@@ -0,0 +1,7 @@
+<Dictionary>
+       <Words>
+               <Recognized>
+                       <Word>Tizen</Word>
+               </Recognized>
+       </Words>
+</Dictionary>
diff --git a/Tizen.Applications/GlobalSuppressions.cs b/Tizen.Applications/GlobalSuppressions.cs
new file mode 100755 (executable)
index 0000000..aef5e44
Binary files /dev/null and b/Tizen.Applications/GlobalSuppressions.cs differ
index cdc1398..67b88b5 100755 (executable)
@@ -50,6 +50,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="GlobalSuppressions.cs" />
     <Compile Include="Interop\Interop.AppCommon.cs" />
     <Compile Include="Interop\Interop.AppControl.cs" />
     <Compile Include="Interop\Interop.AppEvent.cs" />
       <Name>Tizen</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <CodeAnalysisDictionary Include="CustomDictionary.xml" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
        Other similar extension points exist, see Microsoft.Common.targets.
index bc27cb3..f4ee478 100755 (executable)
@@ -86,17 +86,21 @@ namespace Tizen.Applications
             {
                 lock (_lock)
                 {
-                    string appId;
-                    ErrorCode err = Interop.AppCommon.AppGetId(out appId);
-                    if (err == ErrorCode.None)
+                    if (_applicationInfo == null)
                     {
-                        try
+                        string appId;
+                        ErrorCode err = Interop.AppCommon.AppGetId(out appId);
+                        if (err == ErrorCode.None)
                         {
-                            _applicationInfo = ApplicationManager.GetInstalledApplication(appId);
-                        }
-                        catch (Exception e)
-                        {
-                            Log.Warn(LogTag, "Failed to get application info. " + e.Message);
+                            try
+                            {
+                                // TODO: Use lazy enabled AppInfo class without throwing exceptions.
+                                _applicationInfo = ApplicationManager.GetInstalledApplication(appId);
+                            }
+                            catch (Exception e)
+                            {
+                                Log.Warn(LogTag, "Failed to get application info. " + e.Message);
+                            }
                         }
                     }
                 }
@@ -110,6 +114,11 @@ namespace Tizen.Applications
         /// <param name="args">Arguments from commandline.</param>
         public virtual void Run(string[] args)
         {
+            if (args == null)
+            {
+                throw new ArgumentNullException("args");
+            }
+
             s_CurrentApplication = this;
 
             Interop.AppEvent.AddEventHandler(Interop.AppEvent.EventNames.LowMemory, HandleAppEvent, IntPtr.Zero, out _lowMemoryNativeHandle);
@@ -194,7 +203,6 @@ namespace Tizen.Applications
 
         private void HandleAppEvent(string eventName, IntPtr eventData, IntPtr data)
         {
-            Console.WriteLine("HandleAppEvent!! eventName={0}, eventData={1}", eventName, eventData);
             Bundle b = new Bundle(eventData);
             if (eventName == Interop.AppEvent.EventNames.LowMemory)
             {
index 41c6dd5..f04191b 100755 (executable)
@@ -74,9 +74,9 @@ namespace Tizen.Applications
         }
 
         /// <summary>
-        /// Gets the excutable path of the application.
+        /// Gets the executable path of the application.
         /// </summary>
-        public string ExcutablePath
+        public string ExecutablePath
         {
             get
             {
@@ -100,9 +100,9 @@ namespace Tizen.Applications
         }
 
         /// <summary>
-        /// Gets the package type name.
+        /// Gets the application type name.
         /// </summary>
-        public string Type
+        public string ApplicationType
         {
             get
             {
index 95e48b7..26eac30 100755 (executable)
@@ -49,7 +49,6 @@ namespace Tizen.Applications
         public IDictionary<string, string> Filter
         {
             get;
-            set;
         }
     }
 }
index fab0a9b..043f327 100755 (executable)
@@ -428,8 +428,6 @@ namespace Tizen.Applications
             {
                 case Interop.ApplicationManager.ErrorCode.InvalidParameter:
                     return new ArgumentException(errMessage);
-                case Interop.ApplicationManager.ErrorCode.OutOfMemory:
-                    return new OutOfMemoryException(errMessage);
                 default:
                     return new InvalidOperationException(errMessage);
             }
index b89cde8..709c73d 100755 (executable)
@@ -14,6 +14,11 @@ namespace Tizen.Applications
     public enum LowMemoryStatus
     {
         /// <summary>
+        /// Not initialized status
+        /// </summary>
+        None = 0x00,
+
+        /// <summary>
         /// Normal status
         /// </summary>
         Normal = 0x01,