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 20:46:40 +0000
commit51dbf5ce874dbe510681be0f0ce9f3beee088b7b (patch)
tree185a6efb95b7a57a2239e4be8e0a350763ea63e2
parent29025f69bdde40a919b17ac16386c96cf8de2ae8 (diff)
downloadpackages_apps_InCallUI-51dbf5ce874dbe510681be0f0ce9f3beee088b7b.tar.gz
packages_apps_InCallUI-51dbf5ce874dbe510681be0f0ce9f3beee088b7b.tar.bz2
packages_apps_InCallUI-51dbf5ce874dbe510681be0f0ce9f3beee088b7b.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 (cherry picked from commit 4dfef8cbe64c0b6cfc45a1d40e17cfba4685f2e5)
-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()