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

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

Promotion of android_ui.lnx.2.1-00011.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1065034   I36f195318607ec4942d08027cd7b722c2ed17e53   Fix group member refresh double problem
1064995   Id0aaf4e8a4db0cebcc0bb661f4b84529b7282a09   Fix unnecessary update command send to sim card
1066586   I1ae6c401deb0e92423f941fda0dc65f8bce4b4b0   Fix FC when add group as reciepients
1068255   I8c189b42d0c46837269ad27c9100415b65227060   Fix FC when rotate in group edit screen

Change-Id: Ieb4098245a7bf2cb621dc50cc3cb7088bdb639b2
CRs-Fixed: 1065034, 1068255, 1066586, 1064995
parents 81e450c5 b4551733
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;
+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) {}
+16 −2
Original line number Diff line number Diff line
@@ -220,6 +220,12 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
        mContext = null;
    }

    @Override
    public void onResume() {
        super.onResume();
        fillAllContactsCursorMap();
    }

    @Override
    public void onDestroy() {
        mAdapter.getQueryHandler().removeCallbacksAndMessages(QUERY_TOKEN);
@@ -228,6 +234,9 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
            mAdapter.getCursor().close();
        }

        if(allContactsInGroups!=null)
            allContactsInGroups.close();

        if (mAllContactsCurosrMap != null) {
            mAllContactsCurosrMap.clear();
        }
@@ -776,7 +785,10 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
        @Override
        protected Cursor getChildrenCursor(Cursor groupCursor) {
            long groupId = groupCursor.getLong(GROUP_ID);
            return getContactsDetailCursor(groupId);
            Cursor c = getContactsDetailCursor(groupId);
            if (c != null)
                getActivity().startManagingCursor(c);
            return c;
        }

        @Override
@@ -787,6 +799,7 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
                super.changeCursor(cursor);
            }
        }
    }

        /**
         * all contacts cursor fill to map
@@ -794,6 +807,8 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
        private void fillAllContactsCursorMap() {
            mAllContactsCurosrMap.clear();
            Cursor cursor = null;
            if (mGroupsCursor == null)
                return;
            for (int groupPosition = 0; groupPosition < mGroupsCursor.getCount(); groupPosition++) {
                mGroupsCursor.moveToPosition(groupPosition);
                long groupCacheId = mGroupsCursor.getLong(GROUP_ID);
@@ -817,7 +832,6 @@ public class GroupsFragment extends ExpandableListFragment implements OnGroupCli
                cursor.close();
            }
    }
    }

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {