diff options
author | Ethan Chen <intervigil@gmail.com> | 2015-11-21 21:58:08 -0800 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2015-11-21 22:13:53 -0800 |
commit | 51d80e39878305ffdccdf62ee7203a7af37208bb (patch) | |
tree | 6f8a1b7798104785d0aa8533c1ed642207f83718 /src/com | |
parent | d0a1a54b21e592c0de16ff72ac6876f8d051bd5f (diff) | |
download | packages_apps_Dialer-51d80e39878305ffdccdf62ee7203a7af37208bb.tar.gz packages_apps_Dialer-51d80e39878305ffdccdf62ee7203a7af37208bb.tar.bz2 packages_apps_Dialer-51d80e39878305ffdccdf62ee7203a7af37208bb.zip |
Undo CAF Dialer IMS conference changes
* This causes weirdness with the FAB in dialtacts. Get rid of it.
* Squash of the following
Revert "IMS: Enable entry 4G conference call in Dialer"
This reverts commit 76c9726e48ccbbcb5780ab076b7c54aadcdc621b.
Change-Id: Ic326c817496294a9350c767f5ae3e83d817edd18
Revert "IMS: Fix empty URI list dial after add participant."
This reverts commit daba64924bbea8a0eb49723d69c1178a7c2ef0f2.
Revert "IMS: Fix Edit before call option not working issue"
This reverts commit 2fec8e35dabf931fc349f7d594c5560fbf35bcc5.
Revert "IMS: Fix to remove unwanted group conference icon."
This reverts commit d3bbfca9fa5db701f719618d9314625626f504db.
Revert "Dialer app changes for IMS"
This reverts commit 8ea43d354391cd7c75dd361a316e5936e1e1db96.
Change-Id: I187d935394e9a935d199b66b28910a38a248b535
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 99 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 192 |
2 files changed, 29 insertions, 262 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index a62b5f0aa..e5ea9349e 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -62,7 +62,6 @@ import android.widget.ImageButton; import android.widget.PopupMenu; import android.widget.Toast; -import com.android.contacts.common.CallUtil; import com.android.contacts.common.activity.TransactionSafeActivity; import com.android.contacts.common.dialog.ClearFrequentsDialog; import com.android.contacts.common.interactions.ImportExportDialogFragment; @@ -96,7 +95,6 @@ import com.android.dialer.widget.SearchEditTextLayout.Callback; import com.android.dialerbind.DatabaseHelperManager; import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.util.SettingsUtil; -import com.android.ims.ImsManager; import com.android.phone.common.animation.AnimationListenerAdapter; import junit.framework.Assert; @@ -170,8 +168,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private SmartDialSearchFragment mSmartDialSearchFragment; - private boolean mDialConferenceButtonPressed = false; - /** * Animation that slides in. */ @@ -240,16 +236,13 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private PopupMenu mOverflowMenu; private EditText mSearchView; private View mVoiceSearchButton; - private View mDialCallButton; private String mSearchQuery; private DialerDatabaseHelper mDialerDatabaseHelper; private DragDropController mDragDropController; private ActionBarController mActionBarController; - private ImageButton mFloatingActionButton; - private ImageButton mConferenceDialButton; private FloatingActionButtonController mFloatingActionButtonController; private int mActionBarHeight; @@ -280,8 +273,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O menu.findItem(R.id.menu_history).setVisible( PermissionsUtil.hasPhonePermissions(DialtactsActivity.this)); - final MenuItem ConferDialerOption = menu.findItem(R.id.menu_4g_conference_call); - ConferDialerOption.setVisible(CallUtil.isConferDialerEnabled(getApplicationContext())); super.show(); } } @@ -442,13 +433,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O final View floatingActionButtonContainer = findViewById( R.id.floating_action_button_container); - mFloatingActionButton = (ImageButton) findViewById(R.id.floating_action_button); - mDialCallButton = findViewById(R.id.floating_action_button); - mFloatingActionButton.setOnClickListener(this); - mConferenceDialButton = (ImageButton) findViewById(R.id.dialConferenceButton); - mConferenceDialButton.setOnClickListener(this); + ImageButton floatingActionButton = (ImageButton) findViewById(R.id.floating_action_button); + floatingActionButton.setOnClickListener(this); mFloatingActionButtonController = new FloatingActionButtonController(this, - floatingActionButtonContainer,mFloatingActionButton); + floatingActionButtonContainer, floatingActionButton); ImageButton optionsMenuButton = (ImageButton) searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); @@ -461,7 +449,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.dialtacts_frame, new ListsFragment(), TAG_FAVORITES_FRAGMENT) - .add(R.id.dialtacts_container, new DialpadFragment(), TAG_DIALPAD_FRAGMENT) .commit(); } else { mSearchQuery = savedInstanceState.getString(KEY_SEARCH_QUERY); @@ -579,8 +566,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O prepareVoiceSearchButton(); mDialerDatabaseHelper.startSmartDialUpdateThread(); mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); - setConferenceDialButtonImage(false); - setConferenceDialButtonVisibility(true); if (getIntent().hasExtra(EXTRA_SHOW_TAB)) { int index = getIntent().getIntExtra(EXTRA_SHOW_TAB, ListsFragment.TAB_INDEX_SPEED_DIAL); @@ -654,10 +639,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void onClick(View view) { switch (view.getId()) { case R.id.floating_action_button: - mDialConferenceButtonPressed = false; - if (mDialpadFragment != null) { - mDialpadFragment.showDialConference(false); - } if (mListsFragment.getCurrentTabIndex() == ListsFragment.TAB_INDEX_ALL_CONTACTS && !mInRegularSearch) { DialerUtils.startActivityWithErrorToast( @@ -667,25 +648,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } else if (!mIsDialpadShown) { mInCallDialpadUp = false; showDialpadFragment(true); - mFloatingActionButton.setImageResource(R.drawable.fab_ic_call); - mFloatingActionButton.setVisibility(view.VISIBLE); - setConferenceDialButtonImage(false); - setConferenceDialButtonVisibility(true); - } else { - // Dial button was pressed; tell the Dialpad fragment - mDialpadFragment.dialButtonPressed(); } break; - case R.id.dialConferenceButton: - mDialConferenceButtonPressed = true; - showDialpadFragment(true); - mIsDialpadShown = false; - mDialCallButton.setVisibility(view.VISIBLE); - mDialpadFragment.dialConferenceButtonPressed(); - mFloatingActionButton.setImageResource(R.drawable.fab_ic_dial); - mFloatingActionButtonController.align(getFabAlignment(), true); - mFloatingActionButton.setVisibility(view.VISIBLE); - break; case R.id.voice_search_button: try { startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), @@ -708,9 +672,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { - case R.id.menu_4g_conference_call: - this.startActivity(CallUtil.getConferenceDialerIntent(null)); - break; case R.id.menu_history: // Use explicit CallLogActivity intent instead of ACTION_VIEW + // CONTENT_TYPE, so that we always open our call log from our dialer @@ -792,7 +753,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O maybeEnterSearchUi(); } mActionBarController.onDialpadUp(); - setConferenceDialButtonVisibility(animate); mListsFragment.getView().animate().alpha(0).withLayer(); } @@ -802,13 +762,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ public void onDialpadShown() { Assert.assertNotNull(mDialpadFragment); - if (mDialConferenceButtonPressed || !mIsDialpadShown) { - mFloatingActionButton.setImageResource(R.drawable.fab_ic_dial); - mDialConferenceButtonPressed = false; - } else { - mFloatingActionButton.setImageResource(R.drawable.fab_ic_call); - } - mFloatingActionButtonController.align(getFabAlignment(), mDialpadFragment.getAnimate()); if (mDialpadFragment.getAnimate()) { mDialpadFragment.getView().startAnimation(mSlideIn); } else { @@ -830,8 +783,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O if (clearDialpad) { mDialpadFragment.clearDialpad(); } - if (!mIsDialpadShown && !mDialpadFragment.isRecipientsShown()) { - mFloatingActionButtonController.align(getFabAlignment(), animate); + if (!mIsDialpadShown) { return; } mIsDialpadShown = false; @@ -840,7 +792,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mListsFragment.sendScreenViewForCurrentPosition(); updateSearchFragmentPosition(); - mFloatingActionButton.setImageResource(R.drawable.fab_ic_dial); mFloatingActionButtonController.align(getFabAlignment(), animate); if (animate) { @@ -861,7 +812,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O /** * Finishes hiding the dialpad fragment after any animations are completed. */ - public void commitDialpadFragmentHide() { + private void commitDialpadFragmentHide() { if (!mStateSaved && mDialpadFragment != null && !mDialpadFragment.isHidden()) { final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.hide(mDialpadFragment); @@ -1140,14 +1091,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O if (mStateSaved) { return; } - setConferenceDialButtonImage(false); - setConferenceDialButtonVisibility(true); - boolean mIsRecipientsShown = mDialpadFragment.isRecipientsShown(); - if(mIsRecipientsShown) { - mDialpadFragment.hideAndClearDialConference(); - } - - if (mIsDialpadShown || mIsRecipientsShown) { + if (mIsDialpadShown) { if (TextUtils.isEmpty(mSearchQuery) || (mSmartDialSearchFragment != null && mSmartDialSearchFragment.isVisible() && mSmartDialSearchFragment.getAdapter().getCount() == 0)) { @@ -1248,35 +1192,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // interactions with the ListsFragments. } - @Override - public void setConferenceDialButtonVisibility(boolean enabled) { - boolean imsUseEnabled = - ImsManager.isVolteEnabledByPlatform(this) && - ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this); - if(mConferenceDialButton != null) { - boolean isCurrentTabAllContacts = (mListsFragment != null) && - (mListsFragment.getCurrentTabIndex() == ListsFragment.TAB_INDEX_ALL_CONTACTS); - mConferenceDialButton.setVisibility((enabled && imsUseEnabled && - !isCurrentTabAllContacts) ? View.VISIBLE : View.GONE); - } - } - - @Override - public void setConferenceDialButtonImage(boolean setAddParticipantButton) { - if(mConferenceDialButton != null) { - /* - * If dial conference view is shown, button should show dialpad - * image. Pressing the button again will return to normal dialpad - * view. If normal dialpad view is shown, button should show dial - * conference image. Pressing the button again will show dial - * conference view - */ - mConferenceDialButton - .setImageResource(setAddParticipantButton ? R.drawable.fab_ic_call - : R.drawable.ic_add_group_holo_dark); - } - } - private boolean phoneIsInUse() { return getTelecomManager().isInCall(); } @@ -1398,12 +1313,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void onPageSelected(int position) { int tabIndex = mListsFragment.getCurrentTabIndex(); if (tabIndex == ListsFragment.TAB_INDEX_ALL_CONTACTS) { - setConferenceDialButtonVisibility(false); mFloatingActionButtonController.changeIcon( getResources().getDrawable(R.drawable.ic_person_add_24dp), getResources().getString(R.string.search_shortcut_create_new_contact)); } else { - setConferenceDialButtonVisibility(true); mFloatingActionButtonController.changeIcon( getResources().getDrawable(R.drawable.fab_ic_dial), getResources().getString(R.string.action_menu_dialpad_button)); diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index eb6ad0341..b8c09fac1 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -146,20 +146,6 @@ public class DialpadFragment extends Fragment * be dismissed, unless there happens to be content showing. */ boolean onDialpadSpacerTouchWithEmptyQuery(); - - /** - * This interface allows the DialpadFragment to tell its hosting Activity when and when not - * to display the "dial" button. While this is logically part of the DialpadFragment, the - * need to have a particular kind of slick animation puts the "dial" button in the parent. - * - * The parent calls dialButtonPressed() and optionsMenuInvoked() on the dialpad fragment - * when appropriate. - * - * TODO: Refactor the app so this interchange is a bit cleaner. - */ - void setConferenceDialButtonVisibility(boolean enabled); - void setConferenceDialButtonImage(boolean setAddParticipantButton); - } private static final boolean DEBUG = DialtactsActivity.DEBUG; @@ -186,9 +172,6 @@ public class DialpadFragment extends Fragment private DialpadView mDialpadView; private EditText mDigits; - private EditText mRecipients; - private View mDigitsContainer; - private View mDialpad; private int mDialpadSlideInDuration; /** Remembers if we need to clear digits field when the screen is completely gone. */ @@ -230,13 +213,6 @@ public class DialpadFragment extends Fragment /** Identifier for the "Add Call" intent extra. */ private static final String ADD_CALL_MODE_KEY = "add_call_mode"; - /** Identifier for the "Add Participant" intent extra. */ - private static final String ADD_PARTICIPANT_KEY = "add_participant"; - - private static final String EXTRA_DIAL_CONFERENCE_URI = "org.codeaurora.extra.DIAL_CONFERENCE_URI"; - - private boolean mAddParticipant = false; - /** * Identifier for intent extra for sending an empty Flash message for * CDMA networks. This message is used by the network to simulate a @@ -276,12 +252,6 @@ public class DialpadFragment extends Fragment // onscreen, but useless...) showDialpadChooser(false); } - if (state == TelephonyManager.EXTRA_STATE_IDLE) { - final Activity activity = getActivity(); - if (activity != null) { - ((HostInterface) activity).setConferenceDialButtonVisibility(true); - } - } } } @@ -393,13 +363,6 @@ public class DialpadFragment extends Fragment mDialpadView = (DialpadView) fragmentView.findViewById(R.id.dialpad_view); mDialpadView.setCanDigitsBeEdited(true); mDigits = mDialpadView.getDigits(); - mRecipients = (EditText) fragmentView.findViewById(R.id.recipients); - mDigitsContainer = fragmentView.findViewById(R.id.digits_container); - mDialpad = fragmentView.findViewById(R.id.dialpad); - if (mRecipients != null) { - mRecipients.setVisibility(View.GONE); - mRecipients.addTextChangedListener(this); - } mDigits.setKeyListener(UnicodeDialerKeyListener.INSTANCE); mDigits.setOnClickListener(this); mDigits.setOnKeyListener(this); @@ -578,9 +541,6 @@ public class DialpadFragment extends Fragment } } - } else { - mAddParticipant = intent.getBooleanExtra(ADD_PARTICIPANT_KEY, false); - ((HostInterface) getActivity()).setConferenceDialButtonVisibility(true); } showDialpadChooser(needToShowDialpadChooser); setStartedFromNewIntent(false); @@ -931,10 +891,6 @@ public class DialpadFragment extends Fragment public void show() { final Menu menu = getMenu(); - final MenuItem ConferDialerOption - = menu.findItem(R.id.menu_add_to_4g_conference_call); - ConferDialerOption.setVisible(CallUtil.isConferDialerEnabled(getActivity())); - boolean enable = !isDigitsEmpty(); for (int i = 0; i < menu.size(); i++) { MenuItem item = menu.getItem(i); @@ -951,79 +907,6 @@ public class DialpadFragment extends Fragment return popupMenu; } - /** - * Called by the containing Activity to tell this Fragment that the dial button has been - * pressed. - */ - public void dialButtonPressed() { - getView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); - handleDialButtonPressed(); - } - - public void dialConferenceButtonPressed() { - // show dial conference screen if it is not shown - // If it is already shown, show normal dial screen - boolean show = (mRecipients != null) && !mRecipients.isShown(); - Log.d(TAG, "dialConferenceButtonPressed show " + show); - if (show) { - showDialConference(show); - } else { - handleDialButtonPressed(); - showDialConference(!show); - } - } - - public void showDialConference(boolean enabled) { - // Check if onCreateView() is already called by checking one of View - // objects. - if (!isLayoutReady()) { - return; - } - Log.d(TAG, "showDialConference " + enabled); - /* - * if enabled is true then pick child views that should be - * visible/invisible when dialpad is choosen from conference dial button - * if enabled is false then pick child views that should be - * visible/invisible when dialpad is choosen from other buttons - */ - - // viewable when choosen through conference button - int conferenceButtonVisibility = (enabled ? View.VISIBLE : View.GONE); - // not viewable when choosen through conference button - int nonConferenceButtonVisibility = (enabled ? View.GONE : View.VISIBLE); - - // change the image visibility of the button - if (mRecipients != null) - mRecipients.setVisibility(conferenceButtonVisibility); - if (mDigits != null) - mDigits.setVisibility(nonConferenceButtonVisibility); - if (mDelete != null) - mDelete.setVisibility(nonConferenceButtonVisibility); - if (mDialpad != null) - mDialpad.setVisibility(enabled ? View.INVISIBLE : View.VISIBLE); - - if (enabled && (HostInterface)getActivity() != null) { - ((HostInterface)getActivity()).setConferenceDialButtonImage(enabled); - } - } - - public void hideAndClearDialConference() { - // hide the image visibility of the button - if (mRecipients != null) - mRecipients.setVisibility(View.GONE); - if (mDigits != null) - mDigits.setVisibility(View.GONE); - if (mDelete != null) - mDelete.setVisibility(View.GONE); - if (mDialpad != null) - mDialpad.setVisibility(View.GONE); - ((DialtactsActivity) getActivity()).commitDialpadFragmentHide(); - } - - public boolean isRecipientsShown() { - return mRecipients != null && mRecipients.isShown(); - } - @Override public void onClick(View view) { switch (view.getId()) { @@ -1212,50 +1095,32 @@ public class DialpadFragment extends Fragment * case described above). */ private void handleDialButtonPressed() { - if (isDigitsEmpty() && (mRecipients == null || !mRecipients.isShown())) { - // No number entered. + if (isDigitsEmpty()) { // No number entered. handleDialButtonClickWithEmptyDigits(); } else { - boolean isDigitsShown = mDigits.isShown(); - final String number = isDigitsShown ? mDigits.getText().toString() : - mRecipients.getText().toString().trim(); - if (isDigitsShown && isDigitsEmpty()) { - handleDialButtonClickWithEmptyDigits(); - } else if (mAddParticipant && isPhoneInUse() && isDigitsEmpty() - && mRecipients.isShown() && isRecipientEmpty()) { - // mRecipients must be empty - // TODO add support for conference URI in last number dialed - // use ErrorDialogFragment instead? also see - // android.app.AlertDialog - android.widget.Toast.makeText(getActivity(), - "Error: Cannot dial. Please provide conference recipients.", - android.widget.Toast.LENGTH_SHORT).show(); - } else { - // "persist.radio.otaspdial" is a temporary hack needed for one carrier's automated - // test equipment. - // TODO: clean it up. - if (number != null - && !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp) - && number.matches(mProhibitedPhoneNumberRegexp)) { - Log.i(TAG, "The phone number is prohibited explicitly by a rule."); - if (getActivity() != null) { - DialogFragment dialogFragment = ErrorDialogFragment.newInstance( - R.string.dialog_phone_call_prohibited_message); - dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); - } - - // Clear the digits just in case. - clearDialpad(); - } else { - final Intent intent = CallUtil.getCallIntent(number); - if (!isDigitsShown) { - // must be dial conference add extra - intent.putExtra(EXTRA_DIAL_CONFERENCE_URI, true); - } - intent.putExtra(ADD_PARTICIPANT_KEY, mAddParticipant && isPhoneInUse()); - DialerUtils.startActivityWithErrorToast(getActivity(), intent); - hideAndClearDialpad(false); + final String number = mDigits.getText().toString(); + + // "persist.radio.otaspdial" is a temporary hack needed for one carrier's automated + // test equipment. + // TODO: clean it up. + if (number != null + && !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp) + && number.matches(mProhibitedPhoneNumberRegexp)) { + Log.i(TAG, "The phone number is prohibited explicitly by a rule."); + if (getActivity() != null) { + DialogFragment dialogFragment = ErrorDialogFragment.newInstance( + R.string.dialog_phone_call_prohibited_message); + dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); } + + // Clear the digits just in case. + clearDialpad(); + } else { + final Intent intent = IntentUtil.getCallIntent(number, + (getActivity() instanceof DialtactsActivity ? + ((DialtactsActivity) getActivity()).getCallOrigin() : null)); + DialerUtils.startActivityWithErrorToast(getActivity(), intent); + hideAndClearDialpad(false); } } } @@ -1609,10 +1474,6 @@ public class DialpadFragment extends Fragment CallSubjectDialog.start(getActivity(), mDigits.getText().toString()); hideAndClearDialpad(false); return true; - case R.id.menu_add_to_4g_conference_call: - getActivity().startActivity(CallUtil.getConferenceDialerIntent( - mDigits.getText().toString())); - return true; default: return false; } @@ -1751,13 +1612,6 @@ public class DialpadFragment extends Fragment } /** - * @return true if the widget with the mRecipients is empty. - */ - private boolean isRecipientEmpty() { - return (mRecipients == null) || (mRecipients.length() == 0); - } - - /** * Starts the asyn query to get the last dialed/outgoing * number. When the background query finishes, mLastNumberDialed * is set to the last dialed number or an empty string if none |