summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-10-17 21:57:37 -0700
committerSteve Kondik <steve@cyngn.com>2016-10-17 21:57:37 -0700
commitc67a5ec41593b744f32409e064759d20e21ef246 (patch)
tree3ea099da90a2e242b466d1c5d4a85ed21979fe3d
parent2cfc801eb507effa996e5dffc57845ec7ff5d94a (diff)
parent2c45694260b8b01fd774651ee03b79d38e92c5f9 (diff)
downloadandroid_packages_apps_ContactsCommon-cm-14.0.tar.gz
android_packages_apps_ContactsCommon-cm-14.0.tar.bz2
android_packages_apps_ContactsCommon-cm-14.0.zip
Merge tag 'LA.UM.5.5.r1-00900-8x96.0' of git://codeaurora.org/platform/packages/apps/ContactsCommon into cm-14.0cm-14.0
"LA.UM.5.5.r1-00900-8x96.0"
-rw-r--r--src/com/android/contacts/common/CallUtil.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/contacts/common/CallUtil.java b/src/com/android/contacts/common/CallUtil.java
index acbf6fb0..d253a4d0 100644
--- a/src/com/android/contacts/common/CallUtil.java
+++ b/src/com/android/contacts/common/CallUtil.java
@@ -200,12 +200,23 @@ public class CallUtil {
public static boolean isVideoEnabled(Context context) {
boolean hasVideoCap = ((getVideoCallingAvailability(context) &
VIDEO_CALLING_ENABLED) != 0);
- Settings.System.putInt(context.getContentResolver(),
- CONFIG_VIDEO_CALLING,hasVideoCap?ENABLE_VIDEO_CALLING:DISABLE_VIDEO_CALLING);
+ saveVideoCallConfig(context,hasVideoCap);
return hasVideoCap;
}
/**
+ * save the value of video call config.
+ *
+ * @param context The context, enable.
+ */
+ public static void saveVideoCallConfig(Context context, boolean enable) {
+ if(Settings.System.canWrite(context)) {
+ Settings.System.putInt(context.getContentResolver(),
+ CONFIG_VIDEO_CALLING,enable?ENABLE_VIDEO_CALLING:DISABLE_VIDEO_CALLING);
+ }
+ }
+
+ /**
* Determines if one of the call capable phone accounts defined supports calling with a subject
* specified.
*
@@ -295,8 +306,11 @@ public class CallUtil {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
- Settings.System.putInt(context.getContentResolver(),
- DIALOG_VIDEO_CALLING,isChecked?ENABLE_VIDEO_CALLING:DISABLE_VIDEO_CALLING);
+ if(Settings.System.canWrite(context)) {
+ Settings.System.putInt(context.getContentResolver(),
+ DIALOG_VIDEO_CALLING,isChecked?
+ ENABLE_VIDEO_CALLING:DISABLE_VIDEO_CALLING);
+ }
}
});
AlertDialog.Builder builder = new AlertDialog.Builder(context);