2014-08-07 18:35:18 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2014, The Android Open Source Project
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2014-09-12 22:16:17 -07:00
|
|
|
package android.telecom;
|
2014-08-07 18:35:18 -07:00
|
|
|
|
2015-05-27 17:21:45 -07:00
|
|
|
import android.os.Bundle;
|
2014-08-07 18:35:18 -07:00
|
|
|
import android.os.Parcel;
|
|
|
|
import android.os.Parcelable;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2015-03-24 16:42:31 -07:00
|
|
|
import com.android.internal.telecom.IVideoProvider;
|
|
|
|
|
2014-08-07 18:35:18 -07:00
|
|
|
/**
|
|
|
|
* A parcelable representation of a conference connection.
|
|
|
|
* @hide
|
|
|
|
*/
|
|
|
|
public final class ParcelableConference implements Parcelable {
|
|
|
|
|
|
|
|
private PhoneAccountHandle mPhoneAccount;
|
|
|
|
private int mState;
|
2014-11-12 13:41:16 -08:00
|
|
|
private int mConnectionCapabilities;
|
2016-03-22 09:02:47 -07:00
|
|
|
private int mConnectionProperties;
|
2014-08-07 18:35:18 -07:00
|
|
|
private List<String> mConnectionIds;
|
2015-04-14 13:38:12 -07:00
|
|
|
private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
2015-03-24 16:42:31 -07:00
|
|
|
private final IVideoProvider mVideoProvider;
|
|
|
|
private final int mVideoState;
|
2015-04-14 13:38:12 -07:00
|
|
|
private StatusHints mStatusHints;
|
2015-05-27 17:21:45 -07:00
|
|
|
private Bundle mExtras;
|
2014-08-07 18:35:18 -07:00
|
|
|
|
|
|
|
public ParcelableConference(
|
|
|
|
PhoneAccountHandle phoneAccount,
|
|
|
|
int state,
|
2014-11-12 13:41:16 -08:00
|
|
|
int connectionCapabilities,
|
2016-03-22 09:02:47 -07:00
|
|
|
int connectionProperties,
|
2015-03-24 16:42:31 -07:00
|
|
|
List<String> connectionIds,
|
|
|
|
IVideoProvider videoProvider,
|
2015-04-16 13:11:55 -07:00
|
|
|
int videoState,
|
2015-04-14 13:38:12 -07:00
|
|
|
long connectTimeMillis,
|
2015-05-27 17:21:45 -07:00
|
|
|
StatusHints statusHints,
|
|
|
|
Bundle extras) {
|
2014-08-07 18:35:18 -07:00
|
|
|
mPhoneAccount = phoneAccount;
|
|
|
|
mState = state;
|
2014-11-12 13:41:16 -08:00
|
|
|
mConnectionCapabilities = connectionCapabilities;
|
2016-03-22 09:02:47 -07:00
|
|
|
mConnectionProperties = connectionProperties;
|
2014-08-07 18:35:18 -07:00
|
|
|
mConnectionIds = connectionIds;
|
2015-01-12 09:02:01 -08:00
|
|
|
mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
2015-03-24 16:42:31 -07:00
|
|
|
mVideoProvider = videoProvider;
|
|
|
|
mVideoState = videoState;
|
2015-01-12 09:02:01 -08:00
|
|
|
mConnectTimeMillis = connectTimeMillis;
|
2015-04-14 13:38:12 -07:00
|
|
|
mStatusHints = statusHints;
|
2015-05-27 17:21:45 -07:00
|
|
|
mExtras = extras;
|
2014-08-07 18:35:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return (new StringBuffer())
|
|
|
|
.append("account: ")
|
|
|
|
.append(mPhoneAccount)
|
|
|
|
.append(", state: ")
|
|
|
|
.append(Connection.stateToString(mState))
|
|
|
|
.append(", capabilities: ")
|
2014-11-12 13:41:16 -08:00
|
|
|
.append(Connection.capabilitiesToString(mConnectionCapabilities))
|
2016-03-22 09:02:47 -07:00
|
|
|
.append(", properties: ")
|
|
|
|
.append(Connection.propertiesToString(mConnectionProperties))
|
2015-01-12 09:02:01 -08:00
|
|
|
.append(", connectTime: ")
|
|
|
|
.append(mConnectTimeMillis)
|
2014-08-07 18:35:18 -07:00
|
|
|
.append(", children: ")
|
|
|
|
.append(mConnectionIds)
|
2015-03-24 16:42:31 -07:00
|
|
|
.append(", VideoState: ")
|
|
|
|
.append(mVideoState)
|
|
|
|
.append(", VideoProvider: ")
|
|
|
|
.append(mVideoProvider)
|
2014-08-07 18:35:18 -07:00
|
|
|
.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public PhoneAccountHandle getPhoneAccount() {
|
|
|
|
return mPhoneAccount;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getState() {
|
|
|
|
return mState;
|
|
|
|
}
|
|
|
|
|
2014-11-12 13:41:16 -08:00
|
|
|
public int getConnectionCapabilities() {
|
|
|
|
return mConnectionCapabilities;
|
2014-08-07 18:35:18 -07:00
|
|
|
}
|
|
|
|
|
2016-03-22 09:02:47 -07:00
|
|
|
public int getConnectionProperties() {
|
|
|
|
return mConnectionProperties;
|
|
|
|
}
|
|
|
|
|
2014-08-07 18:35:18 -07:00
|
|
|
public List<String> getConnectionIds() {
|
|
|
|
return mConnectionIds;
|
|
|
|
}
|
|
|
|
|
2015-01-12 09:02:01 -08:00
|
|
|
public long getConnectTimeMillis() {
|
|
|
|
return mConnectTimeMillis;
|
|
|
|
}
|
2015-03-24 16:42:31 -07:00
|
|
|
public IVideoProvider getVideoProvider() {
|
|
|
|
return mVideoProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getVideoState() {
|
|
|
|
return mVideoState;
|
|
|
|
}
|
2015-01-12 09:02:01 -08:00
|
|
|
|
2015-04-14 13:38:12 -07:00
|
|
|
public StatusHints getStatusHints() {
|
|
|
|
return mStatusHints;
|
|
|
|
}
|
|
|
|
|
2015-05-27 17:21:45 -07:00
|
|
|
public Bundle getExtras() {
|
|
|
|
return mExtras;
|
|
|
|
}
|
|
|
|
|
2014-08-07 18:35:18 -07:00
|
|
|
public static final Parcelable.Creator<ParcelableConference> CREATOR =
|
|
|
|
new Parcelable.Creator<ParcelableConference> () {
|
|
|
|
@Override
|
|
|
|
public ParcelableConference createFromParcel(Parcel source) {
|
|
|
|
ClassLoader classLoader = ParcelableConference.class.getClassLoader();
|
|
|
|
PhoneAccountHandle phoneAccount = source.readParcelable(classLoader);
|
|
|
|
int state = source.readInt();
|
|
|
|
int capabilities = source.readInt();
|
|
|
|
List<String> connectionIds = new ArrayList<>(2);
|
|
|
|
source.readList(connectionIds, classLoader);
|
2015-01-12 09:02:01 -08:00
|
|
|
long connectTimeMillis = source.readLong();
|
2015-03-24 16:42:31 -07:00
|
|
|
IVideoProvider videoCallProvider =
|
|
|
|
IVideoProvider.Stub.asInterface(source.readStrongBinder());
|
|
|
|
int videoState = source.readInt();
|
2015-04-27 13:13:32 -07:00
|
|
|
StatusHints statusHints = source.readParcelable(classLoader);
|
2015-05-27 17:21:45 -07:00
|
|
|
Bundle extras = source.readBundle(classLoader);
|
2016-03-22 09:02:47 -07:00
|
|
|
int properties = source.readInt();
|
2015-03-24 16:42:31 -07:00
|
|
|
|
2016-03-22 09:02:47 -07:00
|
|
|
return new ParcelableConference(phoneAccount, state, capabilities, properties,
|
|
|
|
connectionIds, videoCallProvider, videoState, connectTimeMillis, statusHints,
|
|
|
|
extras);
|
2014-08-07 18:35:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ParcelableConference[] newArray(int size) {
|
|
|
|
return new ParcelableConference[size];
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/** {@inheritDoc} */
|
|
|
|
@Override
|
|
|
|
public int describeContents() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Writes ParcelableConference object into a Parcel. */
|
|
|
|
@Override
|
|
|
|
public void writeToParcel(Parcel destination, int flags) {
|
|
|
|
destination.writeParcelable(mPhoneAccount, 0);
|
|
|
|
destination.writeInt(mState);
|
2014-11-12 13:41:16 -08:00
|
|
|
destination.writeInt(mConnectionCapabilities);
|
2014-08-07 18:35:18 -07:00
|
|
|
destination.writeList(mConnectionIds);
|
2015-01-12 09:02:01 -08:00
|
|
|
destination.writeLong(mConnectTimeMillis);
|
2015-03-24 16:42:31 -07:00
|
|
|
destination.writeStrongBinder(
|
|
|
|
mVideoProvider != null ? mVideoProvider.asBinder() : null);
|
|
|
|
destination.writeInt(mVideoState);
|
2015-04-14 13:38:12 -07:00
|
|
|
destination.writeParcelable(mStatusHints, 0);
|
2015-05-27 17:21:45 -07:00
|
|
|
destination.writeBundle(mExtras);
|
2016-03-22 09:02:47 -07:00
|
|
|
destination.writeInt(mConnectionProperties);
|
2014-08-07 18:35:18 -07:00
|
|
|
}
|
|
|
|
}
|