Pass context into isVideoEnabled. Add getContext() method to adapter.
Bug: 16211386
Change-Id: I4b928abe242dd42f00ea19c972375f777367eee4
diff --git a/src/com/android/contacts/common/CallUtil.java b/src/com/android/contacts/common/CallUtil.java
index 1ed530c..dc1349c 100644
--- a/src/com/android/contacts/common/CallUtil.java
+++ b/src/com/android/contacts/common/CallUtil.java
@@ -16,8 +16,10 @@
package com.android.contacts.common;
+import android.content.Context;
import android.content.Intent;
import android.net.Uri;
+import android.phone.PhoneManager;
import android.telecomm.PhoneAccountHandle;
import android.telecomm.TelecommManager;
import android.telecomm.VideoProfile;
@@ -149,9 +151,14 @@
return Uri.fromParts(SCHEME_TEL, number, null);
}
- public static boolean isVideoEnabled() {
- // TODO: Write utility methods to check subscriptions and settings, and use it to determine
- // whether to enable or disable video call functionality.
+ public static boolean isVideoEnabled(Context context) {
+ PhoneManager phoneMgr = (PhoneManager) context.getSystemService(Context.PHONE_SERVICE);
+ if (phoneMgr == null) {
+ return false;
+ }
+
+ // TODO: Check phoneManager for value instead.
+ // return phoneMgr.isVideoEnabled();
return false;
}
}