diff options
author | emancebo <emancebo@cyngn.com> | 2014-09-02 15:21:49 -0700 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2014-09-04 15:20:01 -0700 |
commit | 1df0439bb5cd3a2987719015848b2c95d59361c8 (patch) | |
tree | 690a53b9ae9ba89446b99482ce4fe76c41e4e0ea /src/com/android/incallui/CallCardFragment.java | |
parent | 77d13930d9af05d69274b54e88fc713e9c04b150 (diff) | |
download | packages_apps_InCallUI-1df0439bb5cd3a2987719015848b2c95d59361c8.tar.gz packages_apps_InCallUI-1df0439bb5cd3a2987719015848b2c95d59361c8.tar.bz2 packages_apps_InCallUI-1df0439bb5cd3a2987719015848b2c95d59361c8.zip |
InCallUI CMCC: disable volume boost by default
The volume boost button in the InCall UI attempts to boost the volume
by setting parameters on the AudioManager. This only works if there
is hardware support for the volume_boost=on parameter. If enabling
volume boost with setParameters doesn't work, then getParameters will
not surface the parameter, which creates a confusing user experience
because we will report "volume boost disabled" whenever the user presses
the button (when the expected behavior is to toggle it).
This should really only be enabled if it is supported, so this disables
it by default.
Change-Id: I0b0458f63a9d1524c887c5a8d45cff937aceacf1
Diffstat (limited to 'src/com/android/incallui/CallCardFragment.java')
-rw-r--r-- | src/com/android/incallui/CallCardFragment.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java index ce8173a5..d2ae19c6 100644 --- a/src/com/android/incallui/CallCardFragment.java +++ b/src/com/android/incallui/CallCardFragment.java @@ -21,6 +21,7 @@ package com.android.incallui; import android.animation.LayoutTransition; +import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; @@ -76,6 +77,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private AudioManager mAudioManager; private Toast mVBNotify; private int mVBToastPosition; + private boolean mVBEnabled; // Secondary caller info private ViewStub mSecondaryCallInfo; @@ -181,6 +183,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr .getSystemService(Context.AUDIO_SERVICE); } + @Override + public void onAttach(Activity activity) { + super.onAttach(activity); + mVBEnabled = activity.getResources().getBoolean(R.bool.volume_boost_enabled); + } @Override public void onActivityCreated(Bundle savedInstanceState) { @@ -230,10 +237,13 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr transition.enableTransitionType(LayoutTransition.CHANGING); transition.setAnimateParentHierarchy(false); transition.setDuration(200); - - mVBButton = (Button) view.findViewById(R.id.volumeBoost); - if (null != mVBButton) { - mVBButton.setOnClickListener(mVBListener); + + if (mVBEnabled) { + mVBButton = (Button) view.findViewById(R.id.volumeBoost); + if (null != mVBButton) { + mVBButton.setOnClickListener(mVBListener); + mVBButton.setVisibility(View.INVISIBLE); + } } } @@ -400,7 +410,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr // States other than disconnected not yet supported callStateLabel = getCallStateLabelFromState(state, cause, isWaitingForRemoteSide); - updateVBbyCall(state); + if (mVBEnabled) { + updateVBbyCall(state); + } Log.v(this, "setCallState " + callStateLabel); Log.v(this, "DisconnectCause " + cause); |