summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom')
-rw-r--r--telecomm/java/android/telecom/Conference.java4
-rw-r--r--telecomm/java/android/telecom/Connection.java11
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java2
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java1
-rw-r--r--telecomm/java/android/telecom/DefaultDialerManager.java41
5 files changed, 36 insertions, 23 deletions
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 0424548..e682697 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -179,7 +179,6 @@ public abstract class Conference implements Conferenceable {
/**
* Returns VideoProvider of the primary call. This can be null.
- * @hide
*/
public VideoProvider getVideoProvider() {
return null;
@@ -187,7 +186,6 @@ public abstract class Conference implements Conferenceable {
/**
* Returns video state of the primary call.
- * @hide
*/
public int getVideoState() {
return VideoProfile.VideoState.AUDIO_ONLY;
@@ -373,7 +371,6 @@ public abstract class Conference implements Conferenceable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @param videoState The new video state.
- * @hide
*/
public final void setVideoState(Connection c, int videoState) {
Log.d(this, "setVideoState Conference: %s Connection: %s VideoState: %s",
@@ -387,7 +384,6 @@ public abstract class Conference implements Conferenceable {
* Sets the video connection provider.
*
* @param videoProvider The video provider.
- * @hide
*/
public final void setVideoProvider(Connection c, Connection.VideoProvider videoProvider) {
Log.d(this, "setVideoProvider Conference: %s Connection: %s VideoState: %s",
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 4bc639b..0bf9118 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -106,38 +106,32 @@ public abstract class Connection implements Conferenceable {
/**
* Local device supports receiving video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 0x00000100;
/**
* Local device supports transmitting video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 0x00000200;
/**
* Local device supports bidirectional video calling.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL =
CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX;
/**
* Remote device supports receiving video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 0x00000400;
/**
* Remote device supports transmitting video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 0x00000800;
/**
* Remote device supports bidirectional video calling.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL =
CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX;
@@ -187,14 +181,12 @@ public abstract class Connection implements Conferenceable {
/**
* Call can be upgraded to a video call.
- * @hide
*/
public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 0x00080000;
/**
* For video calls, indicates whether the outgoing video for the call can be paused using
* the {@link android.telecom.VideoProfile.VideoState#PAUSED} VideoState.
- * @hide
*/
public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000;
@@ -1041,7 +1033,6 @@ public abstract class Connection implements Conferenceable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @param videoState The new video state.
- * @hide
*/
public final void setVideoState(int videoState) {
checkImmutable();
@@ -1105,7 +1096,6 @@ public abstract class Connection implements Conferenceable {
/**
* Sets the video connection provider.
* @param videoProvider The video provider.
- * @hide
*/
public final void setVideoProvider(VideoProvider videoProvider) {
checkImmutable();
@@ -1414,7 +1404,6 @@ public abstract class Connection implements Conferenceable {
* a request to accept.
*
* @param videoState The video state in which to answer the connection.
- * @hide
*/
public void onAnswer(int videoState) {}
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index 71b481b..f5cceea 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -50,7 +50,6 @@ public final class ConnectionRequest implements Parcelable {
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
* @param extras Application-specific extra data.
* @param videoState Determines the video state for the connection.
- * @hide
*/
public ConnectionRequest(
PhoneAccountHandle accountHandle,
@@ -95,7 +94,6 @@ public final class ConnectionRequest implements Parcelable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @return The video state for the connection.
- * @hide
*/
public int getVideoState() {
return mVideoState;
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 4185651..13eb016 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -147,7 +147,6 @@ public abstract class ConnectionService extends Service {
}
@Override
- /** @hide */
public void answerVideo(String callId, int videoState) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
diff --git a/telecomm/java/android/telecom/DefaultDialerManager.java b/telecomm/java/android/telecom/DefaultDialerManager.java
index fd0c06d..d3df151 100644
--- a/telecomm/java/android/telecom/DefaultDialerManager.java
+++ b/telecomm/java/android/telecom/DefaultDialerManager.java
@@ -20,6 +20,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.net.Uri;
import android.provider.Settings;
import android.text.TextUtils;
@@ -151,14 +152,14 @@ public class DefaultDialerManager {
for (ResolveInfo resolveInfo : resolveInfoList) {
final ActivityInfo activityInfo = resolveInfo.activityInfo;
- if (activityInfo == null) {
- continue;
+ if (activityInfo != null && !packageNames.contains(activityInfo.packageName)) {
+ packageNames.add(activityInfo.packageName);
}
- packageNames.add(activityInfo.packageName);
}
- // TODO: Filter for apps that don't handle DIAL intent with tel scheme
- return packageNames;
+ final Intent dialIntentWithTelScheme = new Intent(Intent.ACTION_DIAL);
+ dialIntentWithTelScheme.setData(Uri.fromParts(PhoneAccount.SCHEME_TEL, "", null));
+ return filterByIntent(context, packageNames, dialIntentWithTelScheme);
}
/**
@@ -182,6 +183,36 @@ public class DefaultDialerManager {
|| packageName.equals(tm.getSystemDialerPackage());
}
+ /**
+ * Filter a given list of package names for those packages that contain an activity that has
+ * an intent filter for a given intent.
+ *
+ * @param context A valid context
+ * @param packageNames List of package names to filter.
+ * @return The filtered list.
+ */
+ private static List<String> filterByIntent(Context context, List<String> packageNames,
+ Intent intent) {
+ if (packageNames == null || packageNames.isEmpty()) {
+ return new ArrayList<>();
+ }
+
+ final List<String> result = new ArrayList<>();
+ final List<ResolveInfo> resolveInfoList =
+ context.getPackageManager().queryIntentActivities(intent, 0);
+ final int length = resolveInfoList.size();
+ for (int i = 0; i < length; i++) {
+ final ActivityInfo info = resolveInfoList.get(i).activityInfo;
+ if (info != null && packageNames.contains(info.packageName)
+ && !result.contains(info.packageName)) {
+ result.add(info.packageName);
+ }
+ }
+
+ return result;
+ }
+
+
private static TelecomManager getTelecomManager(Context context) {
return (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
}