diff options
author | Andrew Lee <anwlee@google.com> | 2014-07-17 17:19:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-16 23:30:53 +0000 |
commit | 9f9b49aa57a21acf08582b5247694f3e7f56c3cb (patch) | |
tree | aa0bc088c79c0d0e87fd085dbb6b06c85d963fe5 | |
parent | a199cb71b32c9b4f8f876dc9551bf78287f5f86d (diff) | |
parent | e37b2d8fbe53ce4c11472182076c70a10f44f371 (diff) |
Merge "Delete auxiliary action button in call button fragment." into lmp-dev
5 files changed, 20 insertions, 164 deletions
diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 8969cbb37..8397ace97 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -63,24 +63,18 @@ android:background="@color/button_background_color" android:gravity="bottom|center_horizontal"> - <!-- This row has either 4 or 5 buttons, depending on - whether the device supports "Hold" (i.e. 4 buttons on - CDMA devices, 5 buttons on GSM devices.) The buttons - are interspersed with 'layout_weight="1"' placeholder - views so that they'll be spaced evenly in both cases. - - But note there are a couple of *pairs* of buttons that share a - single "slot", namely Hold/Swap and Add/Merge. For these, the - code in InCallTouchUi is responsible for making sure that at any - point exactly one of the pair is VISIBLE and the other is - GONE. --> + <!-- This row has either 4 or 5 buttons. This may depend on whether the device supports + "Hold" (i.e. 4 buttons on CDMA devices, 5 buttons on GSM devices.) or whether it is in + a video call. + + There are a couple of *pairs* of buttons that share a single "slot", namely Hold/Swap + and Add/Merge. For these, the code in InCallTouchUi is responsible for making sure + that at any point exactly one of the pair is VISIBLE and the other is GONE. --> <!-- "Audio mode" --> - <!-- This is a multi-mode button that can behave either like a - simple "compound button" with two states *or* like an - action button that brings up a popup menu; see - btn_compound_audio.xml and InCallTouchUi.updateAudioButton() - for the full details. --> + <!-- This is a multi-mode button that can behave either like a simple "compound button" with + two states *or* like an action button that brings up a popup menu; see + btn_compound_audio.xml and InCallTouchUi.updateAudioButton() for the full details. --> <ImageButton android:id="@+id/audioButton" style="@style/InCallButton" android:background="@drawable/btn_compound_audio" @@ -100,9 +94,9 @@ android:background="@drawable/btn_compound_dialpad" android:contentDescription="@string/onscreenShowDialpadText" /> - <!-- This slot is either "Hold" or "Swap", depending on - the state of the call. One or the other of these - must always be set to GONE. --> + <!-- This slot is either "Hold" or "Swap", depending on the state of the call. One or the + other of these must always be set to GONE. --> + <!-- "Hold" --> <!-- This is a "compound button": it has checked and unchecked states. --> <ImageButton android:id="@+id/holdButton" @@ -117,9 +111,9 @@ android:contentDescription="@string/onscreenSwapCallsText" android:visibility="gone" /> - <!-- This slot is either "Add" or "Merge", depending on - the state of the call. One or the other of these - must always be set to GONE. --> + <!-- This slot is either "Add" or "Merge", depending on the state of the call. One or the + other of these must always be set to GONE. --> + <!-- "Add Call" --> <ImageButton android:id="@+id/addButton" style="@style/InCallButton" @@ -128,19 +122,15 @@ android:visibility="gone" /> <!-- "Merge calls" --> - <!-- This button is used only on GSM devices, where we know - that "Add" and "Merge" are never available at the same time. - The "Merge" button for CDMA devices is "cdmaMergeButton" above. --> + <!-- This button is used only on GSM devices, where we know that "Add" and "Merge" are never + available at the same time. The "Merge" button for CDMA devices is "cdmaMergeButton" + above. --> <ImageButton android:id="@+id/mergeButton" style="@style/InCallButton" android:background="@drawable/btn_merge" android:contentDescription="@string/onscreenMergeCallsText" android:visibility="gone" /> - <ImageButton android:id="@+id/auxiliaryActionButton" - style="@style/InCallButton" - android:visibility="gone" /> - </LinearLayout> </LinearLayout> diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 20d2aa723..3b06f1af1 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -16,7 +16,6 @@ package com.android.incallui; -import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.os.Bundle; import android.view.LayoutInflater; @@ -30,7 +29,6 @@ import android.widget.ImageButton; import android.widget.PopupMenu; import android.widget.PopupMenu.OnDismissListener; import android.widget.PopupMenu.OnMenuItemClickListener; -import android.widget.ToggleButton; import com.android.services.telephony.common.AudioMode; @@ -49,7 +47,6 @@ public class CallButtonFragment private ImageButton mMergeButton; private ImageButton mAddCallButton; private ImageButton mSwapButton; - private ImageButton mAuxiliaryActionButton; private PopupMenu mAudioModePopup; private boolean mAudioModePopupVisible; @@ -136,8 +133,6 @@ public class CallButtonFragment mMergeButton.setOnClickListener(this); mSwapButton = (ImageButton) parent.findViewById(R.id.swapButton); mSwapButton.setOnClickListener(this); - mAuxiliaryActionButton = (ImageButton) parent.findViewById(R.id.auxiliaryActionButton); - mAuxiliaryActionButton.setOnClickListener(this); return parent; } @@ -180,9 +175,6 @@ public class CallButtonFragment case R.id.dialpadButton: getPresenter().showDialpadClicked(!mShowDialpadButton.isSelected()); break; - case R.id.auxiliaryActionButton: - getPresenter().auxiliaryActionButtonClicked(); - break; default: Log.wtf(this, "onClick: unexpected"); break; @@ -516,15 +508,6 @@ public class CallButtonFragment } @Override - public void updateAuxiliaryActionButton(boolean show, String description, Drawable drawable) { - mAuxiliaryActionButton.setVisibility(show ? View.VISIBLE : View.GONE); - if (show) { - mAuxiliaryActionButton.setContentDescription(description); - mAuxiliaryActionButton.setImageDrawable(drawable); - } - } - - @Override public void showManageConferenceCallButton() { mExtraRowButton.setVisibility(View.VISIBLE); mManageConferenceButton.setVisibility(View.VISIBLE); diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 84cb8ac96..f49637e92 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -26,7 +26,6 @@ import com.android.incallui.AudioModeProvider.AudioModeListener; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; -import com.android.incallui.service.AuxiliaryActionService; import com.android.incalluibind.ServiceFactory; import com.android.services.telephony.common.AudioMode; @@ -37,8 +36,7 @@ import android.telephony.PhoneNumberUtils; * Logic for call buttons. */ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButtonUi> - implements InCallStateListener, AudioModeListener, IncomingCallListener, - AuxiliaryActionService.Client { + implements InCallStateListener, AudioModeListener, IncomingCallListener { private Call mCall; private boolean mAutomaticallyMuted = false; @@ -49,8 +47,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto private InCallState mPreviousState = null; - private AuxiliaryActionService mAuxiliaryActionService = null; - public CallButtonPresenter() { } @@ -65,10 +61,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto InCallPresenter.getInstance().addIncomingCallListener(this); Context context = ((Fragment) ui).getActivity(); - mAuxiliaryActionService = ServiceFactory.newAuxiliaryActionService(context); - if (mAuxiliaryActionService != null) { - mAuxiliaryActionService.setClient(this); - } } @Override @@ -78,9 +70,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto InCallPresenter.getInstance().removeListener(this); AudioModeProvider.getInstance().removeListener(this); InCallPresenter.getInstance().removeIncomingCallListener(this); - if (mAuxiliaryActionService != null) { - mAuxiliaryActionService.setClient(null); - } } @Override @@ -142,11 +131,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } } - @Override - public void onAuxiliaryActionStateChanged() { - updateAuxiliaryActionButton(); - } - public int getAudioMode() { return AudioModeProvider.getInstance().getAudioMode(); } @@ -234,10 +218,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto updateExtraButtonRow(); } - public void auxiliaryActionButtonClicked() { - mAuxiliaryActionService.performAction(); - } - private void updateUi(InCallState state, Call call) { final CallButtonUi ui = getUi(); if (ui == null) { @@ -324,7 +304,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto mShowManageConference = (call.isConferenceCall() && !isGenericConference); updateExtraButtonRow(); - updateAuxiliaryActionButton(); } } @@ -346,22 +325,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } } - private void updateAuxiliaryActionButton() { - if (mAuxiliaryActionService == null) { - return; - } - final CallButtonUi ui = getUi(); - if (ui == null) { - return; - } - if (mCall != null) { - mAuxiliaryActionService.setRemotePhoneNumber(mCall.getNumber()); - } - ui.updateAuxiliaryActionButton(mAuxiliaryActionService.isActionEnabled(), - mAuxiliaryActionService.getActionDescription(), - mAuxiliaryActionService.getActionDrawable()); - } - public void refreshMuteState() { // Restore the previous mute state if (mAutomaticallyMuted && @@ -393,6 +356,5 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto void showGenericMergeButton(); void hideExtraRow(); void displayManageConferencePanel(boolean on); - void updateAuxiliaryActionButton(boolean show, String description, Drawable drawable); } } diff --git a/InCallUI/src/com/android/incallui/service/AuxiliaryActionService.java b/InCallUI/src/com/android/incallui/service/AuxiliaryActionService.java deleted file mode 100644 index b0970faac..000000000 --- a/InCallUI/src/com/android/incallui/service/AuxiliaryActionService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.android.incallui.service; - -import android.graphics.drawable.Drawable; - -/** - * Generic service that allows the user to perform an action from within the in call UI. - * If the service is implemented then a button is added to the InCallUI. The button is visible if - * AuxiliaryActionService.isActionEnabled() returns true and hidden otherwise. If this service - * is not implemented then the button is always hidden. - */ -public interface AuxiliaryActionService { - /** - * Client of the service. - */ - public interface Client { - /** - * Called when the action's enabled state may have changed. - */ - public void onAuxiliaryActionStateChanged(); - } - - /** - * Sets the client. - */ - public void setClient(Client client); - - /** - * Sets the remote phone number. - */ - public void setRemotePhoneNumber(String remotePhoneNumber); - - /** - * Gets the action's description. - * - * @return the description. - */ - public String getActionDescription(); - - /** - * Gets the action's drawable. - * - * @return the drawable. - */ - public Drawable getActionDrawable(); - - /** - * Checks if the auxiliary action is enabled. - * - * @return true if the action is enabled, otherwise false. - */ - public boolean isActionEnabled(); - - /** - * Triggers the action for the auxiliary service. - */ - public void performAction(); -} diff --git a/InCallUI/src/com/android/incalluibind/ServiceFactory.java b/InCallUI/src/com/android/incalluibind/ServiceFactory.java index fcbc0ca59..7191f146b 100644 --- a/InCallUI/src/com/android/incalluibind/ServiceFactory.java +++ b/InCallUI/src/com/android/incalluibind/ServiceFactory.java @@ -18,7 +18,6 @@ package com.android.incalluibind; import android.content.Context; -import com.android.incallui.service.AuxiliaryActionService; import com.android.incallui.service.PhoneNumberService; /** @@ -30,9 +29,4 @@ public class ServiceFactory { // no phone number service. return null; } - - public static AuxiliaryActionService newAuxiliaryActionService(Context context) { - // no auxiliary action service. - return null; - } } |