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

Commit 5bede158 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 64df2d11 on remote branch

Change-Id: Icfa8e025c44819374e8ad5b2845d45a35cd14396
parents 8525d9d6 64df2d11
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ public class MergeContactActivity extends ListActivity {
            List<String> simNumberList = new ArrayList<>();
            List<String> simEmailList = new ArrayList<>();

            boolean needUpdate = false;
            int subscription = -1;
            ArrayList<Long> delContactIds = new ArrayList<>();
            HashMap<Long, ArrayList<Long>> delRawIdsMap = new HashMap<>();
@@ -309,6 +310,7 @@ public class MergeContactActivity extends ListActivity {
                        }
                    }
                    if (!containsNumber) {
                        needUpdate = true;
                        simNumberList.add(number);
                    }
                }
@@ -326,6 +328,7 @@ public class MergeContactActivity extends ListActivity {
                                }
                            }
                            if (!containsAnr) {
                                needUpdate = true;
                                simNumberList.add(splitAnr[j]);
                            }
                        }
@@ -337,6 +340,7 @@ public class MergeContactActivity extends ListActivity {
                    for (int j = 0; j < splitEmail.length; j++) {
                        if (!TextUtils.isEmpty(splitEmail[j]) && !simEmailList
                                .contains(splitEmail[j])) {
                            needUpdate = true;
                            simEmailList.add(splitEmail[j]);
                        }
                    }
@@ -383,7 +387,9 @@ public class MergeContactActivity extends ListActivity {
            sourceValues.remove(SimContactsConstants.ACCOUNT_TYPE);
            sourceValues.remove(SimContactsConstants.ACCOUNT_NAME);
            // update the contacts in sim.
            int simResult = mSimContactsOperation.update(sourceValues, subscription);
            int simResult = 1;
            if (needUpdate)
                mSimContactsOperation.update(sourceValues, subscription);

            // if update sim contacts fail, stop merging.
            if (simResult <= 0) {
@@ -415,6 +421,9 @@ public class MergeContactActivity extends ListActivity {
                                .CONTENT_URI, String.valueOf(list.get(j)));
                        rawDelList.add(ContentProviderOperation.newDelete(uri).build());
                    }
                } else {
                    Toast.makeText(MergeContactActivity.this, R.string.merge_fail,
                            Toast.LENGTH_SHORT).show();
                }
            }
            return true;
+11 −7
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
            // occur crash.
            position = getRtlPosition(position);

            if (mAreTabsHiddenInViewPager || !mPickMode.isPickPhone()) {
            if (!mPickMode.isPickPhone()) {
                if (mPickMode.isPickCall()) {
                    mDelCallLogFragment = new DelCallLogFragment();
                    mDelCallLogFragment.setCheckListListener(new CheckListListener());
@@ -295,15 +295,15 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
        public Object instantiateItem(ViewGroup container, int position) {

            Fragment f = (Fragment) super.instantiateItem(container, position);
            if (mAreTabsHiddenInViewPager || !mPickMode.isPickPhone()) {
            if (!mPickMode.isPickPhone()) {
                if (mPickMode.isPickCall()) {
                    if (mDelCallLogFragment == null) {
                    if (mDelCallLogFragment == null && f instanceof DelCallLogFragment) {
                        mDelCallLogFragment = (DelCallLogFragment) f;
                        mDelCallLogFragment
                                .setCheckListListener(new CheckListListener());
                    }
                } else {
                    if (mContactsFragment == null) {
                    if (mContactsFragment == null && f instanceof ContactsFragment) {
                        mContactsFragment = (ContactsFragment) f;
                        mContactsFragment
                                .setCheckListListener(new CheckListListener());
@@ -312,21 +312,21 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
            } else {
                switch (position) {
                case TAB_INDEX_RECENT:
                    if (mCallLogFragment == null) {
                    if (mCallLogFragment == null && f instanceof CallLogFragment) {
                        mCallLogFragment = (CallLogFragment) f;
                        mCallLogFragment
                                .setCheckListListener(new CheckListListener());
                    }
                    break;
                case TAB_INDEX_CONTACTS:
                    if (mContactsFragment == null) {
                    if (mContactsFragment == null && f instanceof ContactsFragment) {
                        mContactsFragment = (ContactsFragment) f;
                        mContactsFragment
                                .setCheckListListener(new CheckListListener());
                    }
                    break;
                case TAB_INDEX_GROUP:
                    if (mGroupFragment == null) {
                    if (mGroupFragment == null && f instanceof GroupsFragment) {
                        mGroupFragment = (GroupsFragment) f;
                        mGroupFragment
                                .setCheckListListener(new CheckListListener());
@@ -714,6 +714,10 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
        }
    }

    public CheckListListener createListener() {
        return new CheckListListener();
    }

    private void configureSearchMode() {
        TextView topDividerLine = (TextView) findViewById(R.id.multi_pick_top_divider);
        if (mSearchUiVisible) {
+26 −6
Original line number Diff line number Diff line
@@ -106,6 +106,9 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
    public static final int REQUEST_CODE_PICK_GROUP_MEM = 1001;
    private static final int MAX_CACHE_MEMBER_SIZE = 500;

    //when save completed,close activity directly,no need reload group member.
    private boolean mClose = false;

    public static interface Listener {
        /**
         * Group metadata was not found, close the fragment now.
@@ -239,7 +242,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
            onRestoreInstanceState(savedInstanceState);
            if (mStatus == Status.SELECTING_ACCOUNT) {
                // Account select dialog is showing.  Don't setup the editor yet.
            } else if (mStatus == Status.LOADING || getCacheSize() == 0) {
            } else if (mStatus == Status.LOADING || mListToDisplay.size() == 0) {
                startGroupMetaDataLoader();
            } else {
                setupEditorForAccount();
@@ -297,6 +300,12 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
                    mListMembersToRemove);
            outState.putParcelableArrayList(KEY_MEMBERS_TO_DISPLAY,
                    mListToDisplay);
        } else if (mListMembersToAdd.size() + mListMembersToRemove.size()
                < MAX_CACHE_MEMBER_SIZE) {
            outState.putParcelableArrayList(KEY_MEMBERS_TO_ADD,
                    mListMembersToAdd);
            outState.putParcelableArrayList(KEY_MEMBERS_TO_REMOVE,
                    mListMembersToRemove);
        }
    }

@@ -316,6 +325,14 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
        mListMembersToAdd = state.getParcelableArrayList(KEY_MEMBERS_TO_ADD);
        mListMembersToRemove = state.getParcelableArrayList(KEY_MEMBERS_TO_REMOVE);
        mListToDisplay = state.getParcelableArrayList(KEY_MEMBERS_TO_DISPLAY);

        if (mListMembersToAdd == null)
            mListMembersToAdd = new ArrayList<Member>();
        if (mListMembersToRemove == null)
            mListMembersToRemove = new ArrayList<Member>();
        if (mListToDisplay == null)
            mListToDisplay = new ArrayList<Member>();

    }

    private int getCacheSize() {
@@ -662,7 +679,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
            }
            return false;
        }

        mClose = true;
        // If we are about to close the editor - there is no need to refresh the data
        getLoaderManager().destroyLoader(LOADER_EXISTING_MEMBERS);

@@ -843,12 +860,15 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog

        @Override
        public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
            if (!mClose) {
                bindGroupMetaData(data);

                // Load existing members
                getLoaderManager().initLoader(LOADER_EXISTING_MEMBERS, null,
                        mGroupMemberListLoaderListener);
            }
            mClose = false;
        }

        @Override
        public void onLoaderReset(Loader<Cursor> loader) {}
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.widget.AbsListView;
import android.widget.TextView;

import com.android.contacts.R;
import com.android.contacts.activities.MultiPickContactsActivity;
import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest;
import com.android.contacts.common.util.UriUtils;
@@ -175,6 +176,10 @@ public class CallLogFragment extends ListFragment {
        resolver = mContext.getContentResolver();
        resolver.registerContentObserver(Calls.CONTENT_URI, true, mCallLogObserver);

        if (mCheckListListener == null) {
            mCheckListListener = ((MultiPickContactsActivity) getActivity())
                    .createListener();
        }
        if (mCallLogListAdapter == null) {
            mCallLogListAdapter = new CallLogItemListAdapter(mContext);
            mContactsCheckedList = new ArrayList<String>();
+3 −0
Original line number Diff line number Diff line
@@ -254,6 +254,9 @@ public class ContactsFragment extends ListFragment {
                checkedList = new ArrayList<String>();
            }
        }
        if (mCheckListListener == null)
            mCheckListListener = ((MultiPickContactsActivity) getActivity())
                    .createListener();
        mHeaderView = new View(mContext);
        AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(
                AbsListView.LayoutParams.MATCH_PARENT,
Loading