summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-03-27 18:05:42 -0700
committerMatt Garnes <matt@cyngn.com>2015-03-30 13:41:19 -0700
commit4dfef8cbe64c0b6cfc45a1d40e17cfba4685f2e5 (patch)
treec8e332345da454172f795ad19cedf0f5625a5302
parent62408123584f1dce4a97b04b9c53b98dd30bc699 (diff)
downloadpackages_apps_InCallUI-4dfef8cbe64c0b6cfc45a1d40e17cfba4685f2e5.tar.gz
packages_apps_InCallUI-4dfef8cbe64c0b6cfc45a1d40e17cfba4685f2e5.tar.bz2
packages_apps_InCallUI-4dfef8cbe64c0b6cfc45a1d40e17cfba4685f2e5.zip
Allow hiding volume boost feature with overlay.
Some devices do not support it, or do not support it well. Allow us to hide it with an overlayable config flag. Change-Id: I2c3b0b5d3a6e738b311b365f5855c41f7d08ab9a
-rw-r--r--res/values/config.xml19
-rw-r--r--src/com/android/incallui/CallCardFragment.java10
2 files changed, 27 insertions, 2 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 00000000..ff74c012
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="config_disable_audio_boost">true</bool>
+</resources>
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java
index 8927e025..d1f0f7da 100644
--- a/src/com/android/incallui/CallCardFragment.java
+++ b/src/com/android/incallui/CallCardFragment.java
@@ -1180,8 +1180,14 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
}
}
+ private boolean isVBHiddenByOverride() {
+ return getResources().getBoolean(R.bool.config_disable_audio_boost);
+ }
+
private void updateVBButton() {
- if (isVBAvailable()
+ if (isVBHiddenByOverride()) {
+ mVBButton.setVisibility(View.INVISIBLE);
+ } else if (isVBAvailable()
&& mAudioManager.getParameters(VOLUME_BOOST).contains("=on")) {
mVBButton.setBackgroundResource(R.drawable.vb_active);
@@ -1259,7 +1265,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
private void updateVBbyCall(int state) {
updateVBButton();
- if (Call.State.ACTIVE == state) {
+ if (Call.State.ACTIVE == state && !isVBHiddenByOverride()) {
mVBButton.setVisibility(View.VISIBLE);
} else if (Call.State.DISCONNECTED == state) {
if (!CallList.getInstance().hasAnyLiveCall()