Fix writeable mode bug with CP2 contact photo.

Bug: 150857116
Test: atest ContactsProvider2Test
Test: atest android.permission.cts.ContactsProviderTest
Test: atest android.permission2.cts.ContactsProviderTest
Change-Id: I4d81971cb562b130d5edfdaa77444969fbf315af
(cherry picked from commit 1a449253b3f9c7c6fba3bd5c122a9659be7d5090)
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 5159fb9..99d8bcf 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -8628,7 +8628,7 @@
 
             case RAW_CONTACTS_ID_DISPLAY_PHOTO: {
                 long rawContactId = Long.parseLong(uri.getPathSegments().get(1));
-                boolean writeable = !mode.equals("r");
+                boolean writeable = mode.contains("w");
 
                 // Find the primary photo data record for this raw contact.
                 SQLiteQueryBuilder qb = new SQLiteQueryBuilder();