From ec0579cf7282a8ecf6b347da16dbcab8044854b3 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 3 Jun 2015 10:09:59 -0700 Subject: [PATCH 01/14] API Cleanup: Remove VideoState class. - Remove VideoState class. - Replace references to VideoState constants with VideoProfile equivalent. - Push VideoState static methods into VideoProfile. Bug: 21573551 Change-Id: I1bca02772b5b7d86643f612824b07faef7618725 --- api/current.txt | 16 +- api/system-current.txt | 16 +- telecomm/java/android/telecom/Conference.java | 2 +- telecomm/java/android/telecom/Connection.java | 2 +- .../android/telecom/ConnectionRequest.java | 2 +- .../telecom/ConnectionServiceAdapter.java | 8 +- .../android/telecom/RemoteConnection.java | 2 +- .../java/android/telecom/VideoProfile.java | 218 ++++++++---------- .../java/com/android/ims/ImsCallProfile.java | 24 +- 9 files changed, 125 insertions(+), 165 deletions(-) diff --git a/api/current.txt b/api/current.txt index ec70ee384e7f7..a5332f680eaef 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28918,6 +28918,13 @@ package android.telecom { method public int describeContents(); method public int getQuality(); method public int getVideoState(); + method public static boolean isAudioOnly(int); + method public static boolean isBidirectional(int); + method public static boolean isPaused(int); + method public static boolean isReceptionEnabled(int); + method public static boolean isTransmissionEnabled(int); + method public static boolean isVideo(int); + method public static java.lang.String videoStateToString(int); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int QUALITY_DEFAULT = 4; // 0x4 @@ -28940,15 +28947,6 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public static class VideoProfile.VideoState { - method public static boolean isAudioOnly(int); - method public static boolean isBidirectional(int); - 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); - } - } package android.telephony { diff --git a/api/system-current.txt b/api/system-current.txt index 731f3bf278c4c..49fb1572b3fb0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30809,6 +30809,13 @@ package android.telecom { method public int describeContents(); method public int getQuality(); method public int getVideoState(); + method public static boolean isAudioOnly(int); + method public static boolean isBidirectional(int); + method public static boolean isPaused(int); + method public static boolean isReceptionEnabled(int); + method public static boolean isTransmissionEnabled(int); + method public static boolean isVideo(int); + method public static java.lang.String videoStateToString(int); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int QUALITY_DEFAULT = 4; // 0x4 @@ -30831,15 +30838,6 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public static class VideoProfile.VideoState { - method public static boolean isAudioOnly(int); - method public static boolean isBidirectional(int); - 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); - } - } package android.telephony { diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 182ac121e245a..7cd384fa06ae8 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -201,7 +201,7 @@ public abstract class Conference extends Conferenceable { * Returns video state of the primary call. */ public int getVideoState() { - return VideoProfile.VideoState.AUDIO_ONLY; + return VideoProfile.STATE_AUDIO_ONLY; } /** diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 69a8fabbc5fae..14689d40b103c 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -1604,7 +1604,7 @@ public abstract class Connection extends Conferenceable { * a request to accept. */ public void onAnswer() { - onAnswer(VideoProfile.VideoState.AUDIO_ONLY); + onAnswer(VideoProfile.STATE_AUDIO_ONLY); } /** diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java index 975df5d40aa6a..686321476bd18 100644 --- a/telecomm/java/android/telecom/ConnectionRequest.java +++ b/telecomm/java/android/telecom/ConnectionRequest.java @@ -42,7 +42,7 @@ public final class ConnectionRequest implements Parcelable { PhoneAccountHandle accountHandle, Uri handle, Bundle extras) { - this(accountHandle, handle, extras, VideoProfile.VideoState.AUDIO_ONLY); + this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY); } /** diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index a87dbe725d632..60a573d0385d9 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -341,10 +341,10 @@ final class ConnectionServiceAdapter implements DeathRecipient { /** * Sets the video state associated with a call. * - * Valid values: {@link VideoProfile.VideoState#AUDIO_ONLY}, - * {@link VideoProfile.VideoState#BIDIRECTIONAL}, - * {@link VideoProfile.VideoState#TX_ENABLED}, - * {@link VideoProfile.VideoState#RX_ENABLED}. + * Valid values: {@link VideoProfile#STATE_BIDIRECTIONAL}, + * {@link VideoProfile#STATE_AUDIO_ONLY}, + * {@link VideoProfile#STATE_TX_ENABLED}, + * {@link VideoProfile#STATE_RX_ENABLED}. * * @param callId The unique ID of the call to set the video state for. * @param videoState The video state. diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java index 1a8e3cf72ae0d..3734a74efa2b0 100644 --- a/telecomm/java/android/telecom/RemoteConnection.java +++ b/telecomm/java/android/telecom/RemoteConnection.java @@ -594,7 +594,7 @@ public final class RemoteConnection { /** * Obtains the video state of this {@code RemoteConnection}. * - * @return The video state of the {@code RemoteConnection}. See {@link VideoProfile.VideoState}. + * @return The video state of the {@code RemoteConnection}. See {@link VideoProfile}. */ public int getVideoState() { return mVideoState; diff --git a/telecomm/java/android/telecom/VideoProfile.java b/telecomm/java/android/telecom/VideoProfile.java index 71de505879d49..11a4976782553 100644 --- a/telecomm/java/android/telecom/VideoProfile.java +++ b/telecomm/java/android/telecom/VideoProfile.java @@ -173,7 +173,7 @@ public class VideoProfile implements Parcelable { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("[VideoProfile videoState = "); - sb.append(VideoState.videoStateToString(mVideoState)); + sb.append(videoStateToString(mVideoState)); sb.append(" videoQuality = "); sb.append(mQuality); sb.append("]"); @@ -181,142 +181,106 @@ public class VideoProfile implements Parcelable { } /** - * 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. - */ - public static class VideoState { - /** - * Call is currently in an audio-only mode with no video transmission or receipt. - * @deprecated Use {@link VideoProfile#STATE_AUDIO_ONLY} instead - * @hide - */ - public static final int AUDIO_ONLY = VideoProfile.STATE_AUDIO_ONLY; + * Generates a string representation of a video state. + * + * @param videoState The video state. + * @return String representation of the video state. + */ + public static String videoStateToString(int videoState) { + StringBuilder sb = new StringBuilder(); + sb.append("Audio"); - /** - * Video transmission is enabled. - * @deprecated Use {@link VideoProfile#STATE_TX_ENABLED} instead - * @hide - */ - public static final int TX_ENABLED = VideoProfile.STATE_TX_ENABLED; - - /** - * Video reception is enabled. - * @deprecated Use {@link VideoProfile#STATE_RX_ENABLED} instead - * @hide - */ - public static final int RX_ENABLED = VideoProfile.STATE_RX_ENABLED; - - /** - * Video signal is bi-directional. - * @deprecated Use {@link VideoProfile#STATE_BIDIRECTIONAL} instead - * @hide - */ - public static final int BIDIRECTIONAL = VideoProfile.STATE_BIDIRECTIONAL; - - /** - * Video is paused. - * @deprecated Use {@link VideoProfile#STATE_PAUSED} instead - * @hide - */ - public static final int PAUSED = VideoProfile.STATE_PAUSED; - - /** @hide */ - private VideoState() {} - - /** - * Whether the video state is audio only. - * @param videoState The video state. - * @return Returns true if the video state is audio only. - */ - public static boolean isAudioOnly(int videoState) { - return !hasState(videoState, VideoProfile.STATE_TX_ENABLED) - && !hasState(videoState, VideoProfile.STATE_RX_ENABLED); - } - - /** - * Whether the video state is any of the video type - * @param videoState The video state. - * @hide - * @return Returns true if the video state TX or RX or Bidirectional - */ - public static boolean isVideo(int videoState) { - return hasState(videoState, VideoProfile.STATE_TX_ENABLED) - || hasState(videoState, VideoProfile.STATE_RX_ENABLED) - || hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); - } - - /** - * Whether the video transmission is enabled. - * @param videoState The video state. - * @return Returns true if the video transmission is enabled. - */ - public static boolean isTransmissionEnabled(int videoState) { - return hasState(videoState, VideoProfile.STATE_TX_ENABLED); - } - - /** - * Whether the video reception is enabled. - * @param videoState The video state. - * @return Returns true if the video transmission is enabled. - */ - public static boolean isReceptionEnabled(int videoState) { - return hasState(videoState, VideoProfile.STATE_RX_ENABLED); - } - - /** - * Whether the video signal is bi-directional. - * @param videoState - * @return Returns true if the video signal is bi-directional. - */ - public static boolean isBidirectional(int videoState) { - return hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); - } - - /** - * Whether the video is paused. - * @param videoState The video state. - * @return Returns true if the video is paused. - */ - public static boolean isPaused(int videoState) { - return hasState(videoState, VideoProfile.STATE_PAUSED); - } - - /** - * Determines if a specified state is set in a videoState bit-mask. - * - * @param videoState The video state bit-mask. - * @param state The state to check. - * @return {@code True} if the state is set. - * {@hide} - */ - 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)) { + if (isAudioOnly(videoState)) { + sb.append(" Only"); + } else { + if (isTransmissionEnabled(videoState)) { sb.append(" Tx"); } - if (VideoProfile.VideoState.isReceptionEnabled(videoState)) { + if (isReceptionEnabled(videoState)) { sb.append(" Rx"); } - if (VideoProfile.VideoState.isPaused(videoState)) { + if (isPaused(videoState)) { sb.append(" Pause"); } - - return sb.toString(); } + + return sb.toString(); + } + + /** + * Indicates whether the video state is audio only. + * + * @param videoState The video state. + * @return {@code True} if the video state is audio only, {@code false} otherwise. + */ + public static boolean isAudioOnly(int videoState) { + return !hasState(videoState, VideoProfile.STATE_TX_ENABLED) + && !hasState(videoState, VideoProfile.STATE_RX_ENABLED); + } + + /** + * Indicates whether video transmission or reception is enabled for a video state. + * + * @param videoState The video state. + * @return {@code True} if video transmission or reception is enabled, {@code false} otherwise. + */ + public static boolean isVideo(int videoState) { + return hasState(videoState, VideoProfile.STATE_TX_ENABLED) + || hasState(videoState, VideoProfile.STATE_RX_ENABLED) + || hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); + } + + /** + * Indicates whether the video state has video transmission enabled. + * + * @param videoState The video state. + * @return {@code True} if video transmission is enabled, {@code false} otherwise. + */ + public static boolean isTransmissionEnabled(int videoState) { + return hasState(videoState, VideoProfile.STATE_TX_ENABLED); + } + + /** + * Indicates whether the video state has video reception enabled. + * + * @param videoState The video state. + * @return {@code True} if video reception is enabled, {@code false} otherwise. + */ + public static boolean isReceptionEnabled(int videoState) { + return hasState(videoState, VideoProfile.STATE_RX_ENABLED); + } + + /** + * Indicates whether the video state is bi-directional. + * + * @param videoState The video state. + * @return {@code True} if the video is bi-directional, {@code false} otherwise. + */ + public static boolean isBidirectional(int videoState) { + return hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); + } + + /** + * Indicates whether the video state is paused. + * + * @param videoState The video state. + * @return {@code True} if the video is paused, {@code false} otherwise. + */ + public static boolean isPaused(int videoState) { + return hasState(videoState, VideoProfile.STATE_PAUSED); + } + + /** + * Indicates if a specified state is set in a videoState bit-mask. + * + * @param videoState The video state bit-mask. + * @param state The state to check. + * @return {@code True} if the state is set. + */ + private static boolean hasState(int videoState, int state) { + return (videoState & state) == state; } /** diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 604d32d4e82b5..1c69794a3d5fc 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -313,28 +313,28 @@ public class ImsCallProfile implements Parcelable { * @return The video state. */ public static int getVideoStateFromImsCallProfile(ImsCallProfile callProfile) { - int videostate = VideoProfile.VideoState.AUDIO_ONLY; + int videostate = VideoProfile.STATE_AUDIO_ONLY; switch (callProfile.mCallType) { case CALL_TYPE_VT_TX: - videostate = VideoProfile.VideoState.TX_ENABLED; + videostate = VideoProfile.STATE_TX_ENABLED; break; case CALL_TYPE_VT_RX: - videostate = VideoProfile.VideoState.RX_ENABLED; + videostate = VideoProfile.STATE_RX_ENABLED; break; case CALL_TYPE_VT: - videostate = VideoProfile.VideoState.BIDIRECTIONAL; + videostate = VideoProfile.STATE_BIDIRECTIONAL; break; case CALL_TYPE_VOICE: - videostate = VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.STATE_AUDIO_ONLY; break; default: - videostate = VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.STATE_AUDIO_ONLY; break; } - if (callProfile.isVideoPaused() && videostate != VideoProfile.VideoState.AUDIO_ONLY) { - videostate |= VideoProfile.VideoState.PAUSED; + if (callProfile.isVideoPaused() && videostate != VideoProfile.STATE_AUDIO_ONLY) { + videostate |= VideoProfile.STATE_PAUSED; } else { - videostate &= ~VideoProfile.VideoState.PAUSED; + videostate &= ~VideoProfile.STATE_PAUSED; } return videostate; } @@ -347,9 +347,9 @@ public class ImsCallProfile implements Parcelable { * @return The call type. */ public static int getCallTypeFromVideoState(int videoState) { - boolean videoTx = isVideoStateSet(videoState, VideoProfile.VideoState.TX_ENABLED); - boolean videoRx = isVideoStateSet(videoState, VideoProfile.VideoState.RX_ENABLED); - boolean isPaused = isVideoStateSet(videoState, VideoProfile.VideoState.PAUSED); + boolean videoTx = isVideoStateSet(videoState, VideoProfile.STATE_TX_ENABLED); + boolean videoRx = isVideoStateSet(videoState, VideoProfile.STATE_RX_ENABLED); + boolean isPaused = isVideoStateSet(videoState, VideoProfile.STATE_PAUSED); if (isPaused) { return ImsCallProfile.CALL_TYPE_VT_NODIR; } else if (videoTx && !videoRx) { From cac6b8f5ae3e6e329f4d8a66548fc9a4e0a402f6 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Thu, 28 May 2015 15:53:20 -0700 Subject: [PATCH 02/14] Rename VoLTE/WFC enable API to available - add VT available API. [DO NOT MERGE] Renamed API to use consistent semantics: available refers to the current state of the service rather then whether feature is enabled by device/carrier/ user. Added VT API to match VoLTE/WFC. Change-Id: Ifb31f123db77e731e75a982b8594168f59a289e7 --- .../android/telephony/TelephonyManager.java | 38 +++++++++++++------ .../internal/telephony/ITelephony.aidl | 14 +++++-- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 276f586cd9fa5..b95ed638b4e26 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3786,13 +3786,13 @@ public class TelephonyManager { } } - /** - * Returns the Status of Volte - *@hide - */ - public boolean isVolteEnabled() { + /** + * Returns the Status of Volte + * @hide + */ + public boolean isVolteAvailable() { try { - return getITelephony().isVolteEnabled(); + return getITelephony().isVolteAvailable(); } catch (RemoteException ex) { return false; } catch (NullPointerException ex) { @@ -3800,13 +3800,27 @@ public class TelephonyManager { } } - /** - * Returns the Status of Wi-Fi Calling - *@hide - */ - public boolean isWifiCallingEnabled() { + /** + * Returns the Status of video telephony (VT) + * @hide + */ + public boolean isVideoTelephonyAvailable() { + try { + return getITelephony().isVideoTelephonyAvailable(); + } catch (RemoteException ex) { + return false; + } catch (NullPointerException ex) { + return false; + } + } + + /** + * Returns the Status of Wi-Fi Calling + * @hide + */ + public boolean isWifiCallingAvailable() { try { - return getITelephony().isWifiCallingEnabled(); + return getITelephony().isWifiCallingAvailable(); } catch (RemoteException ex) { return false; } catch (NullPointerException ex) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index d03fa3aa51f2a..fae64738a98e7 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -876,13 +876,19 @@ interface ITelephony { * Returns the Status of Wi-Fi Calling *@hide */ - boolean isWifiCallingEnabled(); - - /** + boolean isWifiCallingAvailable(); + + /** * Returns the Status of Volte *@hide */ - boolean isVolteEnabled(); + boolean isVolteAvailable(); + + /** + * Returns the Status of VT (video telephony) + *@hide + */ + boolean isVideoTelephonyAvailable(); /** * Returns the unique device ID of phone, for example, the IMEI for From 405aaafb9520da4d33b1cae2f05d2ce9118f146d Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 1 Jun 2015 17:12:14 -0700 Subject: [PATCH 03/14] Change to hide BEARER_BITMASK. BEARER_BITMASK uses ServiceState constants that are not public so keeping it hidden for now. Ideally it should use TelephonyManager constants instead as they are already public. However the constant values for same RATs are different between the two. So mapping from one to the other is as apns xml files will also need to be updated (including those of OEMs). Bug: 21342148 Change-Id: Iced28ede187d3e72b3f969bc99af4edf34d86a36 --- api/current.txt | 3 +-- api/system-current.txt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/current.txt b/api/current.txt index a5332f680eaef..0b742e906b2e8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -25724,8 +25724,7 @@ package android.provider { public static final class Telephony.Carriers implements android.provider.BaseColumns { field public static final java.lang.String APN = "apn"; field public static final java.lang.String AUTH_TYPE = "authtype"; - field public static final deprecated java.lang.String BEARER = "bearer"; - field public static final java.lang.String BEARER_BITMASK = "bearer_bitmask"; + field public static final java.lang.String BEARER = "bearer"; field public static final java.lang.String CARRIER_ENABLED = "carrier_enabled"; field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String CURRENT = "current"; diff --git a/api/system-current.txt b/api/system-current.txt index 49fb1572b3fb0..a33c8ba698679 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -27421,8 +27421,7 @@ package android.provider { public static final class Telephony.Carriers implements android.provider.BaseColumns { field public static final java.lang.String APN = "apn"; field public static final java.lang.String AUTH_TYPE = "authtype"; - field public static final deprecated java.lang.String BEARER = "bearer"; - field public static final java.lang.String BEARER_BITMASK = "bearer_bitmask"; + field public static final java.lang.String BEARER = "bearer"; field public static final java.lang.String CARRIER_ENABLED = "carrier_enabled"; field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String CURRENT = "current"; From f675a6e02be143e49e0b0a80915c247ead7f46c5 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Wed, 27 May 2015 11:59:46 -0700 Subject: [PATCH 04/14] Changing getSimState to use slot idx instead of sub id. Bug: 20736251 Change-Id: I43ec6450358f833f878ed4eee993ea79d5220c65 --- .../telephony/SubscriptionManager.java | 10 +++---- .../android/telephony/TelephonyManager.java | 27 ++++++++++++++----- .../com/android/internal/telephony/ISub.aidl | 4 +-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 88ca8a4378413..71194359967b7 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -1105,9 +1105,9 @@ public class SubscriptionManager { } /** - * Returns a constant indicating the state of sim for the subscription. + * Returns a constant indicating the state of sim for the slot idx. * - * @param subId + * @param slotIdx * * {@See TelephonyManager#SIM_STATE_UNKNOWN} * {@See TelephonyManager#SIM_STATE_ABSENT} @@ -1121,16 +1121,16 @@ public class SubscriptionManager { * * {@hide} */ - public static int getSimStateForSubscriber(int subId) { + public static int getSimStateForSlotIdx(int slotIdx) { int simState; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); - simState = iSub.getSimStateForSubscriber(subId); + simState = iSub.getSimStateForSlotIdx(slotIdx); } catch (RemoteException ex) { simState = TelephonyManager.SIM_STATE_UNKNOWN; } - logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId); + logd("getSimStateForSubscriber: simState=" + simState + " slotIdx=" + slotIdx); return simState; } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b95ed638b4e26..fbf2b80b0713f 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1537,7 +1537,25 @@ public class TelephonyManager { * @see #SIM_STATE_CARD_IO_ERROR */ public int getSimState() { - return getSimState(getDefaultSim()); + int slotIdx = getDefaultSim(); + // slotIdx may be invalid due to sim being absent. In that case query all slots to get + // sim state + if (slotIdx < 0) { + // query for all slots and return absent if all sim states are absent, otherwise + // return unknown + for (int i = 0; i < getPhoneCount(); i++) { + int simState = getSimState(i); + if (simState != SIM_STATE_ABSENT) { + Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", sim state for " + + "slotIdx=" + i + " is " + simState + ", return state as unknown"); + return SIM_STATE_UNKNOWN; + } + } + Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", all SIMs absent, return " + + "state as absent"); + return SIM_STATE_ABSENT; + } + return getSimState(slotIdx); } /** @@ -1557,12 +1575,7 @@ public class TelephonyManager { */ /** {@hide} */ public int getSimState(int slotIdx) { - int[] subId = SubscriptionManager.getSubId(slotIdx); - if (subId == null || subId.length == 0) { - Rlog.d(TAG, "getSimState:- empty subId return SIM_STATE_ABSENT"); - return SIM_STATE_UNKNOWN; - } - int simState = SubscriptionManager.getSimStateForSubscriber(subId[0]); + int simState = SubscriptionManager.getSimStateForSlotIdx(slotIdx); return simState; } diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index c12137d6fa3c4..f1f5f1ba292a9 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -166,10 +166,10 @@ interface ISub { int[] getActiveSubIdList(); /** - * Get the SIM state for the subscriber + * Get the SIM state for the slot idx * @return SIM state as the ordinal of IccCardConstants.State */ - int getSimStateForSubscriber(int subId); + int getSimStateForSlotIdx(int slotIdx); boolean isActiveSubId(int subId); } From 4aef69ab52d2cf209790aaf0b1a217d3caaf3ba4 Mon Sep 17 00:00:00 2001 From: Shriram Ganesh Date: Sun, 31 May 2015 09:18:48 -0700 Subject: [PATCH 05/14] MWI,phantom call,Suppl services, error codes 1. IMS MWI Feature - Add new API to update waiting voice message count, for UI propagation based on RFC 3842 2. phantom call support Supplementary services 3. IMS : Incoming Call Barring - Modified existing API to support request like registration,activation, deactivation,erasure,interogation. 4.Unsol supplementary service notification - send unsol supplementary notification to UI - add call history info Miscellaneous 5. Ims: Originate conference call in DIALING state 6. IMS: Addition of Extras to ImsCallProfile - Add EXTRA string definitions to ImsCallProfile 7. IMS: Definition of error code - answered elsewhere - FDN call failure Change-Id: I52a64e9a5df3479189f62921a01655a50fb386fc --- telecomm/java/android/telecom/Call.java | 9 +- telecomm/java/android/telecom/Phone.java | 3 +- .../java/com/android/ims/ImsCallProfile.java | 8 ++ .../java/com/android/ims/ImsReasonInfo.java | 9 ++ telephony/java/com/android/ims/ImsSsInfo.java | 3 + .../ims/ImsSuppServiceNotification.aidl | 33 +++++ .../ims/ImsSuppServiceNotification.java | 114 ++++++++++++++++++ .../ims/internal/IImsCallSessionListener.aidl | 7 ++ .../internal/IImsRegistrationListener.aidl | 6 + .../java/com/android/ims/internal/IImsUt.aidl | 2 +- 10 files changed, 191 insertions(+), 3 deletions(-) create mode 100644 telephony/java/com/android/ims/ImsSuppServiceNotification.aidl create mode 100644 telephony/java/com/android/ims/ImsSuppServiceNotification.java diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index a2e0706fd8187..d83c8d962f5ce 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -968,7 +968,6 @@ public final class Call { unregisterCallback(listener); } - /** {@hide} */ Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter) { mPhone = phone; @@ -977,6 +976,14 @@ public final class Call { mState = STATE_NEW; } + /** {@hide} */ + Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state) { + mPhone = phone; + mTelecomCallId = telecomCallId; + mInCallAdapter = inCallAdapter; + mState = state; + } + /** {@hide} */ final String internalGetCallId() { return mTelecomCallId; diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index 8eb091b732af2..47154da242f49 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -122,7 +122,8 @@ public final class Phone { } final void internalAddCall(ParcelableCall parcelableCall) { - Call call = new Call(this, parcelableCall.getId(), mInCallAdapter); + Call call = new Call(this, parcelableCall.getId(), mInCallAdapter, + parcelableCall.getState()); mCallByTelecomCallId.put(parcelableCall.getId(), call); mCalls.add(call); checkCallTree(parcelableCall); diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 1c69794a3d5fc..3b7d53b7ee82e 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -172,11 +172,19 @@ public class ImsCallProfile implements Parcelable { * cna : Calling name * ussd : For network-initiated USSD, MT only * remote_uri : Connected user identity (it can be used for the conference) + * ChildNum: Child number info. + * Codec: Codec info. + * DisplayText: Display text for the call. + * AdditionalCallInfo: Additional call info. */ public static final String EXTRA_OI = "oi"; public static final String EXTRA_CNA = "cna"; public static final String EXTRA_USSD = "ussd"; public static final String EXTRA_REMOTE_URI = "remote_uri"; + public static final String EXTRA_CHILD_NUMBER = "ChildNum"; + public static final String EXTRA_CODEC = "Codec"; + public static final String EXTRA_DISPLAY_TEXT = "DisplayText"; + public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; public int mServiceType; public int mCallType; diff --git a/telephony/java/com/android/ims/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java index 96289158cc055..2769a2b279683 100644 --- a/telephony/java/com/android/ims/ImsReasonInfo.java +++ b/telephony/java/com/android/ims/ImsReasonInfo.java @@ -99,6 +99,9 @@ public class ImsReasonInfo implements Parcelable { // MT : No action from user after alerting the call public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203; + //Call failures for FDN + public static final int CODE_FDN_BLOCKED = 241; + /** * STATUSCODE (SIP response code) (IMS -> Telephony) */ @@ -226,6 +229,12 @@ public class ImsReasonInfo implements Parcelable { */ public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100; + /** + * MT call has ended due to a release from the network + * because the call was answered elsewhere + */ + public static final int CODE_ANSWERED_ELSEWHERE = 1014; + /** * Network string error messages. * mExtraMessage may have these values. diff --git a/telephony/java/com/android/ims/ImsSsInfo.java b/telephony/java/com/android/ims/ImsSsInfo.java index dbde1c62c5153..7acc3bfd45c95 100644 --- a/telephony/java/com/android/ims/ImsSsInfo.java +++ b/telephony/java/com/android/ims/ImsSsInfo.java @@ -34,6 +34,7 @@ public class ImsSsInfo implements Parcelable { // 0: disabled, 1: enabled public int mStatus; + public String mIcbNum; public ImsSsInfo() { } @@ -50,6 +51,7 @@ public class ImsSsInfo implements Parcelable { @Override public void writeToParcel(Parcel out, int flags) { out.writeInt(mStatus); + out.writeString(mIcbNum); } @Override @@ -59,6 +61,7 @@ public class ImsSsInfo implements Parcelable { private void readFromParcel(Parcel in) { mStatus = in.readInt(); + mIcbNum = in.readString(); } public static final Creator CREATOR = diff --git a/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl b/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl new file mode 100644 index 0000000000000..ff210472dc9ba --- /dev/null +++ b/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +package com.android.ims; + +parcelable ImsSuppServiceNotification; diff --git a/telephony/java/com/android/ims/ImsSuppServiceNotification.java b/telephony/java/com/android/ims/ImsSuppServiceNotification.java new file mode 100644 index 0000000000000..91171c7b30d61 --- /dev/null +++ b/telephony/java/com/android/ims/ImsSuppServiceNotification.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +package com.android.ims; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Arrays; + + +/** + * Parcelable object to handle IMS supplementary service notifications. + * + * @hide + */ +public class ImsSuppServiceNotification implements Parcelable { + private static final String TAG = "ImsSuppServiceNotification"; + + /** Type of notification: 0 = MO; 1 = MT */ + public int notificationType; + /** TS 27.007 7.17 "code1" or "code2" */ + public int code; + /** TS 27.007 7.17 "index" - Not used currently*/ + public int index; + /** TS 27.007 7.17 "type" (MT only) - Not used currently */ + public int type; + /** TS 27.007 7.17 "number" (MT only) */ + public String number; + /** List of forwarded numbers, if any */ + public String[] history; + + public ImsSuppServiceNotification() { + } + + public ImsSuppServiceNotification(Parcel in) { + readFromParcel(in); + } + + @Override + public String toString() { + return "{ notificationType=" + notificationType + + ", code=" + code + + ", index=" + index + + ", type=" + type + + ", number=" + number + + ", history=" + Arrays.toString(history) + + " }"; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeInt(notificationType); + out.writeInt(code); + out.writeInt(index); + out.writeInt(type); + out.writeString(number); + out.writeStringArray(history); + } + + private void readFromParcel(Parcel in) { + notificationType = in.readInt(); + code = in.readInt(); + index = in.readInt(); + type = in.readInt(); + number = in.readString(); + history = in.createStringArray(); + } + + public static final Creator CREATOR = + new Creator() { + @Override + public ImsSuppServiceNotification createFromParcel(Parcel in) { + return new ImsSuppServiceNotification(in); + } + + @Override + public ImsSuppServiceNotification[] newArray(int size) { + return new ImsSuppServiceNotification[size]; + } + }; +} diff --git a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl index 0443c3edb9747..d562eccd83fc1 100644 --- a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl @@ -21,6 +21,7 @@ import com.android.ims.ImsCallProfile; import com.android.ims.ImsReasonInfo; import com.android.ims.ImsConferenceState; import com.android.ims.internal.IImsCallSession; +import com.android.ims.ImsSuppServiceNotification; /** * A listener type for receiving notification on IMS call session events. @@ -123,4 +124,10 @@ interface IImsCallSessionListener { * @param isMultiParty {@code true} if the session became multiparty, {@code false} otherwise. */ void callSessionMultipartyStateChanged(in IImsCallSession session, in boolean isMultiParty); + + /** + * Notifies the supplementary service information for the current session. + */ + void callSessionSuppServiceReceived(in IImsCallSession session, + in ImsSuppServiceNotification suppSrvNotification); } diff --git a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl index c91060019c606..a6a26584411ba 100644 --- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl @@ -72,4 +72,10 @@ interface IImsRegistrationListener { */ void registrationFeatureCapabilityChanged(int serviceClass, out int[] enabledFeatures, out int[] disabledFeatures); + + /** + * Updates the application with the waiting voice message count. + * @param count The number of waiting voice messages. + */ + void voiceMessageCountUpdate(int count); } diff --git a/telephony/java/com/android/ims/internal/IImsUt.aidl b/telephony/java/com/android/ims/internal/IImsUt.aidl index c531ea59ce454..4ab5ee3c4f8c7 100644 --- a/telephony/java/com/android/ims/internal/IImsUt.aidl +++ b/telephony/java/com/android/ims/internal/IImsUt.aidl @@ -74,7 +74,7 @@ interface IImsUt { /** * Updates the configuration of the call barring. */ - int updateCallBarring(int cbType, boolean enable, in String[] barrList); + int updateCallBarring(int cbType, int action, in String[] barrList); /** * Updates the configuration of the call forward. From 8b5d18c5966f3277d606d18672cfe988eb0b88dc Mon Sep 17 00:00:00 2001 From: Casper Bonde Date: Fri, 8 May 2015 14:32:24 +0200 Subject: [PATCH 06/14] DO NOT MERGE - SAP: Make it possible to enforce a 16-digit pin code (4/5) This change enable the posibility to enforce using a 16-digit pin or MITM for a RFCOMM or L2CAP connection. This is needed for the SIM access profile. Change-Id: I3205013f9e758c353381442a86845dab467780f8 Signed-off-by: Casper Bonde --- .../android/bluetooth/BluetoothAdapter.java | 17 +++++++++++------ .../java/android/bluetooth/BluetoothDevice.java | 11 +++++++++-- .../bluetooth/BluetoothServerSocket.java | 6 ++++-- .../java/android/bluetooth/BluetoothSocket.java | 14 +++++++++++--- .../android/bluetooth/BluetoothTestUtils.java | 1 + 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 308c4c84e3a4d..d71db94bdd351 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1430,7 +1430,7 @@ public final class BluetoothAdapter { * @hide */ public BluetoothServerSocket listenUsingRfcommOn(int channel) throws IOException { - return listenUsingRfcommOn(channel, false); + return listenUsingRfcommOn(channel, false, false); } /** @@ -1445,14 +1445,17 @@ public final class BluetoothAdapter { * {@link SOCKET_CHANNEL_AUTO_STATIC_NO_SDP} as channel number. * @param channel RFCOMM channel to listen on * @param mitm enforce man-in-the-middle protection for authentication. + * @param min16DigitPin enforce a pin key length og minimum 16 digit for sec mode 2 connections. * @return a listening RFCOMM BluetoothServerSocket * @throws IOException on error, for example Bluetooth not available, or * insufficient permissions, or channel in use. * @hide */ - public BluetoothServerSocket listenUsingRfcommOn(int channel, boolean mitm) throws IOException { + public BluetoothServerSocket listenUsingRfcommOn(int channel, boolean mitm, + boolean min16DigitPin) + throws IOException { BluetoothServerSocket socket = new BluetoothServerSocket( - BluetoothSocket.TYPE_RFCOMM, true, true, channel, mitm); + BluetoothSocket.TYPE_RFCOMM, true, true, channel, mitm, min16DigitPin); int errno = socket.mSocket.bindListen(); if (channel == SOCKET_CHANNEL_AUTO_STATIC_NO_SDP) { socket.setChannel(socket.mSocket.getPort()); @@ -1655,14 +1658,16 @@ public final class BluetoothAdapter { * {@link SOCKET_CHANNEL_AUTO_STATIC_NO_SDP} as port number. * @param port the PSM to listen on * @param mitm enforce man-in-the-middle protection for authentication. + * @param min16DigitPin enforce a pin key length og minimum 16 digit for sec mode 2 connections. * @return An L2CAP BluetoothServerSocket * @throws IOException On error, for example Bluetooth not available, or * insufficient permissions. * @hide */ - public BluetoothServerSocket listenUsingL2capOn(int port, boolean mitm) throws IOException { + public BluetoothServerSocket listenUsingL2capOn(int port, boolean mitm, boolean min16DigitPin) + throws IOException { BluetoothServerSocket socket = new BluetoothServerSocket( - BluetoothSocket.TYPE_L2CAP, true, true, port, mitm); + BluetoothSocket.TYPE_L2CAP, true, true, port, mitm, min16DigitPin); int errno = socket.mSocket.bindListen(); if(port == SOCKET_CHANNEL_AUTO_STATIC_NO_SDP) { socket.setChannel(socket.mSocket.getPort()); @@ -1688,7 +1693,7 @@ public final class BluetoothAdapter { * @hide */ public BluetoothServerSocket listenUsingL2capOn(int port) throws IOException { - return listenUsingL2capOn(port, false); + return listenUsingL2capOn(port, false, false); } /** diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index bfc374fb913cb..129cd25702391 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -528,6 +528,13 @@ public final class BluetoothDevice implements Parcelable { */ public static final int PAIRING_VARIANT_OOB_CONSENT = 6; + /** + * The user will be prompted to enter a 16 digit pin or + * an app will enter a 16 digit pin for user. + * @hide + */ + public static final int PAIRING_VARIANT_PIN_16_DIGITS = 7; + /** * Used as an extra field in {@link #ACTION_UUID} intents, * Contains the {@link android.os.ParcelUuid}s of the remote device which @@ -1308,8 +1315,8 @@ public final class BluetoothDevice implements Parcelable { Log.e(TAG, "", e); } return false; - } - + } + /** * Create an RFCOMM {@link BluetoothSocket} ready to start a secure * outgoing connection to this remote device on given channel. diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java index a80f55c0e497d..c15852dcdaa7f 100644 --- a/core/java/android/bluetooth/BluetoothServerSocket.java +++ b/core/java/android/bluetooth/BluetoothServerSocket.java @@ -98,14 +98,16 @@ public final class BluetoothServerSocket implements Closeable { * @param encrypt require the connection to be encrypted * @param port remote port * @param mitm enforce man-in-the-middle protection for authentication. + * @param min16DigitPin enforce a minimum length of 16 digits for a sec mode 2 connection * @throws IOException On error, for example Bluetooth not available, or * insufficient privileges */ /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port, - boolean mitm) + boolean mitm, boolean min16DigitPin) throws IOException { mChannel = port; - mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port, null, mitm); + mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port, null, mitm, + min16DigitPin); if(port == BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP) { mSocket.setExcludeSdp(true); } diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index 4722d0131021b..2f8e7aca927b6 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -103,6 +103,7 @@ public final class BluetoothSocket implements Closeable { /*package*/ static final int SEC_FLAG_AUTH = 1 << 1; /*package*/ static final int BTSOCK_FLAG_NO_SDP = 1 << 2; /*package*/ static final int SEC_FLAG_AUTH_MITM = 1 << 3; + /*package*/ static final int SEC_FLAG_AUTH_16_DIGIT = 1 << 4; private final int mType; /* one of TYPE_RFCOMM etc */ private BluetoothDevice mDevice; /* remote device */ @@ -114,6 +115,7 @@ public final class BluetoothSocket implements Closeable { private final ParcelUuid mUuid; private boolean mExcludeSdp = false; /* when true no SPP SDP record will be created */ private boolean mAuthMitm = false; /* when true Man-in-the-middle protection will be enabled*/ + private boolean mMin16DigitPin = false; /* Minimum 16 digit pin for sec mode 2 connections */ private ParcelFileDescriptor mPfd; private LocalSocket mSocket; private InputStream mSocketIS; @@ -156,7 +158,7 @@ public final class BluetoothSocket implements Closeable { */ /*package*/ BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, BluetoothDevice device, int port, ParcelUuid uuid) throws IOException { - this(type, fd, auth, encrypt, device, port, uuid, false); + this(type, fd, auth, encrypt, device, port, uuid, false, false); } /** @@ -169,11 +171,13 @@ public final class BluetoothSocket implements Closeable { * @param port remote port * @param uuid SDP uuid * @param mitm enforce man-in-the-middle protection. + * @param min16DigitPin enforce a minimum length of 16 digits for a sec mode 2 connection * @throws IOException On error, for example Bluetooth not available, or * insufficient privileges */ /*package*/ BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, - BluetoothDevice device, int port, ParcelUuid uuid, boolean mitm) throws IOException { + BluetoothDevice device, int port, ParcelUuid uuid, boolean mitm, boolean min16DigitPin) + throws IOException { if (VDBG) Log.d(TAG, "Creating new BluetoothSocket of type: " + type); if (type == BluetoothSocket.TYPE_RFCOMM && uuid == null && fd == -1 && port != BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP) { @@ -187,6 +191,7 @@ public final class BluetoothSocket implements Closeable { mType = type; mAuth = auth; mAuthMitm = mitm; + mMin16DigitPin = min16DigitPin; mEncrypt = encrypt; mDevice = device; mPort = port; @@ -219,6 +224,7 @@ public final class BluetoothSocket implements Closeable { mServiceName = s.mServiceName; mExcludeSdp = s.mExcludeSdp; mAuthMitm = s.mAuthMitm; + mMin16DigitPin = s.mMin16DigitPin; } private BluetoothSocket acceptSocket(String RemoteAddr) throws IOException { BluetoothSocket as = new BluetoothSocket(this); @@ -250,7 +256,7 @@ public final class BluetoothSocket implements Closeable { */ private BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, String address, int port) throws IOException { - this(type, fd, auth, encrypt, new BluetoothDevice(address), port, null, false); + this(type, fd, auth, encrypt, new BluetoothDevice(address), port, null, false, false); } /** @hide */ @@ -272,6 +278,8 @@ public final class BluetoothSocket implements Closeable { flags |= BTSOCK_FLAG_NO_SDP; if(mAuthMitm) flags |= SEC_FLAG_AUTH_MITM; + if(mMin16DigitPin) + flags |= SEC_FLAG_AUTH_16_DIGIT; return flags; } diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java index 8fbd2147c9d03..0d9980ad2059c 100644 --- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java +++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java @@ -170,6 +170,7 @@ public class BluetoothTestUtils extends Assert { assertNotSame(-1, varient); switch (varient) { case BluetoothDevice.PAIRING_VARIANT_PIN: + case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS: mDevice.setPin(mPin); break; case BluetoothDevice.PAIRING_VARIANT_PASSKEY: From 5fc9e14077c3bec51d0a93a5edeeade396d77d15 Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Wed, 10 Jun 2015 12:28:29 -0700 Subject: [PATCH 07/14] make sure wifi link stats are reset Change-Id: I8687594eccea1e3d8b99450da5230442cdbd1a86 --- wifi/java/android/net/wifi/WifiInfo.java | 41 ++++++++++++++++-------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java index 75198e52e8f00..bd0069fed7425 100644 --- a/wifi/java/android/net/wifi/WifiInfo.java +++ b/wifi/java/android/net/wifi/WifiInfo.java @@ -159,15 +159,24 @@ public class WifiInfo implements Parcelable { long txbad = stats.lostmpdu_be + stats.lostmpdu_bk + stats.lostmpdu_vi + stats.lostmpdu_vo; - txBadRate = (txBadRate * 0.5) - + ((double) (txbad - txBad) * 0.5); - txSuccessRate = (txSuccessRate * 0.5) - + ((double) (txgood - txSuccess) * 0.5); - rxSuccessRate = (rxSuccessRate * 0.5) - + ((double) (rxgood - rxSuccess) * 0.5); - txRetriesRate = (txRetriesRate * 0.5) - + ((double) (txretries - txRetries) * 0.5); - + if (txBad <= txbad + && txSuccess <= txgood + && rxSuccess <= rxgood + && txRetries <= txretries) { + txBadRate = (txBadRate * 0.5) + + ((double) (txbad - txBad) * 0.5); + txSuccessRate = (txSuccessRate * 0.5) + + ((double) (txgood - txSuccess) * 0.5); + rxSuccessRate = (rxSuccessRate * 0.5) + + ((double) (rxgood - rxSuccess) * 0.5); + txRetriesRate = (txRetriesRate * 0.5) + + ((double) (txretries - txRetries) * 0.5); + } else { + txBadRate = 0; + txSuccessRate = 0; + rxSuccessRate = 0; + txRetriesRate = 0; + } txBad = txbad; txSuccess = txgood; rxSuccess = rxgood; @@ -196,11 +205,15 @@ public class WifiInfo implements Parcelable { txRetries = 0; txBadRate = 0; txRetriesRate = 0; - - txSuccessRate = (txSuccessRate * 0.5) - + ((double) (txPackets - txSuccess) * 0.5); - rxSuccessRate = (rxSuccessRate * 0.5) - + ((double) (rxPackets - rxSuccess) * 0.5); + if (txSuccess <= txPackets && rxSuccess <= rxPackets) { + txSuccessRate = (txSuccessRate * 0.5) + + ((double) (txPackets - txSuccess) * 0.5); + rxSuccessRate = (rxSuccessRate * 0.5) + + ((double) (rxPackets - rxSuccess) * 0.5); + } else { + txBadRate = 0; + txRetriesRate = 0; + } txSuccess = txPackets; rxSuccess = rxPackets; } From 020e6a99b5d0a3476201541f026e650a31dc07a9 Mon Sep 17 00:00:00 2001 From: Navtej Singh Mann Date: Thu, 11 Jun 2015 16:53:11 -0700 Subject: [PATCH 08/14] fix ArrayIndexOutOfBoundsException while starting WifiScannerScan bug: 21663831 Change-Id: I9aea30907aae00c98d8fb1dc1fff3f4935108fa4 --- core/java/com/android/internal/os/BatteryStatsImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index 20bb95eeff4c6..c5c75ecfba10d 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -4370,7 +4370,7 @@ public final class BatteryStatsImpl extends BatteryStats { @Override public void noteWifiBatchedScanStartedLocked(int csph, long elapsedRealtimeMs) { int bin = 0; - while (csph > 8 && bin < NUM_WIFI_BATCHED_SCAN_BINS) { + while (csph > 8 && bin < NUM_WIFI_BATCHED_SCAN_BINS-1) { csph = csph >> 3; bin++; } From ecddf7925fd95ecedfc5bd628109ee7097979f12 Mon Sep 17 00:00:00 2001 From: Jan Nordqvist Date: Fri, 12 Jun 2015 13:31:07 -0700 Subject: [PATCH 09/14] Added config_wifi_hotspot2_enabled. Change-Id: I1ebf3137e00d2b3cfb6079f599fb0ede6f56df34 --- core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index c701889894e75..c7ece2b75e140 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -373,6 +373,9 @@ false + + true + 10-0050F204-5 diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7d6cf0076cdc4..3d24388b4ed0e 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1631,6 +1631,7 @@ + From 22eb6cca22a85092f93a511161f53b83dcab84d1 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Fri, 12 Jun 2015 09:26:45 -0700 Subject: [PATCH 10/14] Correct issues with VideoProvider discovered via CTS tests. While authoring the CTS tests I discovered a few issues with the VideoProvider. 1. The VideoProvider's default handler should be on the main Looper, similar to other Telecom components. 2. When calling IVideoCallbacks, the try/catch for RemoteExceptions was around the for-loop which iterates over the various VideoCallbacks. If one was to fail, the other VideoCallbacks would not be called. 3. The mVideoCallbacks hashmap should use a ConcurrentHashMap; in CTS tests I ran into a few concurrency exceptions related to the various InCallServices registering callbacks while other methods on the provider were being called. Bug: 21802841 Change-Id: Ib0d46daf03554309044e9efaa991a15cb2c4b46b --- telecomm/java/android/telecom/Connection.java | 64 ++++++++++++------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 14689d40b103c..66c4e6d1661f0 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -444,8 +444,13 @@ public abstract class Connection extends Conferenceable { /** * Stores a list of the video callbacks, keyed by IBinder. + * + * ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is + * load factor before resizing, 1 means we only expect a single thread to + * access the map so make only a single shard */ - private HashMap mVideoCallbacks = new HashMap<>(); + private ConcurrentHashMap mVideoCallbacks = + new ConcurrentHashMap(8, 0.9f, 1); /** * Default handler used to consolidate binder method calls onto a single thread. @@ -466,12 +471,16 @@ public abstract class Connection extends Conferenceable { IBinder binder = (IBinder) msg.obj; IVideoCallback callback = IVideoCallback.Stub .asInterface((IBinder) msg.obj); + if (callback == null) { + Log.w(this, "addVideoProvider - skipped; callback is null."); + break; + } + if (mVideoCallbacks.containsKey(binder)) { Log.i(this, "addVideoProvider - skipped; already present."); break; } mVideoCallbacks.put(binder, callback); - Log.i(this, "addVideoProvider "+ mVideoCallbacks.size()); break; } case MSG_REMOVE_VIDEO_CALLBACK: { @@ -590,7 +599,7 @@ public abstract class Connection extends Conferenceable { public VideoProvider() { mBinder = new VideoProvider.VideoProviderBinder(); - mMessageHandler = new VideoProvider.VideoProviderHandler(); + mMessageHandler = new VideoProvider.VideoProviderHandler(Looper.getMainLooper()); } /** @@ -759,11 +768,12 @@ public abstract class Connection extends Conferenceable { */ public void receiveSessionModifyRequest(VideoProfile videoProfile) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.receiveSessionModifyRequest(videoProfile); + } catch (RemoteException ignored) { + Log.w(this, "receiveSessionModifyRequest callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -789,12 +799,13 @@ public abstract class Connection extends Conferenceable { public void receiveSessionModifyResponse(int status, VideoProfile requestedProfile, VideoProfile responseProfile) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.receiveSessionModifyResponse(status, requestedProfile, responseProfile); + } catch (RemoteException ignored) { + Log.w(this, "receiveSessionModifyResponse callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -815,11 +826,12 @@ public abstract class Connection extends Conferenceable { */ public void handleCallSessionEvent(int event) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.handleCallSessionEvent(event); + } catch (RemoteException ignored) { + Log.w(this, "handleCallSessionEvent callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -839,11 +851,12 @@ public abstract class Connection extends Conferenceable { */ public void changePeerDimensions(int width, int height) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.changePeerDimensions(width, height); + } catch (RemoteException ignored) { + Log.w(this, "changePeerDimensions callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -864,11 +877,12 @@ public abstract class Connection extends Conferenceable { */ public void setCallDataUsage(long dataUsage) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.changeCallDataUsage(dataUsage); + } catch (RemoteException ignored) { + Log.w(this, "setCallDataUsage callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -900,11 +914,12 @@ public abstract class Connection extends Conferenceable { */ public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.changeCameraCapabilities(cameraCapabilities); + } catch (RemoteException ignored) { + Log.w(this, "changeCameraCapabilities callback failed", ignored); } - } catch (RemoteException ignored) { } } } @@ -924,11 +939,12 @@ public abstract class Connection extends Conferenceable { */ public void changeVideoQuality(int videoQuality) { if (mVideoCallbacks != null) { - try { - for (IVideoCallback callback : mVideoCallbacks.values()) { + for (IVideoCallback callback : mVideoCallbacks.values()) { + try { callback.changeVideoQuality(videoQuality); + } catch (RemoteException ignored) { + Log.w(this, "changeVideoQuality callback failed", ignored); } - } catch (RemoteException ignored) { } } } From e080e131ebcd9756fc494d26a2b8854a0f60eb59 Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Tue, 16 Jun 2015 13:55:44 -0700 Subject: [PATCH 11/14] add creation/update time to WifiConfiguration Change-Id: Iaace83e752c8aa7d740a3dfad42cd8bba80a7a08 --- .../android/net/wifi/WifiConfiguration.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index b24a934a2abbe..e371f1fe3e502 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -634,6 +634,18 @@ public class WifiConfiguration implements Parcelable { */ public int numNoInternetAccessReports; + /** + * @hide + * For debug: date at which the config was last updated + */ + public String updateTime; + + /** + * @hide + * For debug: date at which the config was last updated + */ + public String creationTime; + /** * @hide * The WiFi configuration is considered to have no internet access for purpose of autojoining @@ -933,6 +945,12 @@ public class WifiConfiguration implements Parcelable { sbuf.append(" numNoInternetAccessReports "); sbuf.append(this.numNoInternetAccessReports).append("\n"); } + if (this.updateTime != null) { + sbuf.append("creation=").append(this.updateTime).append("\n"); + } + if (this.creationTime != null) { + sbuf.append("update=").append(this.creationTime).append("\n"); + } if (this.didSelfAdd) sbuf.append(" didSelfAdd"); if (this.selfAdded) sbuf.append(" selfAdded"); if (this.validatedInternetAccess) sbuf.append(" validatedInternetAccess"); @@ -1412,6 +1430,8 @@ public class WifiConfiguration implements Parcelable { autoJoinBailedDueToLowRssi = source.autoJoinBailedDueToLowRssi; dirty = source.dirty; numNoInternetAccessReports = source.numNoInternetAccessReports; + creationTime = source.creationTime; + updateTime = source.updateTime; } } From 1cce1ec352b2a969d0132c38a1043eab3a18d2cc Mon Sep 17 00:00:00 2001 From: Omkar Kolangade Date: Mon, 4 May 2015 17:49:14 -0700 Subject: [PATCH 12/14] IMS RAT Reporting in Registration Unsol Adding a parameter to the IMS registration complete and progressing callbacks allowing frameworks to be notified of the radio access technology over which IMS is registered. Bug: 21902225 Change-Id: I3b340da3776b617fd9d944585672bce51c5d9c1e --- .../ims/internal/IImsRegistrationListener.aidl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl index a6a26584411ba..c139170013305 100644 --- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl @@ -17,6 +17,7 @@ package com.android.ims.internal; import com.android.ims.ImsReasonInfo; + /** * A listener type for receiving notifications about the changes to * the IMS connection(registration). @@ -26,13 +27,19 @@ import com.android.ims.ImsReasonInfo; interface IImsRegistrationListener { /** * Notifies the application when the device is connected to the IMS network. + * + * @param imsRadioTech the radio access technology. Valid values are {@code + * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}. */ - void registrationConnected(); + void registrationConnected(int imsRadioTech); /** * Notifies the application when the device is trying to connect the IMS network. + * + * @param imsRadioTech the radio access technology. Valid values are {@code + * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}. */ - void registrationProgressing(); + void registrationProgressing(int imsRadioTech); /** * Notifies the application when the device is disconnected from the IMS network. From 8c994e570817dfdfbc249b920bcf9eae5307330c Mon Sep 17 00:00:00 2001 From: Shriram Ganesh Date: Thu, 11 Dec 2014 17:53:38 -0800 Subject: [PATCH 13/14] Added support for mid-call enabled SRVCC conference call When TelephonyConnection is created for an unknown connection, the recalculation of conference participants have to be retriggered. This is because, unless that TelephonyConnection is added to ConnectionService, it cannot be added as part of a conference call in CallsManager. Change-Id: Ic9359104f02eddff655d84fd25f5c28c9158e5f4 --- .../java/android/telecom/ConnectionService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 1e8ae8802d231..4262bbb7d7204 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -655,6 +655,9 @@ public abstract class ConnectionService extends Service { connection.getDisconnectCause(), createIdList(connection.getConferenceables()), connection.getExtras())); + if (isUnknown) { + triggerConferenceRecalculate(); + } } private void abort(String callId) { @@ -1013,6 +1016,16 @@ public abstract class ConnectionService extends Service { return null; } + /** + * Trigger recalculate functinality for conference calls. This is used when a Telephony + * Connection is part of a conference controller but is not yet added to Connection + * Service and hence cannot be added to the conference call. + * + * @hide + */ + public void triggerConferenceRecalculate() { + } + /** * Create a {@code Connection} given an outgoing request. This is used to initiate new * outgoing calls. From 6901c3b6d710c44379e3249e49432a7a542f3aab Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 24 Jun 2015 13:49:44 -0700 Subject: [PATCH 14/14] IMS: Supplementary services - Propagate IMS supplementary services to telephony framework - Introduce call forwarding history info. Bug: 21725750 Change-Id: Idc3a433785e84a3d683cbcfc7fb90f0b89dced12 --- telecomm/java/android/telecom/Connection.java | 7 ++++ .../ims/ImsSuppServiceNotification.aidl | 35 ++++++------------- .../ims/ImsSuppServiceNotification.java | 35 ++++++------------- 3 files changed, 29 insertions(+), 48 deletions(-) diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 6055211a600ab..6f593291ff031 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -199,6 +199,13 @@ public abstract class Connection extends Conferenceable { // Next CAPABILITY value: 0x00200000 //********************************************************************************************** + /** + * Call extras key to pack/unpack call history info. + * The value for this key should be an ArrayList of Strings. + * @hide + */ + public static final String EXTRA_CALL_HISTORY_INFO = "EXTRA_CALL_HISTORY_INFO"; + // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); diff --git a/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl b/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl index ff210472dc9ba..6b4479f467c2e 100644 --- a/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl +++ b/telephony/java/com/android/ims/ImsSuppServiceNotification.aidl @@ -1,30 +1,17 @@ /* - * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2015 The Android Open Source Project * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ diff --git a/telephony/java/com/android/ims/ImsSuppServiceNotification.java b/telephony/java/com/android/ims/ImsSuppServiceNotification.java index 91171c7b30d61..faf749972b91b 100644 --- a/telephony/java/com/android/ims/ImsSuppServiceNotification.java +++ b/telephony/java/com/android/ims/ImsSuppServiceNotification.java @@ -1,30 +1,17 @@ /* - * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2015 The Android Open Source Project * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */