diff --git a/interfaces/kits/native/remote_uri/remote_uri.cpp b/interfaces/kits/native/remote_uri/remote_uri.cpp index b205bec287dd6c7a097da327eaf831f113201221..c7e6bc4c36ba9f30303aa01e9b2ee87522369ad5 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 87da0624182a8645c00fcb89933c9cb605bf2e20..2dbbbfb0b0ea0df716b688cd6624b94992f0c86a 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 = "/";