Loading res/layout/external_raw_contact_editor_view.xml→res/layout/raw_contact_readonly_editor_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,7 @@ limitations under the License. --> <!-- placed inside act_edit as tabcontent --> <com.android.contacts.editor.ExternalRawContactEditorView <com.android.contacts.editor.RawContactReadOnlyEditorView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -77,4 +76,4 @@ android:layout_height="wrap_content" android:orientation="vertical"/> </com.android.contacts.editor.ExternalRawContactEditorView> </com.android.contacts.editor.RawContactReadOnlyEditorView> src/com/android/contacts/activities/ConfirmAddDetailActivity.java +1 −2 Original line number Diff line number Diff line Loading @@ -560,8 +560,7 @@ public class ConfirmAddDetailActivity extends Activity implements final String dataSet = state.getValues().getAsString(RawContacts.DATA_SET); final AccountType type = mAccountTypeManager.getAccountType(accountType, dataSet); // Raw contacts that are not from external sources should be editable. if (!type.isExternal()) { if (type.areContactsWritable()) { mEditableAccountType = type; mState = state; return; Loading src/com/android/contacts/detail/ContactDetailFragment.java +1 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import com.android.contacts.ContactPresenceIconUtil; import com.android.contacts.ContactSaveService; import com.android.contacts.ContactsUtils; import com.android.contacts.GroupMetaData; import com.android.contacts.NfcHandler; import com.android.contacts.R; import com.android.contacts.TypePrecedence; import com.android.contacts.activities.ContactDetailActivity.FragmentKeyListener; Loading Loading @@ -154,7 +153,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen private Button mQuickFixButton; private QuickFix mQuickFix; private final ArrayList<Long> mWritableRawContactIds = new ArrayList<Long>(); private int mNumPhoneNumbers = 0; private String mDefaultCountryIso; private boolean mContactHasSocialUpdates; Loading Loading @@ -531,8 +529,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen mPrimaryPhoneUri = null; mNumPhoneNumbers = 0; mWritableRawContactIds.clear(); final AccountTypeManager accountTypes = AccountTypeManager.getInstance(mContext); // Build up method entries Loading @@ -550,10 +546,8 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen if (!mRawContactIds.contains(rawContactId)) { mRawContactIds.add(rawContactId); } AccountType type = accountTypes.getAccountType(accountType, dataSet); if (type == null || type.areContactsWritable()) { mWritableRawContactIds.add(rawContactId); } for (NamedContentValues subValue : entity.getSubValues()) { final ContentValues entryValues = subValue.values; Loading src/com/android/contacts/editor/ContactEditorFragment.java +6 −5 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ import java.util.List; public class ContactEditorFragment extends Fragment implements SplitContactConfirmationDialogFragment.Listener, AggregationSuggestionEngine.Listener, AggregationSuggestionView.Listener, ExternalRawContactEditorView.Listener { RawContactReadOnlyEditorView.Listener { private static final String TAG = ContactEditorFragment.class.getSimpleName(); Loading Loading @@ -449,7 +449,8 @@ public class ContactEditorFragment extends Fragment implements String dataSet = entityValues.getAsString(RawContacts.DATA_SET); AccountType accountType = AccountTypeManager.getInstance(mContext).getAccountType( type, dataSet); if (accountType.getEditContactActivityClassName() != null) { if (accountType.getEditContactActivityClassName() != null && !accountType.areContactsWritable()) { if (mListener != null) { String name = entityValues.getAsString(RawContacts.ACCOUNT_NAME); long rawContactId = entityValues.getAsLong(RawContacts.Entity._ID); Loading Loading @@ -671,10 +672,10 @@ public class ContactEditorFragment extends Fragment implements final long rawContactId = values.getAsLong(RawContacts._ID); final BaseRawContactEditorView editor; if (type.isExternal()) { if (!type.areContactsWritable()) { editor = (BaseRawContactEditorView) inflater.inflate( R.layout.external_raw_contact_editor_view, mContent, false); ((ExternalRawContactEditorView) editor).setListener(this); R.layout.raw_contact_readonly_editor_view, mContent, false); ((RawContactReadOnlyEditorView) editor).setListener(this); } else { editor = (RawContactEditorView) inflater.inflate(R.layout.raw_contact_editor_view, mContent, false); Loading src/com/android/contacts/editor/ExternalRawContactEditorView.java→src/com/android/contacts/editor/RawContactReadOnlyEditorView.java +6 −5 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ import java.util.ArrayList; /** * Custom view that displays external contacts in the edit screen. */ public class ExternalRawContactEditorView extends BaseRawContactEditorView public class RawContactReadOnlyEditorView extends BaseRawContactEditorView implements OnClickListener { private LayoutInflater mInflater; Loading @@ -76,11 +76,11 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView void onExternalEditorRequest(AccountWithDataSet account, Uri uri); } public ExternalRawContactEditorView(Context context) { public RawContactReadOnlyEditorView(Context context) { super(context); } public ExternalRawContactEditorView(Context context, AttributeSet attrs) { public RawContactReadOnlyEditorView(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -187,7 +187,7 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView mName.setText(primary != null ? primary.getAsString(StructuredName.DISPLAY_NAME) : mContext.getString(R.string.missing_name)); if (type.areContactsWritable()) { if (type.getEditContactActivityClassName() != null) { mAccountContainer.setBackgroundDrawable(null); mAccountContainer.setEnabled(false); mEditExternallyButton.setVisibility(View.VISIBLE); Loading Loading @@ -237,7 +237,8 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView } else { emailType = null; } bindData(mContext.getText(R.string.emailLabelsGroup), emailAddress, null, i == 0); bindData(mContext.getText(R.string.emailLabelsGroup), emailAddress, emailType, i == 0); } } Loading Loading
res/layout/external_raw_contact_editor_view.xml→res/layout/raw_contact_readonly_editor_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,7 @@ limitations under the License. --> <!-- placed inside act_edit as tabcontent --> <com.android.contacts.editor.ExternalRawContactEditorView <com.android.contacts.editor.RawContactReadOnlyEditorView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -77,4 +76,4 @@ android:layout_height="wrap_content" android:orientation="vertical"/> </com.android.contacts.editor.ExternalRawContactEditorView> </com.android.contacts.editor.RawContactReadOnlyEditorView>
src/com/android/contacts/activities/ConfirmAddDetailActivity.java +1 −2 Original line number Diff line number Diff line Loading @@ -560,8 +560,7 @@ public class ConfirmAddDetailActivity extends Activity implements final String dataSet = state.getValues().getAsString(RawContacts.DATA_SET); final AccountType type = mAccountTypeManager.getAccountType(accountType, dataSet); // Raw contacts that are not from external sources should be editable. if (!type.isExternal()) { if (type.areContactsWritable()) { mEditableAccountType = type; mState = state; return; Loading
src/com/android/contacts/detail/ContactDetailFragment.java +1 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import com.android.contacts.ContactPresenceIconUtil; import com.android.contacts.ContactSaveService; import com.android.contacts.ContactsUtils; import com.android.contacts.GroupMetaData; import com.android.contacts.NfcHandler; import com.android.contacts.R; import com.android.contacts.TypePrecedence; import com.android.contacts.activities.ContactDetailActivity.FragmentKeyListener; Loading Loading @@ -154,7 +153,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen private Button mQuickFixButton; private QuickFix mQuickFix; private final ArrayList<Long> mWritableRawContactIds = new ArrayList<Long>(); private int mNumPhoneNumbers = 0; private String mDefaultCountryIso; private boolean mContactHasSocialUpdates; Loading Loading @@ -531,8 +529,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen mPrimaryPhoneUri = null; mNumPhoneNumbers = 0; mWritableRawContactIds.clear(); final AccountTypeManager accountTypes = AccountTypeManager.getInstance(mContext); // Build up method entries Loading @@ -550,10 +546,8 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen if (!mRawContactIds.contains(rawContactId)) { mRawContactIds.add(rawContactId); } AccountType type = accountTypes.getAccountType(accountType, dataSet); if (type == null || type.areContactsWritable()) { mWritableRawContactIds.add(rawContactId); } for (NamedContentValues subValue : entity.getSubValues()) { final ContentValues entryValues = subValue.values; Loading
src/com/android/contacts/editor/ContactEditorFragment.java +6 −5 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ import java.util.List; public class ContactEditorFragment extends Fragment implements SplitContactConfirmationDialogFragment.Listener, AggregationSuggestionEngine.Listener, AggregationSuggestionView.Listener, ExternalRawContactEditorView.Listener { RawContactReadOnlyEditorView.Listener { private static final String TAG = ContactEditorFragment.class.getSimpleName(); Loading Loading @@ -449,7 +449,8 @@ public class ContactEditorFragment extends Fragment implements String dataSet = entityValues.getAsString(RawContacts.DATA_SET); AccountType accountType = AccountTypeManager.getInstance(mContext).getAccountType( type, dataSet); if (accountType.getEditContactActivityClassName() != null) { if (accountType.getEditContactActivityClassName() != null && !accountType.areContactsWritable()) { if (mListener != null) { String name = entityValues.getAsString(RawContacts.ACCOUNT_NAME); long rawContactId = entityValues.getAsLong(RawContacts.Entity._ID); Loading Loading @@ -671,10 +672,10 @@ public class ContactEditorFragment extends Fragment implements final long rawContactId = values.getAsLong(RawContacts._ID); final BaseRawContactEditorView editor; if (type.isExternal()) { if (!type.areContactsWritable()) { editor = (BaseRawContactEditorView) inflater.inflate( R.layout.external_raw_contact_editor_view, mContent, false); ((ExternalRawContactEditorView) editor).setListener(this); R.layout.raw_contact_readonly_editor_view, mContent, false); ((RawContactReadOnlyEditorView) editor).setListener(this); } else { editor = (RawContactEditorView) inflater.inflate(R.layout.raw_contact_editor_view, mContent, false); Loading
src/com/android/contacts/editor/ExternalRawContactEditorView.java→src/com/android/contacts/editor/RawContactReadOnlyEditorView.java +6 −5 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ import java.util.ArrayList; /** * Custom view that displays external contacts in the edit screen. */ public class ExternalRawContactEditorView extends BaseRawContactEditorView public class RawContactReadOnlyEditorView extends BaseRawContactEditorView implements OnClickListener { private LayoutInflater mInflater; Loading @@ -76,11 +76,11 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView void onExternalEditorRequest(AccountWithDataSet account, Uri uri); } public ExternalRawContactEditorView(Context context) { public RawContactReadOnlyEditorView(Context context) { super(context); } public ExternalRawContactEditorView(Context context, AttributeSet attrs) { public RawContactReadOnlyEditorView(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -187,7 +187,7 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView mName.setText(primary != null ? primary.getAsString(StructuredName.DISPLAY_NAME) : mContext.getString(R.string.missing_name)); if (type.areContactsWritable()) { if (type.getEditContactActivityClassName() != null) { mAccountContainer.setBackgroundDrawable(null); mAccountContainer.setEnabled(false); mEditExternallyButton.setVisibility(View.VISIBLE); Loading Loading @@ -237,7 +237,8 @@ public class ExternalRawContactEditorView extends BaseRawContactEditorView } else { emailType = null; } bindData(mContext.getText(R.string.emailLabelsGroup), emailAddress, null, i == 0); bindData(mContext.getText(R.string.emailLabelsGroup), emailAddress, emailType, i == 0); } } Loading