private void pickRawContactDelta() {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "parse: " + mRawContactDeltas.size() + " rawContactDelta(s)");
        }
        for (int j = 0; j < mRawContactDeltas.size(); j++) {
            final RawContactDelta rawContactDelta = mRawContactDeltas.get(j);
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "parse: " + j + " rawContactDelta" + rawContactDelta);
            }
            if (rawContactDelta == null || !rawContactDelta.isVisible()) continue;
            final AccountType accountType = rawContactDelta.getAccountType(mAccountTypeManager);
            if (accountType == null) continue;
            if (mRawContactIdToDisplayAlone > 0) {
                // Look for the raw contact if specified.
                if (rawContactDelta.getRawContactId().equals(mRawContactIdToDisplayAlone)) {
                    mCurrentRawContactDelta = rawContactDelta;
                    return;
                }
            } else if (mPrimaryAccount != null
                    && mPrimaryAccount.equals(rawContactDelta.getAccountWithDataSet())) {
                // Otherwise try to find the one that matches the default.
                mCurrentRawContactDelta = rawContactDelta;
                return;
            } else if (accountType.areContactsWritable()){
                // TODO: Find better raw contact delta
                // Just select an arbitrary writable contact.
                mCurrentRawContactDelta = rawContactDelta;
            }
        }
    }
private void pickRawContactDelta() {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "parse: " + mRawContactDeltas.size() + " rawContactDelta(s)");
        }
        for (int j = 0; j < mRawContactDeltas.size(); j++) {
            final RawContactDelta rawContactDelta = mRawContactDeltas.get(j);
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "parse: " + j + " rawContactDelta" + rawContactDelta);
            }
            if (rawContactDelta == null || !rawContactDelta.isVisible()) continue;
            final AccountType accountType = rawContactDelta.getAccountType(mAccountTypeManager);
            if (accountType == null) continue;
            if (mRawContactIdToDisplayAlone > 0) {
               
                if (rawContactDelta.getRawContactId().equals(mRawContactIdToDisplayAlone)) {
                    mCurrentRawContactDelta = rawContactDelta;
                    return;
                }
            } else if (mPrimaryAccount != null
                    && mPrimaryAccount.equals(rawContactDelta.getAccountWithDataSet())) {
               
                mCurrentRawContactDelta = rawContactDelta;
                return;
            } else if (accountType.areContactsWritable()){
               
               
                mCurrentRawContactDelta = rawContactDelta;
            }
        }
    }
private void pickrawcontactdelta() { if (log.isloggable(tag, log.verbose)) { log.v(tag, "parse: " + mrawcontactdeltas.size() + " rawcontactdelta(s)"); } for (int j = 0; j < mrawcontactdeltas.size(); j++) { final rawcontactdelta rawcontactdelta = mrawcontactdeltas.get(j); if (log.isloggable(tag, log.verbose)) { log.v(tag, "parse: " + j + " rawcontactdelta" + rawcontactdelta); } if (rawcontactdelta == null || !rawcontactdelta.isvisible()) continue; final accounttype accounttype = rawcontactdelta.getaccounttype(maccounttypemanager); if (accounttype == null) continue; if (mrawcontactidtodisplayalone > 0) { if (rawcontactdelta.getrawcontactid().equals(mrawcontactidtodisplayalone)) { mcurrentrawcontactdelta = rawcontactdelta; return; } } else if (mprimaryaccount != null && mprimaryaccount.equals(rawcontactdelta.getaccountwithdataset())) { mcurrentrawcontactdelta = rawcontactdelta; return; } else if (accounttype.arecontactswritable()){ mcurrentrawcontactdelta = rawcontactdelta; } } }