Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6ff6c06 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "workaround for issue 1416, but we really should figure out why these...

Merge "workaround for issue 1416, but we really should figure out why these fields are returning -1" into froyo
parents 33ef8c8b cd645456
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.telephony.PhoneNumberUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -214,10 +215,31 @@ public class PhoneDisambigDialog implements DialogInterface.OnClickListener,
        while (phonesCursor.moveToNext()) {
            long id = phonesCursor.getLong(phonesCursor.getColumnIndex(Data._ID));
            String phone = phonesCursor.getString(phonesCursor.getColumnIndex(Phone.NUMBER));
            String accountType =

            String accountType;
            if (phonesCursor.getColumnIndex(RawContacts.ACCOUNT_TYPE) != -1){
                accountType=
                    phonesCursor.getString(phonesCursor.getColumnIndex(RawContacts.ACCOUNT_TYPE));
            int type = phonesCursor.getInt(phonesCursor.getColumnIndex(Phone.TYPE));
            String label = phonesCursor.getString(phonesCursor.getColumnIndex(Phone.LABEL));
            }else{
                Log.d("PhoneDisambigDialog", "AccountType was undefined");
                accountType = "";
            }

            int type;
            if(phonesCursor.getColumnIndex(Phone.TYPE) != -1){
                type = phonesCursor.getInt(phonesCursor.getColumnIndex(Phone.TYPE));
            }else{
                Log.d("PhoneDisambigDialog", "type was undefined");
                type = 0;
            }

            String label;
            if (phonesCursor.getColumnIndex(Phone.LABEL) != -1){
                label = phonesCursor.getString(phonesCursor.getColumnIndex(Phone.LABEL));
            }else{
                Log.d("PhoneDisambigDialog", "label was undefined");
                label = "";
            }

            phoneList.add(new PhoneItem(id, phone, accountType, type, label));
        }