Merge "Correct APNs for Carolina West Wireless" am: fdd5746132 am: 5927d48424

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/2021021

Change-Id: Ibb6451bfe343a8696cca9c4cfdb65cfab3f1ea0a
diff --git a/src/com/android/messaging/mmslib/pdu/PduPersister.java b/src/com/android/messaging/mmslib/pdu/PduPersister.java
index 6615d30..436867a 100644
--- a/src/com/android/messaging/mmslib/pdu/PduPersister.java
+++ b/src/com/android/messaging/mmslib/pdu/PduPersister.java
@@ -52,6 +52,7 @@
 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 @@
         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")) {
diff --git a/src/com/android/messaging/util/FileUtil.java b/src/com/android/messaging/util/FileUtil.java
index 7d59aa7..71fbb4b 100644
--- a/src/com/android/messaging/util/FileUtil.java
+++ b/src/com/android/messaging/util/FileUtil.java
@@ -117,15 +117,11 @@
         }
     }
 
-    private static boolean isFileUri(final Uri uri) {
-        return TextUtils.equals(uri.getScheme(), ContentResolver.SCHEME_FILE);
-    }
-
     // Checks if the file is in /data, and don't allow any app to send personal information.
     // We're told it's possible to create world readable hardlinks to other apps private data
     // so we ban all /data file uris.
     public static boolean isInPrivateDir(Uri uri) {
-        if (!isFileUri(uri)) {
+        if (!UriUtil.isFileUri(uri)) {
             return false;
         }
         final File file = new File(uri.getPath());
diff --git a/src/com/android/messaging/util/ImageUtils.java b/src/com/android/messaging/util/ImageUtils.java
index a228417..e541d69 100644
--- a/src/com/android/messaging/util/ImageUtils.java
+++ b/src/com/android/messaging/util/ImageUtils.java
@@ -480,7 +480,7 @@
             if (MediaScratchFileProvider.isMediaScratchSpaceUri(mUri)) {
                 inputFilePath = MediaScratchFileProvider.getFileFromUri(mUri).getAbsolutePath();
             } else {
-                if (!TextUtils.equals(mUri.getScheme(), ContentResolver.SCHEME_FILE)) {
+                if (!UriUtil.isFileUri(mUri)) {
                     Assert.fail("Expected a GIF file uri, but actual uri = " + mUri.toString());
                 }
                 inputFilePath = mUri.getPath();