Use UriUtil when checking if a URI is a file.
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE. Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2 Bug: 215212561
This commit is contained in:
@@ -52,6 +52,7 @@ import com.android.messaging.util.Assert;
|
||||
import com.android.messaging.util.ContentType;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
import com.android.messaging.util.OsUtil;
|
||||
import com.android.messaging.util.UriUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
@@ -1018,8 +1019,7 @@ public class PduPersister {
|
||||
String path = null;
|
||||
if (null != uri) {
|
||||
final String scheme = uri.getScheme();
|
||||
if (null == scheme || scheme.equals("") ||
|
||||
scheme.equals(ContentResolver.SCHEME_FILE)) {
|
||||
if (null == scheme || scheme.equals("") || UriUtil.isFileUri(uri)) {
|
||||
path = uri.getPath();
|
||||
|
||||
} else if (scheme.equals("http")) {
|
||||
|
||||
Reference in New Issue
Block a user