From 9a91a80e99801ca2899068a5560f39f79b5d910c Mon Sep 17 00:00:00 2001 From: jeremy-jang <35089715+jeremy-jang@users.noreply.github.com> Date: Fri, 2 Dec 2022 18:30:46 +0900 Subject: [PATCH] [Packagemanager] Use ToLowerInvariant instead of ToLower (#4795) ToLower can cause unexpected error when system is busy. Signed-off-by: Sangyoon Jang Signed-off-by: Sangyoon Jang --- .../Tizen.Applications/PackageManager.cs | 6 +++--- .../Tizen.Applications/PackageType.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs index 5e24330..7305e44 100755 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs @@ -683,7 +683,7 @@ namespace Tizen.Applications { if (type != PackageType.UNKNOWN) { - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); + err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLowerInvariant()); if (err != Interop.PackageManager.ErrorCode.None) { Log.Warn(LogTag, string.Format("Failed to install packages. Error in setting request package type. err = {0}", err)); @@ -893,7 +893,7 @@ namespace Tizen.Applications try { - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); + err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLowerInvariant()); if (err != Interop.PackageManager.ErrorCode.None) { Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. Error in setting request package type. err = {1}", packageId, err)); @@ -1024,7 +1024,7 @@ namespace Tizen.Applications try { bool result = true; - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); + err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLowerInvariant()); if (err != Interop.PackageManager.ErrorCode.None) { Log.Warn(LogTag, string.Format("Failed to move package. Error in setting request package type. err = {0}", err)); diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs index c7ef31d..b70ff3f 100644 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs @@ -52,7 +52,7 @@ namespace Tizen.Applications throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "type can't be null or empty"); } - string lowerType = type.ToLower(); + string lowerType = type.ToLowerInvariant(); if (lowerType == "tpk") { return PackageType.TPK; -- 2.7.4