summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2014-09-02 15:21:49 -0700
committeremancebo <emancebo@cyngn.com>2014-09-04 15:20:01 -0700
commit1df0439bb5cd3a2987719015848b2c95d59361c8 (patch)
tree690a53b9ae9ba89446b99482ce4fe76c41e4e0ea
parent77d13930d9af05d69274b54e88fc713e9c04b150 (diff)
downloadpackages_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
-rw-r--r--res/layout/primary_call_info.xml2
-rw-r--r--res/values/config.xml1
-rw-r--r--src/com/android/incallui/CallCardFragment.java22
3 files changed, 19 insertions, 6 deletions
diff --git a/res/layout/primary_call_info.xml b/res/layout/primary_call_info.xml
index 5dfd734f..4c442b08 100644
--- a/res/layout/primary_call_info.xml
+++ b/res/layout/primary_call_info.xml
@@ -146,7 +146,7 @@
android:layout_below="@id/primary_call_banner"
android:layout_width="80dp"
android:layout_height="80dp"
- android:visibility="invisible"
+ android:visibility="gone"
android:soundEffectsEnabled="false"
android:background="@drawable/volume_in_boost_nor"/>
diff --git a/res/values/config.xml b/res/values/config.xml
index 434a0c3d..8ec084d4 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -28,4 +28,5 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<resources>
<!-- Dismiss the Keyguard screen when there is active call. -->
<bool name="config_incall_dismiss_keyguard">true</bool>
+ <bool name="volume_boost_enabled">false</bool>
</resources>
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);