diff options
author | Santos Cordon <santoscordon@google.com> | 2015-05-27 17:21:45 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2015-05-28 09:43:00 -0700 |
commit | 6b7f955c2d9b231660b8c54f8ef8e8e6ad802625 (patch) | |
tree | c594cb452d2bb826d4a7c502b2ca857a81492e90 /telecomm/java/android/telecom/ParcelableCall.java | |
parent | 6ffab1bd65d2b5cc9e2944712058cb42babaa76b (diff) | |
download | frameworks_base-6b7f955c2d9b231660b8c54f8ef8e8e6ad802625.zip frameworks_base-6b7f955c2d9b231660b8c54f8ef8e8e6ad802625.tar.gz frameworks_base-6b7f955c2d9b231660b8c54f8ef8e8e6ad802625.tar.bz2 |
Add extras to Connections/Calls. (1/3)
Two major changes:
1) Add the notion of extras to a Connection. These extras will be
parceled through to InCallService as Call.getExtras()
2) The previously existing Call.getExtras() has been renamed to
getIntentExtras(). This name better describes the fact that these
particular extras are from the original CALL or INCOMING_CALL intents.
Change-Id: I08c1baf4f08d54757f98012f0c08b423a707c53d
Diffstat (limited to 'telecomm/java/android/telecom/ParcelableCall.java')
-rw-r--r-- | telecomm/java/android/telecom/ParcelableCall.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/ParcelableCall.java b/telecomm/java/android/telecom/ParcelableCall.java index bb65ce9..8cf4aeb 100644 --- a/telecomm/java/android/telecom/ParcelableCall.java +++ b/telecomm/java/android/telecom/ParcelableCall.java @@ -54,6 +54,7 @@ public final class ParcelableCall implements Parcelable { private final StatusHints mStatusHints; private final int mVideoState; private final List<String> mConferenceableCallIds; + private final Bundle mIntentExtras; private final Bundle mExtras; public ParcelableCall( @@ -77,6 +78,7 @@ public final class ParcelableCall implements Parcelable { StatusHints statusHints, int videoState, List<String> conferenceableCallIds, + Bundle intentExtras, Bundle extras) { mId = id; mState = state; @@ -98,6 +100,7 @@ public final class ParcelableCall implements Parcelable { mStatusHints = statusHints; mVideoState = videoState; mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); + mIntentExtras = intentExtras; mExtras = extras; } @@ -227,7 +230,7 @@ public final class ParcelableCall implements Parcelable { } /** - * Any extras to pass with the call + * Any extras associated with this call. * * @return a bundle of extras */ @@ -236,6 +239,15 @@ public final class ParcelableCall implements Parcelable { } /** + * Extras passed in as part of the original call intent. + * + * @return The intent extras. + */ + public Bundle getIntentExtras() { + return mIntentExtras; + } + + /** * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the * {@link android.telecom.InCallService.VideoCall} associated with this call. Since * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether @@ -277,7 +289,8 @@ public final class ParcelableCall implements Parcelable { int videoState = source.readInt(); List<String> conferenceableCallIds = new ArrayList<>(); source.readList(conferenceableCallIds, classLoader); - Bundle extras = source.readParcelable(classLoader); + Bundle intentExtras = source.readBundle(classLoader); + Bundle extras = source.readBundle(classLoader); return new ParcelableCall( id, state, @@ -299,6 +312,7 @@ public final class ParcelableCall implements Parcelable { statusHints, videoState, conferenceableCallIds, + intentExtras, extras); } @@ -338,7 +352,8 @@ public final class ParcelableCall implements Parcelable { destination.writeParcelable(mStatusHints, 0); destination.writeInt(mVideoState); destination.writeList(mConferenceableCallIds); - destination.writeParcelable(mExtras, 0); + destination.writeBundle(mIntentExtras); + destination.writeBundle(mExtras); } @Override |