diff options
author | s89.jang <s89.jang@samsung.com> | 2017-04-28 17:27:52 +0900 |
---|---|---|
committer | Sangyoon Jang <s89.jang@samsung.com> | 2017-05-12 03:17:13 +0000 |
commit | 4b7aeede059952a3a15f94588a9732551d24b681 (patch) | |
tree | 0070480ccf69637dc00d6b8376820451bb7be393 | |
parent | 4d0112c054cb271356419d5edc62804c380d5bac (diff) | |
download | application-4b7aeede059952a3a15f94588a9732551d24b681.tar.gz application-4b7aeede059952a3a15f94588a9732551d24b681.tar.bz2 application-4b7aeede059952a3a15f94588a9732551d24b681.zip |
Add fallback for Package.installedTime
Since the native api for getting installed time is available over
API version 4.0, we need fallback for this member when that native api
is not supported.
Change-Id: I56e4be3a8e9491a5ccd8b8b745e890a144faccd7
Signed-off-by: s89.jang <s89.jang@samsung.com>
-rw-r--r-- | Tizen.Applications.PackageManager/Tizen.Applications/Package.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs b/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs index ae60eed..544409b 100644 --- a/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs +++ b/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs @@ -277,10 +277,18 @@ namespace Tizen.Applications { Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is accessible or not"); } - Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime); - if (err != Interop.PackageManager.ErrorCode.None) + try + { + Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime); + if (err != Interop.PackageManager.ErrorCode.None) + { + Log.Warn(LogTag, "Failed to get installed time of " + pkgId); + } + } + catch (TypeLoadException) { - Log.Warn(LogTag, "Failed to get installed time of " + pkgId); + // To support in API vesion 3.0 + package._installedTime = 0; } package._certificates = PackageCertificate.GetPackageCertificates(handle); |