am a2e929e1: Tighten enforcement of file modes.

* commit 'a2e929e1df62947b7967258f21fd05b27a571878':
  Tighten enforcement of file modes.
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index b22179e..42618ac 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -238,7 +238,7 @@
         @Override
         public ParcelFileDescriptor openFile(Uri uri, String mode)
                 throws FileNotFoundException {
-            if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri);
+            if (mode != null && mode.indexOf('w') != -1) enforceWritePermission(uri);
             else enforceReadPermission(uri);
             return ContentProvider.this.openFile(uri, mode);
         }
@@ -246,7 +246,7 @@
         @Override
         public AssetFileDescriptor openAssetFile(Uri uri, String mode)
                 throws FileNotFoundException {
-            if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri);
+            if (mode != null && mode.indexOf('w') != -1) enforceWritePermission(uri);
             else enforceReadPermission(uri);
             return ContentProvider.this.openAssetFile(uri, mode);
         }