From ed4965be2e50d60c8d3be7e7cba5e2cb2053a01f Mon Sep 17 00:00:00 2001 From: zkx Date: Fri, 28 Apr 2023 18:17:55 +0800 Subject: [PATCH] update IsMediaUri Interface. Signed-off-by: zkx --- interfaces/kits/native/remote_uri/remote_uri.cpp | 3 +++ interfaces/kits/native/remote_uri/remote_uri.h | 1 + 2 files changed, 4 insertions(+) diff --git a/interfaces/kits/native/remote_uri/remote_uri.cpp b/interfaces/kits/native/remote_uri/remote_uri.cpp index b205bec28..c7e6bc4c3 100644 --- a/interfaces/kits/native/remote_uri/remote_uri.cpp +++ b/interfaces/kits/native/remote_uri/remote_uri.cpp @@ -30,6 +30,9 @@ using namespace std; bool RemoteUri::IsMediaUri(const string &uriString) { + if (uriString.find(MEDIALIBRARY_FILE_URI_PREFIX) != string::npos) { + return true; + } RemoteUri remoteUri = RemoteUri(uriString); string scheme = remoteUri.GetScheme(); string path = remoteUri.GetPath(); diff --git a/interfaces/kits/native/remote_uri/remote_uri.h b/interfaces/kits/native/remote_uri/remote_uri.h index 87da06241..2dbbbfb0b 100644 --- a/interfaces/kits/native/remote_uri/remote_uri.h +++ b/interfaces/kits/native/remote_uri/remote_uri.h @@ -33,6 +33,7 @@ const string REMOTE_URI_TAG = "fdFromBinder"; const string SCHEME_TAG = ":"; const string SCHEME = "datashare"; const string SCHEME_FILE = "file"; +const string MEDIALIBRARY_FILE_URI_PREFIX = "file://media"; const string ZERO_FD = "0"; const string MEDIA = "/media/"; const string PATH_SYMBOL = "/"; -- Gitee