summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-03-27 18:05:42 -0700
committerDanesh M <daneshm90@gmail.com>2015-05-06 15:26:06 -0700
commitef64fd0c1d905405685320022856fbd6b5a8eca3 (patch)
treef92c81661bf82af7aced8b0ce45920d9fa261dfe
parentc3362b5b996d8d3a0066d61f1d1e33e21577117d (diff)
downloadandroid_packages_apps_InCallUI-ef64fd0c1d905405685320022856fbd6b5a8eca3.tar.gz
android_packages_apps_InCallUI-ef64fd0c1d905405685320022856fbd6b5a8eca3.tar.bz2
android_packages_apps_InCallUI-ef64fd0c1d905405685320022856fbd6b5a8eca3.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/CallCardPresenter.java8
2 files changed, 27 insertions, 0 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/CallCardPresenter.java b/src/com/android/incallui/CallCardPresenter.java
index cbeb6cf2..3a93897d 100644
--- a/src/com/android/incallui/CallCardPresenter.java
+++ b/src/com/android/incallui/CallCardPresenter.java
@@ -808,6 +808,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> i
return false;
}
+ if (isVBHiddenByOverride()) {
+ return false;
+ }
+
int mode = AudioModeProvider.getInstance().getAudioMode();
int settingsTtyMode = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.PREFERRED_TTY_MODE, TelecomManager.TTY_MODE_OFF);
@@ -829,6 +833,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> i
mAudioManager.setParameters(VOLUME_BOOST_PARAMETER + value);
}
+ private boolean isVBHiddenByOverride() {
+ return mContext.getResources().getBoolean(R.bool.config_disable_audio_boost);
+ }
+
private void updateVBButton() {
boolean show = isVBAvailable();
boolean on = show && isVolumeBoostEnabled();