Merge "Emergency redial implementation" am: b3b09849bc
am: f5a457244c
Change-Id: Ied2aa7255546df647b01884b6c1689c6192e1d67
This commit is contained in:
@@ -824,6 +824,8 @@ public abstract class Connection extends Conferenceable {
|
||||
public void onRttInitiationFailure(Connection c, int reason) {}
|
||||
public void onRttSessionRemotelyTerminated(Connection c) {}
|
||||
public void onRemoteRttRequest(Connection c) {}
|
||||
/** @hide */
|
||||
public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3061,6 +3063,18 @@ public abstract class Connection extends Conferenceable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies listeners when phone account is changed. For example, when the PhoneAccount is
|
||||
* changed due to an emergency call being redialed.
|
||||
* @param pHandle The new PhoneAccountHandle for this connection.
|
||||
* @hide
|
||||
*/
|
||||
public void notifyPhoneAccountChanged(PhoneAccountHandle pHandle) {
|
||||
for (Listener l : mListeners) {
|
||||
l.onPhoneAccountChanged(this, pHandle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an event associated with this {@code Connection} with associated event extras to the
|
||||
* {@link InCallService}.
|
||||
|
||||
@@ -1332,6 +1332,14 @@ public abstract class ConnectionService extends Service {
|
||||
mAdapter.onRemoteRttRequest(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {
|
||||
String id = mIdByConnection.get(c);
|
||||
if (id != null) {
|
||||
mAdapter.onPhoneAccountChanged(id, pHandle);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -609,4 +609,20 @@ final class ConnectionServiceAdapter implements DeathRecipient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies Telecom that a call's PhoneAccountHandle has changed.
|
||||
*
|
||||
* @param callId The unique ID of the call.
|
||||
* @param pHandle The new PhoneAccountHandle associated with the call.
|
||||
*/
|
||||
void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle) {
|
||||
for (IConnectionServiceAdapter adapter : mAdapters) {
|
||||
try {
|
||||
Log.d(this, "onPhoneAccountChanged %s", callId);
|
||||
adapter.onPhoneAccountChanged(callId, pHandle, Log.getExternalSession());
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ final class ConnectionServiceAdapterServant {
|
||||
private static final int MSG_ON_RTT_INITIATION_FAILURE = 31;
|
||||
private static final int MSG_ON_RTT_REMOTELY_TERMINATED = 32;
|
||||
private static final int MSG_ON_RTT_UPGRADE_REQUEST = 33;
|
||||
private static final int MSG_SET_PHONE_ACCOUNT_CHANGED = 34;
|
||||
|
||||
private final IConnectionServiceAdapter mDelegate;
|
||||
|
||||
@@ -318,6 +319,16 @@ final class ConnectionServiceAdapterServant {
|
||||
case MSG_ON_RTT_UPGRADE_REQUEST:
|
||||
mDelegate.onRemoteRttRequest((String) msg.obj, null /*Session.Info*/);
|
||||
break;
|
||||
case MSG_SET_PHONE_ACCOUNT_CHANGED: {
|
||||
SomeArgs args = (SomeArgs) msg.obj;
|
||||
try {
|
||||
mDelegate.onPhoneAccountChanged((String) args.arg1,
|
||||
(PhoneAccountHandle) args.arg2, null /*Session.Info*/);
|
||||
} finally {
|
||||
args.recycle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -581,6 +592,15 @@ final class ConnectionServiceAdapterServant {
|
||||
throws RemoteException {
|
||||
mHandler.obtainMessage(MSG_ON_RTT_UPGRADE_REQUEST, connectionId).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle,
|
||||
Session.Info sessionInfo) {
|
||||
SomeArgs args = SomeArgs.obtain();
|
||||
args.arg1 = callId;
|
||||
args.arg2 = pHandle;
|
||||
mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT_CHANGED, args).sendToTarget();
|
||||
}
|
||||
};
|
||||
|
||||
public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
|
||||
|
||||
@@ -207,6 +207,11 @@ final class RemoteConnectionService {
|
||||
// in the underlying connection or conference objects
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle,
|
||||
Session.Info sessionInfo) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConferenceCall(
|
||||
final String callId, ParcelableConference parcel, Session.Info sessionInfo) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.telecom.DisconnectCause;
|
||||
import android.telecom.Logging.Session;
|
||||
import android.telecom.ParcelableConnection;
|
||||
import android.telecom.ParcelableConference;
|
||||
import android.telecom.PhoneAccountHandle;
|
||||
import android.telecom.StatusHints;
|
||||
|
||||
import com.android.internal.telecom.IVideoProvider;
|
||||
@@ -114,4 +115,7 @@ oneway interface IConnectionServiceAdapter {
|
||||
void onRttSessionRemotelyTerminated(String callId, in Session.Info sessionInfo);
|
||||
|
||||
void onRemoteRttRequest(String callId, in Session.Info sessionInfo);
|
||||
|
||||
void onPhoneAccountChanged(String callId, in PhoneAccountHandle pHandle,
|
||||
in Session.Info sessionInfo);
|
||||
}
|
||||
|
||||
@@ -226,13 +226,6 @@ public class DisconnectCause {
|
||||
*/
|
||||
public static final int DATA_LIMIT_REACHED = 55;
|
||||
|
||||
/**
|
||||
* The emergency call was terminated because it was dialed on the wrong SIM slot.
|
||||
* The call needs to be redialed the other slot.
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int DIALED_ON_WRONG_SLOT = 56;
|
||||
|
||||
/**
|
||||
* The call being placed was detected as a call forwarding number and was being dialed while
|
||||
* roaming on a carrier that does not allow this.
|
||||
@@ -268,6 +261,18 @@ public class DisconnectCause {
|
||||
*/
|
||||
public static final int DIAL_LOW_BATTERY = 62;
|
||||
|
||||
/**
|
||||
* Emergency call failed with a temporary fail cause and can be redialed on this slot.
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int EMERGENCY_TEMP_FAILURE = 63;
|
||||
|
||||
/**
|
||||
* Emergency call failed with a permanent fail cause and should not be redialed on this
|
||||
* slot.
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int EMERGENCY_PERM_FAILURE = 64;
|
||||
//*********************************************************************************************
|
||||
// When adding a disconnect type:
|
||||
// 1) Update toString() with the newly added disconnect type.
|
||||
@@ -392,8 +397,6 @@ public class DisconnectCause {
|
||||
return "DATA_DISABLED";
|
||||
case DATA_LIMIT_REACHED:
|
||||
return "DATA_LIMIT_REACHED";
|
||||
case DIALED_ON_WRONG_SLOT:
|
||||
return "DIALED_ON_WRONG_SLOT";
|
||||
case DIALED_CALL_FORWARDING_WHILE_ROAMING:
|
||||
return "DIALED_CALL_FORWARDING_WHILE_ROAMING";
|
||||
case IMEI_NOT_ACCEPTED:
|
||||
@@ -406,6 +409,10 @@ public class DisconnectCause {
|
||||
return "LOW_BATTERY";
|
||||
case DIAL_LOW_BATTERY:
|
||||
return "DIAL_LOW_BATTERY";
|
||||
case EMERGENCY_TEMP_FAILURE:
|
||||
return "EMERGENCY_TEMP_FAILURE";
|
||||
case EMERGENCY_PERM_FAILURE:
|
||||
return "EMERGENCY_PERM_FAILURE";
|
||||
default:
|
||||
return "INVALID: " + cause;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user