Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Proper supplementary service notification handling (1/5).
Browse files Browse the repository at this point in the history
Change-Id: I4fa94d4ba68a1570d3f822be569ae124882c0e66
  • Loading branch information
maniac103 committed Jul 26, 2018
1 parent d6acb80 commit 8e9e3c6
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
20 changes: 19 additions & 1 deletion telecomm/java/android/telecom/Call.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,20 @@ public static class Details {
*/
public static final int PROPERTY_ASSISTED_DIALING_USED = 0x00000200;

/**
* Whether the call was forwarded from another party (GSM only)
* @hide
*/
public static final int PROPERTY_WAS_FORWARDED = 0x00000400;

/**
* Whether incoming calls are barred at the remote side
* @hide
*/
public static final int PROPERTY_REMOTE_INCOMING_CALLS_BARRED = 0x0000800;

//******************************************************************************************
// Next PROPERTY value: 0x00000400
// Next PROPERTY value: 0x00001000
//******************************************************************************************

private final String mTelecomCallId;
Expand Down Expand Up @@ -587,6 +599,12 @@ public static String propertiesToString(int properties) {
if(hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) {
builder.append(" PROPERTY_ASSISTED_DIALING_USED");
}
if (hasProperty(properties, PROPERTY_WAS_FORWARDED)) {
builder.append(" PROPERTY_WAS_FORWARDED");
}
if (hasProperty(properties, PROPERTY_REMOTE_INCOMING_CALLS_BARRED)) {
builder.append(" PROPERTY_REMOTE_INCOMING_CALLS_BARRED");
}
builder.append("]");
return builder.toString();
}
Expand Down
4 changes: 3 additions & 1 deletion telecomm/java/android/telecom/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,11 @@ private final void clearConferenceableList() {
@Override
public String toString() {
return String.format(Locale.US,
"[State: %s,Capabilites: %s, VideoState: %s, VideoProvider: %s, ThisObject %s]",
"[State: %s, Capabilites: %s, Properties: %s, " +
"VideoState: %s, VideoProvider: %s, ThisObject %s]",
Connection.stateToString(mState),
Call.Details.capabilitiesToString(mConnectionCapabilities),
Call.Details.propertiesToString(mConnectionProperties),
getVideoState(),
getVideoProvider(),
super.toString());
Expand Down
69 changes: 68 additions & 1 deletion telecomm/java/android/telecom/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,20 @@ public abstract class Connection extends Conferenceable {
*/
public static final int PROPERTY_ASSISTED_DIALING_USED = 1 << 9;

/**
* Whether the call was forwarded from another party (GSM only)
* @hide
*/
public static final int PROPERTY_WAS_FORWARDED = 1 << 10;

/**
* Whether incoming calls are barred at the remote side
* @hide
*/
public static final int PROPERTY_REMOTE_INCOMING_CALLS_BARRED = 1 << 11;

//**********************************************************************************************
// Next PROPERTY value: 1<<10
// Next PROPERTY value: 1<<12
//**********************************************************************************************

/**
Expand Down Expand Up @@ -575,6 +587,22 @@ public abstract class Connection extends Conferenceable {
public static final String EVENT_CALL_REMOTELY_UNHELD =
"android.telecom.event.CALL_REMOTELY_UNHELD";

/**
* Connection event used to inform {@link InCallService} when the dialing state
* is waiting for the busy remote side.
* @hide
*/
public static final String EVENT_DIALING_IS_WAITING =
"android.telecom.event.DIALING_IS_WAITING";

/**
* Connection event used to inform {@link InCallService} Whether an additional call came in
* and was forwarded while the call was active.
* @hide
*/
public static final String EVENT_ADDITIONAL_CALL_FORWARDED =
"android.telecom.event.ADDITIONAL_CALL_FORWARDED";

/**
* Connection event used to inform an {@link InCallService} which initiated a call handover via
* {@link Call#EVENT_REQUEST_HANDOVER} that the handover from this {@link Connection} has
Expand Down Expand Up @@ -789,10 +817,49 @@ private static String propertiesToStringInternal(int properties, boolean isLong)
builder.append(isLong ? " PROPERTY_HAS_CDMA_VOICE_PRIVACY" : " priv");
}

if (can(properties, PROPERTY_WAS_FORWARDED)) {
builder.append(" PROPERTY_WAS_FORWARDED");
}

if (can(properties, PROPERTY_REMOTE_INCOMING_CALLS_BARRED)) {
builder.append(" PROPERTY_REMOTE_INCOMING_CALLS_BARRED");
}

builder.append("]");
return builder.toString();
}

/**
* Whether the properties of this {@code Connection} include the specified property.
*
* @param property The property to look for.
* @return Whether the specified property is present.
* @hide
*/
public boolean hasProperty(int property) {
return can(mConnectionProperties, property);
}

/**
* Removes the specified property from the set of properties of this {@code Connection}.
*
* @param property The property to remove from the set.
* @hide
*/
public void removeProperty(int property) {
setConnectionProperties(mConnectionProperties & ~property);
}

/**
* Adds the specified property to the set of propertes of this {@code Connection}.
*
* @param property The property to add to the set.
* @hide
*/
public void addProperty(int property) {
setConnectionProperties(mConnectionProperties | property);
}

/** @hide */
public abstract static class Listener {
public void onStateChanged(Connection c, int state) {}
Expand Down
2 changes: 1 addition & 1 deletion telecomm/java/android/telecom/ConnectionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public void onConnectionPropertiesChanged(
Conference conference,
int connectionProperties) {
String id = mIdByConference.get(conference);
Log.d(this, "call capabilities: conference: %s",
Log.d(this, "call properties: conference: %s",
Connection.propertiesToString(connectionProperties));
mAdapter.setConnectionProperties(id, connectionProperties);
}
Expand Down

0 comments on commit 8e9e3c6

Please sign in to comment.