diff --git a/api/current.txt b/api/current.txt index 02f485abc5b74..6a676453fbd9c 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28885,13 +28885,17 @@ package android.service.carrier { method public android.os.IBinder onBind(android.content.Intent); method public void onDownloadMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback); method public void onFilterSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendDataSms(byte[], int, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback); method public void onSendMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendMultipartTextSms(java.util.List, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendMultipartTextSms(java.util.List, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendMultipartTextSms(java.util.List, int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendTextSms(java.lang.String, int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); field public static final int DOWNLOAD_STATUS_ERROR = 2; // 0x2 field public static final int DOWNLOAD_STATUS_OK = 0; // 0x0 field public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1 + field public static final int SEND_FLAG_REQUEST_DELIVERY_STATUS = 1; // 0x1 field public static final int SEND_STATUS_ERROR = 2; // 0x2 field public static final int SEND_STATUS_OK = 0; // 0x0 field public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1 @@ -30822,6 +30826,7 @@ package android.telecom { method public static boolean isPaused(int); method public static boolean isReceptionEnabled(int); method public static boolean isTransmissionEnabled(int); + method public static java.lang.String videoStateToString(int); field public static final int AUDIO_ONLY = 0; // 0x0 field public static final int BIDIRECTIONAL = 3; // 0x3 field public static final int PAUSED = 4; // 0x4 @@ -31242,7 +31247,8 @@ package android.telephony { public class SmsMessage { method public static int[] calculateLength(java.lang.CharSequence, boolean); method public static int[] calculateLength(java.lang.String, boolean); - method public static android.telephony.SmsMessage createFromPdu(byte[]); + method public static deprecated android.telephony.SmsMessage createFromPdu(byte[]); + method public static android.telephony.SmsMessage createFromPdu(byte[], java.lang.String); method public java.lang.String getDisplayMessageBody(); method public java.lang.String getDisplayOriginatingAddress(); method public java.lang.String getEmailBody(); diff --git a/api/system-current.txt b/api/system-current.txt index dc263572848cb..2e061648c7bbb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -20885,6 +20885,7 @@ package android.net.wifi { field public static final int REASON_INVALID_LISTENER = -3; // 0xfffffffd field public static final int REASON_INVALID_REQUEST = -4; // 0xfffffffc field public static final int REASON_NOT_AVAILABLE = -2; // 0xfffffffe + field public static final int REASON_PERMISSION_DENIED = -5; // 0xfffffffb field public static final int REASON_UNSPECIFIED = -1; // 0xffffffff field public static final int RTT_BW_10_SUPPORT = 2; // 0x2 field public static final int RTT_BW_160_SUPPORT = 32; // 0x20 @@ -30896,13 +30897,17 @@ package android.service.carrier { method public android.os.IBinder onBind(android.content.Intent); method public void onDownloadMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback); method public void onFilterSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendDataSms(byte[], int, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback); method public void onSendMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendMultipartTextSms(java.util.List, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); - method public void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendMultipartTextSms(java.util.List, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendMultipartTextSms(java.util.List, int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); + method public deprecated void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback); + method public void onSendTextSms(java.lang.String, int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback); field public static final int DOWNLOAD_STATUS_ERROR = 2; // 0x2 field public static final int DOWNLOAD_STATUS_OK = 0; // 0x0 field public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1 + field public static final int SEND_FLAG_REQUEST_DELIVERY_STATUS = 1; // 0x1 field public static final int SEND_STATUS_ERROR = 2; // 0x2 field public static final int SEND_STATUS_OK = 0; // 0x0 field public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1 @@ -32982,6 +32987,7 @@ package android.telecom { method public static boolean isPaused(int); method public static boolean isReceptionEnabled(int); method public static boolean isTransmissionEnabled(int); + method public static java.lang.String videoStateToString(int); field public static final int AUDIO_ONLY = 0; // 0x0 field public static final int BIDIRECTIONAL = 3; // 0x3 field public static final int PAUSED = 4; // 0x4 @@ -33404,7 +33410,8 @@ package android.telephony { public class SmsMessage { method public static int[] calculateLength(java.lang.CharSequence, boolean); method public static int[] calculateLength(java.lang.String, boolean); - method public static android.telephony.SmsMessage createFromPdu(byte[]); + method public static deprecated android.telephony.SmsMessage createFromPdu(byte[]); + method public static android.telephony.SmsMessage createFromPdu(byte[], java.lang.String); method public java.lang.String getDisplayMessageBody(); method public java.lang.String getDisplayOriginatingAddress(); method public java.lang.String getEmailBody(); diff --git a/core/java/android/service/carrier/CarrierMessagingService.java b/core/java/android/service/carrier/CarrierMessagingService.java index 0592a84fba455..d7bf10c2c7d09 100644 --- a/core/java/android/service/carrier/CarrierMessagingService.java +++ b/core/java/android/service/carrier/CarrierMessagingService.java @@ -80,6 +80,11 @@ public abstract class CarrierMessagingService extends Service { */ public static final int DOWNLOAD_STATUS_ERROR = 2; + /** + * Flag to request SMS delivery status report. + */ + public static final int SEND_FLAG_REQUEST_DELIVERY_STATUS = 1; + private final ICarrierMessagingWrapper mWrapper = new ICarrierMessagingWrapper(); /** @@ -103,12 +108,14 @@ public abstract class CarrierMessagingService extends Service { /** * Override this method to intercept text SMSs sent from the device. + * @deprecated Override {@link #onSendTextSms} below instead. * * @param text the text to send * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message * @param callback result callback. Call with a {@link SendSmsResult}. */ + @Deprecated public void onSendTextSms( @NonNull String text, int subId, @NonNull String destAddress, @NonNull ResultCallback callback) { @@ -119,6 +126,44 @@ public abstract class CarrierMessagingService extends Service { } } + /** + * Override this method to intercept text SMSs sent from the device. + * + * @param text the text to send + * @param subId SMS subscription ID of the SIM + * @param destAddress phone number of the recipient of the message + * @param sendSmsFlag Flag for sending SMS. Acceptable values are 0 and + * {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. + * @param callback result callback. Call with a {@link SendSmsResult}. + */ + public void onSendTextSms( + @NonNull String text, int subId, @NonNull String destAddress, + int sendSmsFlag, @NonNull ResultCallback callback) { + // optional + onSendTextSms(text, subId, destAddress, callback); + } + + /** + * Override this method to intercept binary SMSs sent from the device. + * @deprecated Override {@link #onSendDataSms} below instead. + * + * @param data the binary content + * @param subId SMS subscription ID of the SIM + * @param destAddress phone number of the recipient of the message + * @param destPort the destination port + * @param callback result callback. Call with a {@link SendSmsResult}. + */ + @Deprecated + public void onSendDataSms(@NonNull byte[] data, int subId, + @NonNull String destAddress, int destPort, + @NonNull ResultCallback callback) { + // optional + try { + callback.onReceiveResult(new SendSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, 0)); + } catch (RemoteException ex) { + } + } + /** * Override this method to intercept binary SMSs sent from the device. * @@ -126,14 +171,34 @@ public abstract class CarrierMessagingService extends Service { * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message * @param destPort the destination port + * @param sendSmsFlag Flag for sending SMS. Acceptable values are 0 and + * {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. * @param callback result callback. Call with a {@link SendSmsResult}. */ public void onSendDataSms(@NonNull byte[] data, int subId, - @NonNull String destAddress, int destPort, + @NonNull String destAddress, int destPort, int sendSmsFlag, @NonNull ResultCallback callback) { // optional + onSendDataSms(data, subId, destAddress, destPort, callback); + } + + /** + * Override this method to intercept long SMSs sent from the device. + * @deprecated Override {@link #onSendMultipartTextSms} below instead. + * + * @param parts a {@link List} of the message parts + * @param subId SMS subscription ID of the SIM + * @param destAddress phone number of the recipient of the message + * @param callback result callback. Call with a {@link SendMultipartSmsResult}. + */ + @Deprecated + public void onSendMultipartTextSms(@NonNull List parts, + int subId, @NonNull String destAddress, + @NonNull ResultCallback callback) { + // optional try { - callback.onReceiveResult(new SendSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, 0)); + callback.onReceiveResult( + new SendMultipartSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null)); } catch (RemoteException ex) { } } @@ -144,17 +209,15 @@ public abstract class CarrierMessagingService extends Service { * @param parts a {@link List} of the message parts * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message + * @param sendSmsFlag Flag for sending SMS. Acceptable values are 0 and + * {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. * @param callback result callback. Call with a {@link SendMultipartSmsResult}. */ public void onSendMultipartTextSms(@NonNull List parts, - int subId, @NonNull String destAddress, + int subId, @NonNull String destAddress, int sendSmsFlag, @NonNull ResultCallback callback) { // optional - try { - callback.onReceiveResult( - new SendMultipartSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null)); - } catch (RemoteException ex) { - } + onSendMultipartTextSms(parts, subId, destAddress, callback); } /** @@ -355,8 +418,9 @@ public abstract class CarrierMessagingService extends Service { @Override public void sendTextSms(String text, int subId, String destAddress, - final ICarrierMessagingCallback callback) { - onSendTextSms(text, subId, destAddress, new ResultCallback() { + int sendSmsFlag, final ICarrierMessagingCallback callback) { + onSendTextSms(text, subId, destAddress, sendSmsFlag, + new ResultCallback() { @Override public void onReceiveResult(final SendSmsResult result) throws RemoteException { callback.onSendSmsComplete(result.getSendStatus(), result.getMessageRef()); @@ -366,8 +430,9 @@ public abstract class CarrierMessagingService extends Service { @Override public void sendDataSms(byte[] data, int subId, String destAddress, int destPort, - final ICarrierMessagingCallback callback) { - onSendDataSms(data, subId, destAddress, destPort, new ResultCallback() { + int sendSmsFlag, final ICarrierMessagingCallback callback) { + onSendDataSms(data, subId, destAddress, destPort, sendSmsFlag, + new ResultCallback() { @Override public void onReceiveResult(final SendSmsResult result) throws RemoteException { callback.onSendSmsComplete(result.getSendStatus(), result.getMessageRef()); @@ -377,8 +442,8 @@ public abstract class CarrierMessagingService extends Service { @Override public void sendMultipartTextSms(List parts, int subId, String destAddress, - final ICarrierMessagingCallback callback) { - onSendMultipartTextSms(parts, subId, destAddress, + int sendSmsFlag, final ICarrierMessagingCallback callback) { + onSendMultipartTextSms(parts, subId, destAddress, sendSmsFlag, new ResultCallback() { @Override public void onReceiveResult(final SendMultipartSmsResult result) diff --git a/core/java/android/service/carrier/ICarrierMessagingService.aidl b/core/java/android/service/carrier/ICarrierMessagingService.aidl index 40a9047da4428..2d96c3da64876 100644 --- a/core/java/android/service/carrier/ICarrierMessagingService.aidl +++ b/core/java/android/service/carrier/ICarrierMessagingService.aidl @@ -48,9 +48,10 @@ oneway interface ICarrierMessagingService { * @param text the text to send * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message + * @param sendSmsFlag flag for sending SMS * @param callback the callback to notify upon completion */ - void sendTextSms(String text, int subId, String destAddress, + void sendTextSms(String text, int subId, String destAddress, int sendSmsFlag, in ICarrierMessagingCallback callback); /** @@ -62,10 +63,11 @@ oneway interface ICarrierMessagingService { * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message * @param destPort port number of the recipient of the message + * @param sendSmsFlag flag for sending SMS * @param callback the callback to notify upon completion */ void sendDataSms(in byte[] data, int subId, String destAddress, int destPort, - in ICarrierMessagingCallback callback); + int sendSmsFlag, in ICarrierMessagingCallback callback); /** * Request sending a new multi-part text SMS from the device. @@ -75,10 +77,11 @@ oneway interface ICarrierMessagingService { * @param parts the parts of the multi-part text SMS to send * @param subId SMS subscription ID of the SIM * @param destAddress phone number of the recipient of the message + * @param sendSmsFlag flag for sending SMS * @param callback the callback to notify upon completion */ void sendMultipartTextSms(in List parts, int subId, String destAddress, - in ICarrierMessagingCallback callback); + int sendSmsFlag, in ICarrierMessagingCallback callback); /** * Request sending a new MMS PDU from the device. diff --git a/services/core/java/com/android/server/net/DelayedDiskWrite.java b/services/core/java/com/android/server/net/DelayedDiskWrite.java index 6ed277de1efdf..8f09eb7c19ab6 100644 --- a/services/core/java/com/android/server/net/DelayedDiskWrite.java +++ b/services/core/java/com/android/server/net/DelayedDiskWrite.java @@ -38,6 +38,10 @@ public class DelayedDiskWrite { } public void write(final String filePath, final Writer w) { + write(filePath, w, true); + } + + public void write(final String filePath, final Writer w, final boolean open) { if (TextUtils.isEmpty(filePath)) { throw new IllegalArgumentException("empty file path"); } @@ -54,16 +58,18 @@ public class DelayedDiskWrite { mDiskWriteHandler.post(new Runnable() { @Override public void run() { - doWrite(filePath, w); + doWrite(filePath, w, open); } }); } - private void doWrite(String filePath, Writer w) { + private void doWrite(String filePath, Writer w, boolean open) { DataOutputStream out = null; try { - out = new DataOutputStream(new BufferedOutputStream( + if (open) { + out = new DataOutputStream(new BufferedOutputStream( new FileOutputStream(filePath))); + } w.onWriteCalled(out); } catch (IOException e) { loge("Error writing data file " + filePath); diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index cd10050935b10..3060f40602adf 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -339,6 +339,7 @@ public abstract class Connection implements Conferenceable { public void onConferenceParticipantsChanged(Connection c, List participants) {} public void onConferenceStarted() {} + public void onConferenceMergeFailed(Connection c) {} } public static abstract class VideoProvider { @@ -1543,6 +1544,17 @@ public abstract class Connection implements Conferenceable { mConferenceables.clear(); } + /** + * Notifies listeners that the merge request failed. + * + * @hide + */ + protected final void notifyConferenceMergeFailed() { + for (Listener l : mListeners) { + l.onConferenceMergeFailed(this); + } + } + /** * Notifies listeners of a change to conference participant(s). * diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index c039acfb52fa2..41856515f4347 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -562,6 +562,14 @@ public abstract class ConnectionService extends Service { mAdapter.setIsConferenced(id, conferenceId); } } + + @Override + public void onConferenceMergeFailed(Connection connection) { + String id = mIdByConnection.get(connection); + if (id != null) { + mAdapter.onConferenceMergeFailed(id); + } + } }; /** {@inheritDoc} */ diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index d026a28f1742b..a87dbe725d632 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -202,6 +202,21 @@ final class ConnectionServiceAdapter implements DeathRecipient { } } + /** + * Indicates that the merge request on this call has failed. + * + * @param callId The unique ID of the call being conferenced. + */ + void onConferenceMergeFailed(String callId) { + for (IConnectionServiceAdapter adapter : mAdapters) { + try { + Log.d(this, "merge failed for call %s", callId); + adapter.setConferenceMergeFailed(callId); + } catch (RemoteException ignored) { + } + } + } + /** * Indicates that the call no longer exists. Can be used with either a call or a conference * call. diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index 429f296e34d77..db815ba7a86f7 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -59,6 +59,7 @@ final class ConnectionServiceAdapterServant { private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; private static final int MSG_ADD_EXISTING_CONNECTION = 21; private static final int MSG_ON_POST_DIAL_CHAR = 22; + private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23; private final IConnectionServiceAdapter mDelegate; @@ -220,6 +221,15 @@ final class ConnectionServiceAdapterServant { } break; } + case MSG_SET_CONFERENCE_MERGE_FAILED: { + SomeArgs args = (SomeArgs) msg.obj; + try { + mDelegate.setConferenceMergeFailed((String) args.arg1); + } finally { + args.recycle(); + } + break; + } } } }; @@ -279,6 +289,13 @@ final class ConnectionServiceAdapterServant { .sendToTarget(); } + @Override + public void setConferenceMergeFailed(String callId) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget(); + } + @Override public void setIsConferenced(String callId, String conferenceCallId) { SomeArgs args = SomeArgs.obtain(); diff --git a/telecomm/java/android/telecom/ParcelableConference.java b/telecomm/java/android/telecom/ParcelableConference.java index e54e79de6056a..3d0c558c2010d 100644 --- a/telecomm/java/android/telecom/ParcelableConference.java +++ b/telecomm/java/android/telecom/ParcelableConference.java @@ -121,11 +121,10 @@ public final class ParcelableConference implements Parcelable { List connectionIds = new ArrayList<>(2); source.readList(connectionIds, classLoader); long connectTimeMillis = source.readLong(); - StatusHints statusHints = source.readParcelable(classLoader); - IVideoProvider videoCallProvider = IVideoProvider.Stub.asInterface(source.readStrongBinder()); int videoState = source.readInt(); + StatusHints statusHints = source.readParcelable(classLoader); return new ParcelableConference(phoneAccount, state, capabilities, connectionIds, videoCallProvider, videoState, connectTimeMillis, statusHints); diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index a9b725be133f7..0208744e2bda8 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -175,6 +175,13 @@ final class RemoteConnectionService { } } + @Override + public void setConferenceMergeFailed(String callId) { + // Nothing to do here. + // The event has already been handled and there is no state to update + // in the underlying connection or conference objects + } + @Override public void addConferenceCall( final String callId, diff --git a/telecomm/java/android/telecom/VideoProfile.java b/telecomm/java/android/telecom/VideoProfile.java index 2fd438a29fd08..902fddb22a6c8 100644 --- a/telecomm/java/android/telecom/VideoProfile.java +++ b/telecomm/java/android/telecom/VideoProfile.java @@ -144,6 +144,17 @@ public class VideoProfile implements Parcelable { dest.writeInt(mQuality); } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("[VideoProfile videoState = "); + sb.append(VideoState.videoStateToString(mVideoState)); + sb.append(" videoQuality = "); + sb.append(mQuality); + sb.append("]"); + return sb.toString(); + } + /** * The video state of the call, stored as a bit-field describing whether video transmission and * receipt it enabled, as well as whether the video is currently muted. @@ -241,5 +252,30 @@ public class VideoProfile implements Parcelable { private static boolean hasState(int videoState, int state) { return (videoState & state) == state; } + + /** + * Generates a string representation of a {@link VideoState}. + * + * @param videoState The video state. + * @return String representation of the {@link VideoState}. + */ + public static String videoStateToString(int videoState) { + StringBuilder sb = new StringBuilder(); + sb.append("Audio"); + + if (VideoProfile.VideoState.isTransmissionEnabled(videoState)) { + sb.append(" Tx"); + } + + if (VideoProfile.VideoState.isReceptionEnabled(videoState)) { + sb.append(" Rx"); + } + + if (VideoProfile.VideoState.isPaused(videoState)) { + sb.append(" Pause"); + } + + return sb.toString(); + } } } diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl index 7e7e9cc4a904d..67e2edbddd01a 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl @@ -56,6 +56,8 @@ oneway interface IConnectionServiceAdapter { void setIsConferenced(String callId, String conferenceCallId); + void setConferenceMergeFailed(String callId); + void addConferenceCall(String callId, in ParcelableConference conference); void removeCall(String callId); diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index e4c003a40cf4e..33e52bf12539e 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -1129,5 +1129,19 @@ public class SubscriptionManager { logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId); return simState; } + + /** + * @return true if the sub ID is active. i.e. The sub ID corresponds to a known subscription + * and the SIM providing the subscription is present in a slot and in "LOADED" state. + * @hide + */ + public boolean isActiveSubId(int subId) { + try { + ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); + return iSub.isActiveSubId(subId); + } catch (RemoteException ex) { + } + return false; + } } diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 24bdb7a8e62c6..21c94c2608ad1 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -35,13 +35,6 @@ import com.android.internal.telephony.SmsRawData; */ interface ISms { - /** - * Retrieves all messages currently stored on ICC. - * - * @return list of SmsRawData of all sms on ICC - */ - List getAllMessagesFromIccEf(String callingPkg); - /** * Retrieves all messages currently stored on ICC. * @param subId the subId id. @@ -49,20 +42,6 @@ interface ISms { */ List getAllMessagesFromIccEfForSubscriber(in int subId, String callingPkg); - /** - * Update the specified message on the ICC. - * - * @param messageIndex record index of message to update - * @param newStatus new message status (STATUS_ON_ICC_READ, - * STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, - * STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE) - * @param pdu the raw PDU to store - * @return success or not - * - */ - boolean updateMessageOnIccEf(String callingPkg, int messageIndex, int newStatus, - in byte[] pdu); - /** * Update the specified message on the ICC. * @@ -78,17 +57,6 @@ interface ISms { boolean updateMessageOnIccEfForSubscriber(in int subId, String callingPkg, int messageIndex, int newStatus, in byte[] pdu); - /** - * Copy a raw SMS PDU to the ICC. - * - * @param pdu the raw PDU to store - * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, - * STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT) - * @return success or not - * - */ - boolean copyMessageToIccEf(String callingPkg, int status, in byte[] pdu, in byte[] smsc); - /** * Copy a raw SMS PDU to the ICC. * @@ -102,32 +70,6 @@ interface ISms { boolean copyMessageToIccEfForSubscriber(in int subId, String callingPkg, int status, in byte[] pdu, in byte[] smsc); - /** - * Send a data SMS. - * - * @param smsc the SMSC to send the message through, or NULL for the - * default SMSC - * @param data the body of the message to send - * @param sentIntent if not NULL this PendingIntent is - * broadcast when the message is sucessfully sent, or failed. - * The result code will be Activity.RESULT_OK for success, - * or one of these errors:
- * RESULT_ERROR_GENERIC_FAILURE
- * RESULT_ERROR_RADIO_OFF
- * RESULT_ERROR_NULL_PDU
- * For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include - * the extra "errorCode" containing a radio technology specific value, - * generally only useful for troubleshooting.
- * The per-application based SMS control checks sentIntent. If sentIntent - * is NULL the caller will be checked against all unknown applicaitons, - * which cause smaller number of SMS to be sent in checking period. - * @param deliveryIntent if not NULL this PendingIntent is - * broadcast when the message is delivered to the recipient. The - * raw pdu of the status report is in the extended data ("pdu"). - */ - void sendData(String callingPkg, in String destAddr, in String scAddr, in int destPort, - in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent); - /** * Send a data SMS. * @@ -184,32 +126,6 @@ interface ISms { in String scAddr, in int destPort, in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent); - /** - * Send an SMS. - * - * @param smsc the SMSC to send the message through, or NULL for the - * default SMSC - * @param text the body of the message to send - * @param sentIntent if not NULL this PendingIntent is - * broadcast when the message is sucessfully sent, or failed. - * The result code will be Activity.RESULT_OK for success, - * or one of these errors:
- * RESULT_ERROR_GENERIC_FAILURE
- * RESULT_ERROR_RADIO_OFF
- * RESULT_ERROR_NULL_PDU
- * For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include - * the extra "errorCode" containing a radio technology specific value, - * generally only useful for troubleshooting.
- * The per-application based SMS control checks sentIntent. If sentIntent - * is NULL the caller will be checked against all unknown applications, - * which cause smaller number of SMS to be sent in checking period. - * @param deliveryIntent if not NULL this PendingIntent is - * broadcast when the message is delivered to the recipient. The - * raw pdu of the status report is in the extended data ("pdu"). - */ - void sendText(String callingPkg, in String destAddr, in String scAddr, in String text, - in PendingIntent sentIntent, in PendingIntent deliveryIntent); - /** * Send an SMS. * @@ -269,6 +185,7 @@ interface ISms { /** * Inject an SMS PDU into the android platform. * + * @param subId the subId on which the SMS has to be injected. * @param pdu is the byte array of pdu to be injected into android application framework * @param format is the format of SMS pdu (android.telephony.SmsMessage.FORMAT_3GPP or * android.telephony.SmsMessage.FORMAT_3GPP2) @@ -277,33 +194,8 @@ interface ISms { * android application framework. This intent is broadcasted at * the same time an SMS received from radio is acknowledged back. */ - void injectSmsPdu(in byte[] pdu, String format, in PendingIntent receivedIntent); - - /** - * Send a multi-part text based SMS. - * - * @param destinationAddress the address to send the message to - * @param scAddress is the service center address or null to use - * the current default SMSC - * @param parts an ArrayList of strings that, in order, - * comprise the original message - * @param sentIntents if not null, an ArrayList of - * PendingIntents (one for each message part) that is - * broadcast when the corresponding message part has been sent. - * The result code will be Activity.RESULT_OK for success, - * or one of these errors: - * RESULT_ERROR_GENERIC_FAILURE - * RESULT_ERROR_RADIO_OFF - * RESULT_ERROR_NULL_PDU. - * @param deliveryIntents if not null, an ArrayList of - * PendingIntents (one for each message part) that is - * broadcast when the corresponding message part has been delivered - * to the recipient. The raw pdu of the status report is in the - * extended data ("pdu"). - */ - void sendMultipartText(String callingPkg, in String destinationAddress, in String scAddress, - in List parts, in List sentIntents, - in List deliveryIntents); + void injectSmsPduForSubscriber( + int subId, in byte[] pdu, String format, in PendingIntent receivedIntent); /** * Send a multi-part text based SMS. @@ -333,24 +225,6 @@ interface ISms { in List parts, in List sentIntents, in List deliveryIntents); - /** - * Enable reception of cell broadcast (SMS-CB) messages with the given - * message identifier and RAN type. The RAN type specify this message ID - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients - * enable the same message identifier, they must both disable it for the - * device to stop receiving those messages. - * - * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #disableCellBroadcast(int, int) - */ - boolean enableCellBroadcast(int messageIdentifier, int ranType); - /** * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier and RAN type. The RAN type specify this message ID @@ -366,28 +240,10 @@ interface ISms { * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #disableCellBroadcast(int, int) + * @see #disableCellBroadcastForSubscriber(int, int, int) */ boolean enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); - /** - * Disable reception of cell broadcast (SMS-CB) messages with the given - * message identifier and RAN type. The RAN type specify this message ID - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients - * enable the same message identifier, they must both disable it for the - * device to stop receiving those messages. - * - * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #enableCellBroadcast(int, int) - */ - boolean disableCellBroadcast(int messageIdentifier, int ranType); - /** * Disable reception of cell broadcast (SMS-CB) messages with the given * message identifier and RAN type. The RAN type specify this message ID @@ -403,30 +259,10 @@ interface ISms { * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #enableCellBroadcast(int, int) + * @see #enableCellBroadcastForSubscriber(int, int, int) */ boolean disableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); - /* - * Enable reception of cell broadcast (SMS-CB) messages with the given - * message identifier range and RAN type. The RAN type specify this message - * ID range belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different - * clients enable a message identifier range, they must both disable it for - * the device to stop receiving those messages. - * - * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #disableCellBroadcastRange(int, int, int) - */ - boolean enableCellBroadcastRange(int startMessageId, int endMessageId, int ranType); - /* * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier range and RAN type. The RAN type specify this message ID range @@ -444,31 +280,11 @@ interface ISms { * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #disableCellBroadcastRange(int, int, int) + * @see #disableCellBroadcastRangeForSubscriber(int, int, int, int) */ boolean enableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType); - /** - * Disable reception of cell broadcast (SMS-CB) messages with the given - * message identifier range and RAN type. The RAN type specify this message ID range - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable - * a message identifier range, they must both disable it for the device - * to stop receiving those messages. - * - * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #enableCellBroadcastRange(int, int, int) - */ - boolean disableCellBroadcastRange(int startMessageId, int endMessageId, int ranType); - /** * Disable reception of cell broadcast (SMS-CB) messages with the given * message identifier range and RAN type. The RAN type specify this message ID range @@ -486,7 +302,7 @@ interface ISms { * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #enableCellBroadcastRange(int, int, int, int) + * @see #enableCellBroadcastRangeForSubscriber(int, int, int, int) */ boolean disableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType); @@ -515,23 +331,13 @@ interface ISms { */ void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission); - /** - * SMS over IMS is supported if IMS is registered and SMS is supported - * on IMS. - * - * @return true if SMS over IMS is supported, false otherwise - * - * @see #getImsSmsFormat() - */ - boolean isImsSmsSupported(); - /** * SMS over IMS is supported if IMS is registered and SMS is supported * on IMS. * @param subId for subId which isImsSmsSupported is queried * @return true if SMS over IMS is supported, false otherwise * - * @see #getImsSmsFormat() + * @see #getImsSmsFormatForSubscriber(int) */ boolean isImsSmsSupportedForSubscriber(int subId); @@ -549,18 +355,6 @@ interface ISms { */ int getPreferredSmsSubscription(); - /** - * Gets SMS format supported on IMS. SMS over IMS format is - * either 3GPP or 3GPP2. - * - * @return android.telephony.SmsMessage.FORMAT_3GPP, - * android.telephony.SmsMessage.FORMAT_3GPP2 - * or android.telephony.SmsMessage.FORMAT_UNKNOWN - * - * @see #isImsSmsSupported() - */ - String getImsSmsFormat(); - /** * Gets SMS format supported on IMS. SMS over IMS format is * either 3GPP or 3GPP2. @@ -569,7 +363,7 @@ interface ISms { * android.telephony.SmsMessage.FORMAT_3GPP2 * or android.telephony.SmsMessage.FORMAT_UNKNOWN * - * @see #isImsSmsSupported() + * @see #isImsSmsSupportedForSubscriber(int) */ String getImsSmsFormatForSubscriber(int subId); diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 3f8aca059f981..1037f2d54f9e0 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -185,4 +185,5 @@ interface ISub { */ int getSimStateForSubscriber(int subId); + boolean isActiveSubId(int subId); } diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java index d2fb0ddd72952..dde8dba19f902 100644 --- a/wifi/java/android/net/wifi/RttManager.java +++ b/wifi/java/android/net/wifi/RttManager.java @@ -134,6 +134,8 @@ public class RttManager { public static final int REASON_NOT_AVAILABLE = -2; public static final int REASON_INVALID_LISTENER = -3; public static final int REASON_INVALID_REQUEST = -4; + /** Do not have required permission */ + public static final int REASON_PERMISSION_DENIED = -5; public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description"; diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index b7313169b7b4d..a38a96e896132 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -926,7 +926,7 @@ public class WifiConfiguration implements Parcelable { public boolean isValid() { String reason = strIsValid(); if (reason != null) { - Log.e("WFII", "WiFi Config not valid: " + reason); + Log.e(TAG, "WiFi Config not valid: " + reason); return false; } else {