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

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

Merge 35e2c69b on remote branch

Change-Id: I6e3e6c8d8a57c7714b1264245acaa73693180fe5
parents a8a1c073 35e2c69b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -326,6 +326,8 @@
    <string name="message_add_members">"添加成员..."</string>
    <string name="message_move_members">"移动成员..."</string>
    <string name="cancel_operation">"操作取消"</string>
    <!-- Menu item used to refresh a specific contact -->
    <string name="menu_refresh">刷新</string>
    <string name="message_can_not_move_members">"不能移动成员"</string>
    <string name="message_from_you_prefix" msgid="7180706529908434482">"您:<xliff:g id="SMS_BODY">%s</xliff:g>"</string>
    <string name="contact_editor_hangouts_im_alert" msgid="114855385615225735">"请将联系人的环聊帐号信息输入到电子邮件地址字段或电话号码字段,以便获得更佳的环聊使用体验。"</string>
+49 −1
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
            // so the Fragment will only be created once. If we add a TAG manually, there will
            // occur crash.
            position = getRtlPosition(position);

            if (mAreTabsHiddenInViewPager) {
                if (mPickMode.isPickCall()) {
                    mDelCallLogFragment = new DelCallLogFragment();
@@ -289,6 +290,53 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP
        public int getCount() {
            return mAreTabsHiddenInViewPager ? 1 : TAB_INDEX_COUNT;
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {

            Fragment f = (Fragment) super.instantiateItem(container, position);

            if (mAreTabsHiddenInViewPager) {
                if (mPickMode.isPickCall()) {
                    if (mDelCallLogFragment == null) {
                        mDelCallLogFragment = (DelCallLogFragment) f;
                        mDelCallLogFragment
                                .setCheckListListener(new CheckListListener());
                    }
                } else {
                    if (mContactsFragment == null) {
                        mContactsFragment = (ContactsFragment) f;
                        mContactsFragment
                                .setCheckListListener(new CheckListListener());
                    }
                }
            } else {
                switch (position) {
                case TAB_INDEX_RECENT:
                    if (mCallLogFragment == null) {
                        mCallLogFragment = (CallLogFragment) f;
                        mCallLogFragment
                                .setCheckListListener(new CheckListListener());
                    }
                    break;
                case TAB_INDEX_CONTACTS:
                    if (mContactsFragment == null) {
                        mContactsFragment = (ContactsFragment) f;
                        mContactsFragment
                                .setCheckListListener(new CheckListListener());
                    }
                    break;
                case TAB_INDEX_GROUP:
                    if (mGroupFragment == null) {
                        mGroupFragment = (GroupsFragment) f;
                        mGroupFragment
                                .setCheckListListener(new CheckListListener());
                    }
                    break;
                }
            }
            return f;
        }
    }

    @Override
@@ -1508,7 +1556,7 @@ public class MultiPickContactsActivity extends Activity implements ViewPager.OnP

    private void showGroupSelectionList(String accountType, long srcGroupId) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(getString(R.string.label_groups));
        builder.setTitle(getString(R.string.groupsLabel));
        ContentResolver resolver = getContentResolver();
        String selection = Groups.ACCOUNT_TYPE + " =? AND " + Groups.DELETED + " != ? AND ("
                + Groups.SOURCE_ID + "!='RCS'" + " OR " + Groups.SOURCE_ID + " IS NULL)";
+17 −4
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
    private static final String CURRENT_EDITOR_TAG = "currentEditorForAccount";

    public static final int REQUEST_CODE_PICK_GROUP_MEM = 1001;
    private static final int MAX_CACHE_MEMBER_SIZE = 500;

    public static interface Listener {
        /**
@@ -238,7 +239,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) {
            } else if (mStatus == Status.LOADING || getCacheSize() == 0) {
                startGroupMetaDataLoader();
            } else {
                setupEditorForAccount();
@@ -288,9 +289,15 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
        outState.putBoolean(KEY_GROUP_NAME_IS_READ_ONLY, mGroupNameIsReadOnly);
        outState.putString(KEY_ORIGINAL_GROUP_NAME, mOriginalGroupName);

        outState.putParcelableArrayList(KEY_MEMBERS_TO_ADD, mListMembersToAdd);
        outState.putParcelableArrayList(KEY_MEMBERS_TO_REMOVE, mListMembersToRemove);
        outState.putParcelableArrayList(KEY_MEMBERS_TO_DISPLAY, mListToDisplay);
        // if size is too large,it will cause TransactionTooLargeException,so add limit here
        if (getCacheSize() <= MAX_CACHE_MEMBER_SIZE) {
            outState.putParcelableArrayList(KEY_MEMBERS_TO_ADD,
                    mListMembersToAdd);
            outState.putParcelableArrayList(KEY_MEMBERS_TO_REMOVE,
                    mListMembersToRemove);
            outState.putParcelableArrayList(KEY_MEMBERS_TO_DISPLAY,
                    mListToDisplay);
        }
    }

    private void onRestoreInstanceState(Bundle state) {
@@ -311,6 +318,12 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
        mListToDisplay = state.getParcelableArrayList(KEY_MEMBERS_TO_DISPLAY);
    }

    private int getCacheSize() {
        int size = mListMembersToAdd.size() + mListMembersToRemove.size()
                + mListToDisplay.size();
        return size;
    }

    public void setContentResolver(ContentResolver resolver) {
        mContentResolver = resolver;
        if (mAutoCompleteAdapter != null) {