Merge "Change settings style to non AppCompat" into nyc-dev
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 517305a..5c9c899 100755
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -56,7 +56,6 @@
 import com.android.contacts.common.model.RawContactDelta;
 import com.android.contacts.common.model.RawContactDeltaList;
 import com.android.contacts.common.model.RawContactModifier;
-import com.android.contacts.common.model.account.AccountType;
 import com.android.contacts.common.model.account.AccountWithDataSet;
 import com.android.contacts.common.util.PermissionsUtil;
 import com.android.contacts.compat.PinnedPositionsCompat;
@@ -68,7 +67,6 @@
 
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -375,16 +373,8 @@
             String saveModeExtraKey, int saveMode, boolean isProfile,
             Class<? extends Activity> callbackActivity, String callbackAction,
             Bundle updatedPhotos, String joinContactIdExtraKey, Long joinContactId) {
-
-        // Don't pass read-only RawContactDeltas in RawContactDeltaList to contact save service,
-        // because 1. read-only RawContactDeltas are not writable anyway; 2. read-only
-        // RawContactDeltas may be problematic, see b/23896510.
-        // Except when we must create aggregation exceptions between the raw contacts
-        if (!(saveMode == SaveMode.JOIN || saveMode == SaveMode.SPLIT)) {
-            removeReadOnlyContacts(context, state);
-        }
-
-        Intent serviceIntent = new Intent(context, ContactSaveService.class);
+        Intent serviceIntent = new Intent(
+                context, ContactSaveService.class);
         serviceIntent.setAction(ContactSaveService.ACTION_SAVE_CONTACT);
         serviceIntent.putExtra(EXTRA_CONTACT_STATE, (Parcelable) state);
         serviceIntent.putExtra(EXTRA_SAVE_IS_PROFILE, isProfile);
@@ -409,26 +399,6 @@
         return serviceIntent;
     }
 
-    private static void removeReadOnlyContacts(Context context, RawContactDeltaList state) {
-        if (Log.isLoggable(TAG, Log.VERBOSE)) {
-            Log.v(TAG, "Before trimming: " + state.size());
-        }
-        int countReadOnly = 0;
-        final Iterator<RawContactDelta> iterator = state.iterator();
-        while (iterator.hasNext()) {
-            final RawContactDelta rawContactDelta = iterator.next();
-            final AccountType accountType = rawContactDelta.getRawContactAccountType(context);
-            if (accountType != null && !accountType.areContactsWritable()) {
-                countReadOnly++;
-                iterator.remove();
-            }
-        }
-        if (Log.isLoggable(TAG, Log.VERBOSE)) {
-            Log.v(TAG, "# of read-only removed: " + countReadOnly);
-            Log.v(TAG, "After trimming: " + state.size());
-        }
-    }
-
     private void saveContact(Intent intent) {
         RawContactDeltaList state = intent.getParcelableExtra(EXTRA_CONTACT_STATE);
         boolean isProfile = intent.getBooleanExtra(EXTRA_SAVE_IS_PROFILE, false);
diff --git a/src/com/android/contacts/editor/ContactEditorBaseFragment.java b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
index 1d7ace6..181bc44 100644
--- a/src/com/android/contacts/editor/ContactEditorBaseFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
@@ -979,7 +979,8 @@
     abstract protected boolean doSaveAction(int saveMode, Long joinContactId);
 
     protected boolean startSaveService(Context context, Intent intent, int saveMode) {
-        final boolean result = ContactSaveService.startService(context, intent, saveMode);
+        final boolean result = ContactSaveService.startService(
+                context, intent, saveMode);
         if (!result) {
             onCancelEditConfirmed();
         }
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 91b52d8..3086526 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -232,7 +232,7 @@
             fieldView.setInputType(inputType);
             if (inputType == InputType.TYPE_CLASS_PHONE) {
                 PhoneNumberFormatter.setPhoneNumberFormattingTextWatcher(
-                        getContext(), fieldView, /* formatAfterWatcherSet =*/ true);
+                        getContext(), fieldView, /* formatAfterWatcherSet =*/ false);
                 fieldView.setTextDirection(View.TEXT_DIRECTION_LTR);
             }
             fieldView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);