Merge "ims:rcs: Add UCE interface files for RCS." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
eac4de230d
@@ -422,6 +422,12 @@ LOCAL_SRC_FILES += \
|
||||
telephony/java/com/android/ims/internal/IImsUtListener.aidl \
|
||||
telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl \
|
||||
telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/uceservice/IUceService.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/uceservice/IUceListener.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/options/IOptionsService.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/options/IOptionsListener.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/presence/IPresenceService.aidl \
|
||||
telephony/java/com/android/ims/internal/uce/presence/IPresenceListener.aidl \
|
||||
telephony/java/com/android/ims/ImsConfigListener.aidl \
|
||||
telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl \
|
||||
telephony/java/com/android/internal/telephony/IMms.aidl \
|
||||
|
||||
@@ -458,6 +458,9 @@
|
||||
<protected-broadcast android:name="android.net.wifi.PASSPOINT_ICON_RECEIVED" />
|
||||
<protected-broadcast android:name="com.android.server.notification.CountdownConditionProvider" />
|
||||
|
||||
<!-- @hide UCE service Notification -->
|
||||
<protected-broadcast android:name="com.android.ims.internal.uce.UCE_SERVICE_UP" />
|
||||
|
||||
<!-- ====================================================================== -->
|
||||
<!-- RUNTIME PERMISSIONS -->
|
||||
<!-- ====================================================================== -->
|
||||
@@ -830,6 +833,26 @@
|
||||
android:description="@string/permdesc_recordAudio"
|
||||
android:protectionLevel="dangerous"/>
|
||||
|
||||
<!-- ====================================================================== -->
|
||||
<!-- Permissions for accessing the UCE Service -->
|
||||
<!-- ====================================================================== -->
|
||||
|
||||
<!-- @hide Allows an application to Access UCE-Presence.
|
||||
<p>Protection level: dangerous
|
||||
-->
|
||||
<permission android:name="android.permission.ACCESS_UCE_PRESENCE_SERVICE"
|
||||
android:permissionGroup="android.permission-group.PHONE"
|
||||
android:protectionLevel="dangerous"/>
|
||||
|
||||
<!-- @hide Allows an application to Access UCE-OPTIONS.
|
||||
<p>Protection level: dangerous
|
||||
-->
|
||||
<permission android:name="android.permission.ACCESS_UCE_OPTIONS_SERVICE"
|
||||
android:permissionGroup="android.permission-group.PHONE"
|
||||
android:protectionLevel="dangerous"/>
|
||||
|
||||
|
||||
|
||||
<!-- ====================================================================== -->
|
||||
<!-- Permissions for accessing the device camera -->
|
||||
<!-- ====================================================================== -->
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
parcelable CapInfo;
|
||||
443
telephony/java/com/android/ims/internal/uce/common/CapInfo.java
Normal file
443
telephony/java/com/android/ims/internal/uce/common/CapInfo.java
Normal file
@@ -0,0 +1,443 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
/** Class for capability discovery information.
|
||||
* @hide */
|
||||
public class CapInfo implements Parcelable {
|
||||
|
||||
/** IM session support. */
|
||||
private boolean mImSupported = false;
|
||||
/** File transfer support. */
|
||||
private boolean mFtSupported = false;
|
||||
/** File transfer Thumbnail support. */
|
||||
private boolean mFtThumbSupported = false;
|
||||
/** File transfer Store and forward support. */
|
||||
private boolean mFtSnFSupported = false;
|
||||
/** File transfer HTTP support. */
|
||||
private boolean mFtHttpSupported = false;
|
||||
/** Image sharing support. */
|
||||
private boolean mIsSupported = false;
|
||||
/** Video sharing during a CS call support -- IR-74. */
|
||||
private boolean mVsDuringCSSupported = false;
|
||||
/** Video sharing outside of voice call support -- IR-84. */
|
||||
private boolean mVsSupported = false;
|
||||
/** Social presence support. */
|
||||
private boolean mSpSupported = false;
|
||||
/** Presence discovery support. */
|
||||
private boolean mCdViaPresenceSupported = false;
|
||||
/** IP voice call support (IR-92/IR-58). */
|
||||
private boolean mIpVoiceSupported = false;
|
||||
/** IP video call support (IR-92/IR-58). */
|
||||
private boolean mIpVideoSupported = false;
|
||||
/** IP Geo location Pull using File Transfer support. */
|
||||
private boolean mGeoPullFtSupported = false;
|
||||
/** IP Geo location Pull support. */
|
||||
private boolean mGeoPullSupported = false;
|
||||
/** IP Geo location Push support. */
|
||||
private boolean mGeoPushSupported = false;
|
||||
/** Standalone messaging support. */
|
||||
private boolean mSmSupported = false;
|
||||
/** Full Store and Forward Group Chat information. */
|
||||
private boolean mFullSnFGroupChatSupported = false;
|
||||
/** RCS IP Voice call support . */
|
||||
private boolean mRcsIpVoiceCallSupported = false;
|
||||
/** RCS IP Video call support . */
|
||||
private boolean mRcsIpVideoCallSupported = false;
|
||||
/** RCS IP Video call support . */
|
||||
private boolean mRcsIpVideoOnlyCallSupported = false;
|
||||
/** List of supported extensions. */
|
||||
private String[] mExts = new String[10];
|
||||
/** Time used to compute when to query again. */
|
||||
private long mCapTimestamp = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the CapInfo class.
|
||||
*/
|
||||
public CapInfo() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether IM is supported.
|
||||
*/
|
||||
public boolean isImSupported() {
|
||||
return mImSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets IM as supported or not supported.
|
||||
*/
|
||||
public void setImSupported(boolean imSupported) {
|
||||
this.mImSupported = imSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether FT Thumbnail is supported.
|
||||
*/
|
||||
public boolean isFtThumbSupported() {
|
||||
return mFtThumbSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets FT thumbnail as supported or not supported.
|
||||
*/
|
||||
public void setFtThumbSupported(boolean ftThumbSupported) {
|
||||
this.mFtThumbSupported = ftThumbSupported;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether FT Store and Forward is supported
|
||||
*/
|
||||
public boolean isFtSnFSupported() {
|
||||
return mFtSnFSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets FT Store and Forward as supported or not supported.
|
||||
*/
|
||||
public void setFtSnFSupported(boolean ftSnFSupported) {
|
||||
this.mFtSnFSupported = ftSnFSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether File transfer HTTP is supported.
|
||||
*/
|
||||
public boolean isFtHttpSupported() {
|
||||
return mFtHttpSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets File transfer HTTP as supported or not supported.
|
||||
*/
|
||||
public void setFtHttpSupported(boolean ftHttpSupported) {
|
||||
this.mFtHttpSupported = ftHttpSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether FT is supported.
|
||||
*/
|
||||
public boolean isFtSupported() {
|
||||
return mFtSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets FT as supported or not supported.
|
||||
*/
|
||||
public void setFtSupported(boolean ftSupported) {
|
||||
this.mFtSupported = ftSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether IS is supported.
|
||||
*/
|
||||
public boolean isIsSupported() {
|
||||
return mIsSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets IS as supported or not supported.
|
||||
*/
|
||||
public void setIsSupported(boolean isSupported) {
|
||||
this.mIsSupported = isSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether video sharing is supported during a CS call.
|
||||
*/
|
||||
public boolean isVsDuringCSSupported() {
|
||||
return mVsDuringCSSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets video sharing as supported or not supported during a CS
|
||||
* call.
|
||||
*/
|
||||
public void setVsDuringCSSupported(boolean vsDuringCSSupported) {
|
||||
this.mVsDuringCSSupported = vsDuringCSSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether video sharing outside a voice call is
|
||||
* supported.
|
||||
*/
|
||||
public boolean isVsSupported() {
|
||||
return mVsSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets video sharing as supported or not supported.
|
||||
*/
|
||||
public void setVsSupported(boolean vsSupported) {
|
||||
this.mVsSupported = vsSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether social presence is supported.
|
||||
*/
|
||||
public boolean isSpSupported() {
|
||||
return mSpSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets social presence as supported or not supported.
|
||||
*/
|
||||
public void setSpSupported(boolean spSupported) {
|
||||
this.mSpSupported = spSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether capability discovery via presence is
|
||||
* supported.
|
||||
*/
|
||||
public boolean isCdViaPresenceSupported() {
|
||||
return mCdViaPresenceSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets capability discovery via presence as supported or not
|
||||
* supported.
|
||||
*/
|
||||
public void setCdViaPresenceSupported(boolean cdViaPresenceSupported) {
|
||||
this.mCdViaPresenceSupported = cdViaPresenceSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether IP voice call is supported.
|
||||
*/
|
||||
public boolean isIpVoiceSupported() {
|
||||
return mIpVoiceSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets IP voice call as supported or not supported.
|
||||
*/
|
||||
public void setIpVoiceSupported(boolean ipVoiceSupported) {
|
||||
this.mIpVoiceSupported = ipVoiceSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether IP video call is supported.
|
||||
*/
|
||||
public boolean isIpVideoSupported() {
|
||||
return mIpVideoSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets IP video call as supported or not supported.
|
||||
*/
|
||||
public void setIpVideoSupported(boolean ipVideoSupported) {
|
||||
this.mIpVideoSupported = ipVideoSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether Geo location Pull using File Transfer is
|
||||
* supported.
|
||||
*/
|
||||
public boolean isGeoPullFtSupported() {
|
||||
return mGeoPullFtSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Geo location Pull using File Transfer as supported or
|
||||
* not supported.
|
||||
*/
|
||||
public void setGeoPullFtSupported(boolean geoPullFtSupported) {
|
||||
this.mGeoPullFtSupported = geoPullFtSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether Geo Pull is supported.
|
||||
*/
|
||||
public boolean isGeoPullSupported() {
|
||||
return mGeoPullSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Geo Pull as supported or not supported.
|
||||
*/
|
||||
public void setGeoPullSupported(boolean geoPullSupported) {
|
||||
this.mGeoPullSupported = geoPullSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether Geo Push is supported.
|
||||
*/
|
||||
public boolean isGeoPushSupported() {
|
||||
return mGeoPushSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Geo Push as supported or not supported.
|
||||
*/
|
||||
public void setGeoPushSupported(boolean geoPushSupported) {
|
||||
this.mGeoPushSupported = geoPushSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether short messaging is supported.
|
||||
*/
|
||||
public boolean isSmSupported() {
|
||||
return mSmSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets short messaging as supported or not supported.
|
||||
*/
|
||||
public void setSmSupported(boolean smSupported) {
|
||||
this.mSmSupported = smSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether store/forward and group chat are supported.
|
||||
*/
|
||||
public boolean isFullSnFGroupChatSupported() {
|
||||
return mFullSnFGroupChatSupported;
|
||||
}
|
||||
|
||||
public boolean isRcsIpVoiceCallSupported() {
|
||||
return mRcsIpVoiceCallSupported;
|
||||
}
|
||||
|
||||
public boolean isRcsIpVideoCallSupported() {
|
||||
return mRcsIpVideoCallSupported;
|
||||
}
|
||||
|
||||
public boolean isRcsIpVideoOnlyCallSupported() {
|
||||
return mRcsIpVideoOnlyCallSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets store/forward and group chat supported or not supported.
|
||||
*/
|
||||
public void setFullSnFGroupChatSupported(boolean fullSnFGroupChatSupported) {
|
||||
this.mFullSnFGroupChatSupported = fullSnFGroupChatSupported;
|
||||
}
|
||||
|
||||
public void setRcsIpVoiceCallSupported(boolean rcsIpVoiceCallSupported) {
|
||||
this.mRcsIpVoiceCallSupported = rcsIpVoiceCallSupported;
|
||||
}
|
||||
public void setRcsIpVideoCallSupported(boolean rcsIpVideoCallSupported) {
|
||||
this.mRcsIpVideoCallSupported = rcsIpVideoCallSupported;
|
||||
}
|
||||
public void setRcsIpVideoOnlyCallSupported(boolean rcsIpVideoOnlyCallSupported) {
|
||||
this.mRcsIpVideoOnlyCallSupported = rcsIpVideoOnlyCallSupported;
|
||||
}
|
||||
|
||||
/** Gets the list of supported extensions. */
|
||||
public String[] getExts() {
|
||||
return mExts;
|
||||
}
|
||||
|
||||
/** Sets the list of supported extensions. */
|
||||
public void setExts(String[] exts) {
|
||||
this.mExts = exts;
|
||||
}
|
||||
|
||||
|
||||
/** Gets the time stamp for when to query again. */
|
||||
public long getCapTimestamp() {
|
||||
return mCapTimestamp;
|
||||
}
|
||||
|
||||
/** Sets the time stamp for when to query again. */
|
||||
public void setCapTimestamp(long capTimestamp) {
|
||||
this.mCapTimestamp = capTimestamp;
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
|
||||
dest.writeInt(mImSupported ? 1 : 0);
|
||||
dest.writeInt(mFtSupported ? 1 : 0);
|
||||
dest.writeInt(mFtThumbSupported ? 1 : 0);
|
||||
dest.writeInt(mFtSnFSupported ? 1 : 0);
|
||||
dest.writeInt(mFtHttpSupported ? 1 : 0);
|
||||
dest.writeInt(mIsSupported ? 1 : 0);
|
||||
dest.writeInt(mVsDuringCSSupported ? 1 : 0);
|
||||
dest.writeInt(mVsSupported ? 1 : 0);
|
||||
dest.writeInt(mSpSupported ? 1 : 0);
|
||||
dest.writeInt(mCdViaPresenceSupported ? 1 : 0);
|
||||
dest.writeInt(mIpVoiceSupported ? 1 : 0);
|
||||
dest.writeInt(mIpVideoSupported ? 1 : 0);
|
||||
dest.writeInt(mGeoPullFtSupported ? 1 : 0);
|
||||
dest.writeInt(mGeoPullSupported ? 1 : 0);
|
||||
dest.writeInt(mGeoPushSupported ? 1 : 0);
|
||||
dest.writeInt(mSmSupported ? 1 : 0);
|
||||
dest.writeInt(mFullSnFGroupChatSupported ? 1 : 0);
|
||||
|
||||
dest.writeInt(mRcsIpVoiceCallSupported ? 1 : 0);
|
||||
dest.writeInt(mRcsIpVideoCallSupported ? 1 : 0);
|
||||
dest.writeInt(mRcsIpVideoOnlyCallSupported ? 1 : 0);
|
||||
dest.writeStringArray(mExts);
|
||||
dest.writeLong(mCapTimestamp);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<CapInfo> CREATOR = new Parcelable.Creator<CapInfo>() {
|
||||
|
||||
public CapInfo createFromParcel(Parcel source) {
|
||||
return new CapInfo(source);
|
||||
}
|
||||
|
||||
public CapInfo[] newArray(int size) {
|
||||
return new CapInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
private CapInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel source) {
|
||||
|
||||
mImSupported = (source.readInt() == 0) ? false : true;
|
||||
mFtSupported = (source.readInt() == 0) ? false : true;
|
||||
mFtThumbSupported = (source.readInt() == 0) ? false : true;
|
||||
mFtSnFSupported = (source.readInt() == 0) ? false : true;
|
||||
mFtHttpSupported = (source.readInt() == 0) ? false : true;
|
||||
mIsSupported = (source.readInt() == 0) ? false : true;
|
||||
mVsDuringCSSupported = (source.readInt() == 0) ? false : true;
|
||||
mVsSupported = (source.readInt() == 0) ? false : true;
|
||||
mSpSupported = (source.readInt() == 0) ? false : true;
|
||||
mCdViaPresenceSupported = (source.readInt() == 0) ? false : true;
|
||||
mIpVoiceSupported = (source.readInt() == 0) ? false : true;
|
||||
mIpVideoSupported = (source.readInt() == 0) ? false : true;
|
||||
mGeoPullFtSupported = (source.readInt() == 0) ? false : true;
|
||||
mGeoPullSupported = (source.readInt() == 0) ? false : true;
|
||||
mGeoPushSupported = (source.readInt() == 0) ? false : true;
|
||||
mSmSupported = (source.readInt() == 0) ? false : true;
|
||||
mFullSnFGroupChatSupported = (source.readInt() == 0) ? false : true;
|
||||
|
||||
mRcsIpVoiceCallSupported = (source.readInt() == 0) ? false : true;
|
||||
mRcsIpVideoCallSupported = (source.readInt() == 0) ? false : true;
|
||||
mRcsIpVideoOnlyCallSupported = (source.readInt() == 0) ? false : true;
|
||||
|
||||
mExts = source.createStringArray();
|
||||
mCapTimestamp = source.readLong();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
parcelable StatusCode;
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
/** Class for UCE status codes.
|
||||
* @hide */
|
||||
public class StatusCode implements Parcelable {
|
||||
|
||||
/**
|
||||
* UCE status code definitions.
|
||||
* @hide
|
||||
*/
|
||||
|
||||
/** Request was processed successfully. */
|
||||
public static final int UCE_SUCCESS = 0;
|
||||
/** Request was processed unsuccessfully. */
|
||||
public static final int UCE_FAILURE = 1;
|
||||
/** Asynchronous request was handled successfully; the final
|
||||
* result will be updated through
|
||||
* callback.
|
||||
*/
|
||||
public static final int UCE_SUCCESS_ASYC_UPDATE = 2;
|
||||
/** Provided service handle is not valid. */
|
||||
public static final int UCE_INVALID_SERVICE_HANDLE = 3;
|
||||
/** Provided listener handler is not valid. */
|
||||
public static final int UCE_INVALID_LISTENER_HANDLE = 4;
|
||||
/** Invalid parameter(s). */
|
||||
public static final int UCE_INVALID_PARAM = 5;
|
||||
/** Fetch error. */
|
||||
public static final int UCE_FETCH_ERROR = 6;
|
||||
/** Request timed out. */
|
||||
public static final int UCE_REQUEST_TIMEOUT = 7;
|
||||
/** Failure due to insufficient memory available. */
|
||||
public static final int UCE_INSUFFICIENT_MEMORY = 8;
|
||||
/** Network connection is lost. */
|
||||
public static final int UCE_LOST_NET = 9;
|
||||
/** Requested feature/resource is not supported. */
|
||||
public static final int UCE_NOT_SUPPORTED = 10;
|
||||
/** Contact or resource is not found. */
|
||||
public static final int UCE_NOT_FOUND = 11;
|
||||
/** Service is not available. */
|
||||
public static final int UCE_SERVICE_UNAVAILABLE = 12;
|
||||
/** No Change in Capabilities */
|
||||
public static final int UCE_NO_CHANGE_IN_CAP = 13;
|
||||
/** Service is unknown. */
|
||||
public static final int UCE_SERVICE_UNKNOWN = 14;
|
||||
|
||||
|
||||
private int mStatusCode = UCE_SUCCESS;
|
||||
|
||||
/**
|
||||
* Constructor for the StatusCode class.
|
||||
* @hide
|
||||
*/
|
||||
public StatusCode() {}
|
||||
|
||||
/**
|
||||
* Gets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public int getStatusCode() {
|
||||
return mStatusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public void setStatusCode(int nStatusCode) {
|
||||
this.mStatusCode = nStatusCode;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mStatusCode);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<StatusCode> CREATOR =
|
||||
new Parcelable.Creator<StatusCode>() {
|
||||
|
||||
public StatusCode createFromParcel(Parcel source) {
|
||||
// TODO Auto-generated method stub
|
||||
return new StatusCode(source);
|
||||
}
|
||||
|
||||
public StatusCode[] newArray(int size) {
|
||||
// TODO Auto-generated method stub
|
||||
return new StatusCode[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private StatusCode(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mStatusCode = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
parcelable UceLong;
|
||||
118
telephony/java/com/android/ims/internal/uce/common/UceLong.java
Normal file
118
telephony/java/com/android/ims/internal/uce/common/UceLong.java
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.common;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
/** Simple object wrapper for a long type.
|
||||
* @hide */
|
||||
public class UceLong implements Parcelable {
|
||||
|
||||
private long mUceLong;
|
||||
private int mClientId = 1001;
|
||||
|
||||
/**
|
||||
* Constructor for the UceLong class.
|
||||
* @hide
|
||||
*/
|
||||
public UceLong() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the long value.
|
||||
* @hide
|
||||
*/
|
||||
public long getUceLong() {
|
||||
return mUceLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the long value.
|
||||
* @hide
|
||||
*/
|
||||
public void setUceLong(long uceLong) {
|
||||
this.mUceLong = uceLong;
|
||||
}
|
||||
|
||||
/** Get the client ID as integer value.
|
||||
* @hide
|
||||
*/
|
||||
public int getClientId() {
|
||||
return mClientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the client ID as integer value.
|
||||
* @hide
|
||||
*/
|
||||
public void setClientId(int nClientId) {
|
||||
this.mClientId = nClientId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the instance of a UceLong class.
|
||||
* @hide
|
||||
*/
|
||||
public static UceLong getUceLongInstance() {
|
||||
return new UceLong();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcel(dest);
|
||||
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
private void writeToParcel(Parcel out) {
|
||||
out.writeLong(mUceLong);
|
||||
out.writeInt(mClientId);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<UceLong> CREATOR =
|
||||
new Parcelable.Creator<UceLong>() {
|
||||
|
||||
public UceLong createFromParcel(Parcel source) {
|
||||
return new UceLong(source);
|
||||
}
|
||||
|
||||
public UceLong[] newArray(int size) {
|
||||
return new UceLong[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private UceLong(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mUceLong = source.readLong();
|
||||
mClientId = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
import com.android.ims.internal.uce.options.OptionsSipResponse;
|
||||
import com.android.ims.internal.uce.options.OptionsCapInfo;
|
||||
import com.android.ims.internal.uce.options.OptionsCmdStatus;
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
|
||||
/** {@hide} */
|
||||
interface IOptionsListener
|
||||
{
|
||||
/**
|
||||
* Callback invoked with the version information of Options service implementation.
|
||||
* @param version, version information of the service.
|
||||
* @hide
|
||||
*/
|
||||
void getVersionCb(in String version );
|
||||
|
||||
/**
|
||||
* Callback function to be invoked by the Options service to notify the listener of service
|
||||
* availability.
|
||||
* @param statusCode, UCE_SUCCESS as service availability.
|
||||
* @hide
|
||||
*/
|
||||
void serviceAvailable(in StatusCode statusCode);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked by the Options service to notify the listener of service
|
||||
* unavailability.
|
||||
* @param statusCode, UCE_SUCCESS as service unavailability.
|
||||
* @hide
|
||||
*/
|
||||
void serviceUnavailable(in StatusCode statusCode);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client when the response for a SIP OPTIONS
|
||||
* has been received.
|
||||
* @param uri, URI of the remote entity received in network response.
|
||||
* @param sipResponse, data of the network response received.
|
||||
* @param capInfo, capabilities of the remote entity received.
|
||||
* @hide
|
||||
*/
|
||||
void sipResponseReceived( String uri,
|
||||
in OptionsSipResponse sipResponse, in OptionsCapInfo capInfo);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client of the status of an asynchronous call.
|
||||
* @param cmdStatus, command status of the request placed.
|
||||
* @hide
|
||||
*/
|
||||
void cmdStatus(in OptionsCmdStatus cmdStatus);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client of an incoming OPTIONS request
|
||||
* from the network.
|
||||
* @param uri, URI of the remote entity received.
|
||||
* @param capInfo, capabilities of the remote entity.
|
||||
* @param tID, transation of the request received from network.
|
||||
* @hide
|
||||
*/
|
||||
void incomingOptions( String uri, in OptionsCapInfo capInfo,
|
||||
in int tID);
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
import com.android.ims.internal.uce.options.IOptionsListener;
|
||||
import com.android.ims.internal.uce.options.OptionsCapInfo;
|
||||
import com.android.ims.internal.uce.common.CapInfo;
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
import com.android.ims.internal.uce.common.UceLong;
|
||||
|
||||
/** {@hide} */
|
||||
interface IOptionsService
|
||||
{
|
||||
|
||||
/**
|
||||
* Gets the version of the Options service implementation.
|
||||
* the result of this Call is received in getVersionCb
|
||||
* @param optionsServiceHandle, received in serviceCreated() of IOptionsListener.
|
||||
* @return StatusCode, status of the request placed.
|
||||
* @hide
|
||||
*/
|
||||
StatusCode getVersion(int optionsServiceHandle);
|
||||
|
||||
/**
|
||||
* Adds a listener to the Options service.
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param optionsListener, IOptionsListener object.
|
||||
* @param optionsServiceListenerHdl wrapper for client's listener handle to be stored.
|
||||
*
|
||||
* The service will fill UceLong.mUceLong with optionsServiceListenerHdl
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode addListener(int optionsServiceHandle, IOptionsListener optionsListener,
|
||||
inout UceLong optionsServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Removes a listener from the Options service.
|
||||
* @param optionsServiceHandle, received in serviceCreated() of IOptionsListener.
|
||||
* @param optionsListenerHandle, received in serviceCreated() of IOptionsListener.
|
||||
* @param optionsServiceListenerHdl provided in createOptionsService() or Addlistener().
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode removeListener(int optionsServiceHandle, in UceLong optionsServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Sets the capabilities information of the self device.
|
||||
* The status of the call is received in cmdStatus callback
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param capInfo, capability information to store.
|
||||
* @param reqUserData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode setMyInfo(int optionsServiceHandle , in CapInfo capInfo, int reqUserData);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the capabilities information of remote device.
|
||||
* The Capability information is received in cmdStatus callback
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param reqUserData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getMyInfo(int optionsServiceHandle , int reqUserdata);
|
||||
|
||||
/**
|
||||
* Requests the capabilities information of a remote URI.
|
||||
* the remote party capability is received in sipResponseReceived() callback.
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param remoteURI, URI of the remote contact.
|
||||
* @param reqUserData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getContactCap(int optionsServiceHandle , String remoteURI, int reqUserData);
|
||||
|
||||
|
||||
/**
|
||||
* Requests the capabilities information of specified contacts.
|
||||
* For each remote party capability is received in sipResponseReceived() callback
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param remoteURIList, list of remote contact URI's.
|
||||
* @param reqUserData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getContactListCap(int optionsServiceHandle, in String[] remoteURIList,
|
||||
int reqUserData);
|
||||
|
||||
|
||||
/**
|
||||
* Requests the capabilities information of specified contacts.
|
||||
* The incoming Options request is received in incomingOptions() callback.
|
||||
*
|
||||
* @param optionsServiceHandle, this returned in serviceCreated() of IOptionsListener.
|
||||
* @param tId, transaction ID received in incomingOptions() call of IOptionsListener.
|
||||
* @param sipResponseCode, SIP response code the UE needs to share to network.
|
||||
* @param reasonPhrase, response phrase corresponding to the response code.
|
||||
* @param capInfo, capabilities to share in the resonse to network.
|
||||
* @param bContactInBL, true if the contact is blacklisted, else false.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode responseIncomingOptions(int optionsServiceHandle, int tId, int sipResponseCode,
|
||||
String reasonPhrase, in OptionsCapInfo capInfo,
|
||||
in boolean bContactInBL);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
parcelable OptionsCapInfo;
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
import com.android.ims.internal.uce.common.CapInfo;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
/** @hide */
|
||||
public class OptionsCapInfo implements Parcelable {
|
||||
|
||||
private String mSdp = ""; // SDP message body. It is client responsibility.
|
||||
private CapInfo mCapInfo;
|
||||
|
||||
public static OptionsCapInfo getOptionsCapInfoInstance() {
|
||||
return new OptionsCapInfo();
|
||||
}
|
||||
|
||||
public String getSdp() {
|
||||
return mSdp;
|
||||
}
|
||||
|
||||
public void setSdp(String sdp) {
|
||||
this.mSdp = sdp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the OptionsCapInfo class.
|
||||
*/
|
||||
public OptionsCapInfo() {
|
||||
mCapInfo = new CapInfo();
|
||||
};
|
||||
|
||||
public CapInfo getCapInfo() {
|
||||
return mCapInfo;
|
||||
}
|
||||
/**
|
||||
* Sets the CapInfo
|
||||
*/
|
||||
public void setCapInfo(CapInfo capInfo) {
|
||||
this.mCapInfo = capInfo;
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mSdp);
|
||||
dest.writeParcelable(mCapInfo, flags);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<OptionsCapInfo> CREATOR =
|
||||
new Parcelable.Creator<OptionsCapInfo>() {
|
||||
|
||||
public OptionsCapInfo createFromParcel(Parcel source) {
|
||||
return new OptionsCapInfo(source);
|
||||
}
|
||||
|
||||
public OptionsCapInfo[] newArray(int size) {
|
||||
return new OptionsCapInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
private OptionsCapInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel source) {
|
||||
mSdp = source.readString();
|
||||
mCapInfo = source.readParcelable(CapInfo.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
parcelable OptionsCmdId;
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class OptionsCmdId implements Parcelable {
|
||||
|
||||
/** UCE CD command ID types */
|
||||
|
||||
/** Command ID corresponding to API GetMyInfo(). */
|
||||
public static final int UCE_OPTIONS_CMD_GETMYCDINFO = 0;
|
||||
/** Command ID corresponding to API SetMyInfo(). */
|
||||
public static final int UCE_OPTIONS_CMD_SETMYCDINFO = 1;
|
||||
/** Command ID corresponding to API GetContactCap(). */
|
||||
public static final int UCE_OPTIONS_CMD_GETCONTACTCAP = 2;
|
||||
/** Command ID corresponding to API GetContactListCap(). */
|
||||
public static final int UCE_OPTIONS_CMD_GETCONTACTLISTCAP = 3;
|
||||
/** Command ID corresponding to API ResponseIncomingOptions(). */
|
||||
public static final int UCE_OPTIONS_CMD_RESPONSEINCOMINGOPTIONS = 4;
|
||||
/** Command ID corresponding to API GetVersion(). */
|
||||
public static final int UCE_OPTIONS_CMD_GET_VERSION = 5;
|
||||
/** Default Command ID as Unknown. */
|
||||
public static final int UCE_OPTIONS_CMD_UNKNOWN = 6;
|
||||
|
||||
|
||||
private int mCmdId = UCE_OPTIONS_CMD_UNKNOWN;
|
||||
|
||||
/**
|
||||
* Gets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public int getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(int nCmdId) {
|
||||
this.mCmdId = nCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the OptionsCDCmdId class.
|
||||
* @hide
|
||||
*/
|
||||
public OptionsCmdId(){};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mCmdId);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<OptionsCmdId> CREATOR =
|
||||
new Parcelable.Creator<OptionsCmdId>() {
|
||||
public OptionsCmdId createFromParcel(Parcel source) {
|
||||
return new OptionsCmdId(source);
|
||||
}
|
||||
|
||||
public OptionsCmdId[] newArray(int size) {
|
||||
return new OptionsCmdId[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private OptionsCmdId(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mCmdId = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
parcelable OptionsCmdStatus;
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
import com.android.ims.internal.uce.common.CapInfo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class OptionsCmdStatus implements Parcelable {
|
||||
|
||||
private OptionsCmdId mCmdId;
|
||||
private StatusCode mStatus;
|
||||
private int mUserData;
|
||||
private CapInfo mCapInfo;
|
||||
|
||||
/**
|
||||
* Gets the UCE command ID.
|
||||
* @hide
|
||||
*/
|
||||
public OptionsCmdId getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
/**
|
||||
* Sets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(OptionsCmdId cmdId) {
|
||||
this.mCmdId = cmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user data.
|
||||
* @hide
|
||||
*/
|
||||
public int getUserData() {
|
||||
return mUserData;
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the user data.
|
||||
@hide */
|
||||
public void setUserData(int userData) {
|
||||
this.mUserData = userData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public StatusCode getStatus() {
|
||||
return mStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public void setStatus(StatusCode status) {
|
||||
this.mStatus = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the OptionsCmdStatus class.
|
||||
* @hide
|
||||
*/
|
||||
public OptionsCmdStatus() {
|
||||
mStatus = new StatusCode();
|
||||
mCapInfo = new CapInfo();
|
||||
mCmdId = new OptionsCmdId();
|
||||
mUserData = 0;
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public CapInfo getCapInfo() {
|
||||
return mCapInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the CapInfo
|
||||
* @hide
|
||||
*/
|
||||
public void setCapInfo(CapInfo capInfo) {
|
||||
this.mCapInfo = capInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instance of the OptionsCmdStatus class.
|
||||
* @hide
|
||||
*/
|
||||
public static OptionsCmdStatus getOptionsCmdStatusInstance() {
|
||||
return new OptionsCmdStatus();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mUserData);
|
||||
dest.writeParcelable(mCmdId, flags);
|
||||
dest.writeParcelable(mStatus, flags);
|
||||
dest.writeParcelable(mCapInfo, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<OptionsCmdStatus> CREATOR =
|
||||
new Parcelable.Creator<OptionsCmdStatus>() {
|
||||
public OptionsCmdStatus createFromParcel(Parcel source) {
|
||||
return new OptionsCmdStatus(source);
|
||||
}
|
||||
public OptionsCmdStatus[] newArray(int size) {
|
||||
return new OptionsCmdStatus[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private OptionsCmdStatus(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mUserData = source.readInt();
|
||||
mCmdId = source.readParcelable(OptionsCmdId.class.getClassLoader());
|
||||
mStatus = source.readParcelable(StatusCode.class.getClassLoader());
|
||||
mCapInfo = source.readParcelable(CapInfo.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
parcelable OptionsSipResponse;
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.options;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
|
||||
/** @hide */
|
||||
public class OptionsSipResponse implements Parcelable {
|
||||
|
||||
private OptionsCmdId mCmdId;
|
||||
private int mRequestId = 0;
|
||||
private int mSipResponseCode = 0;
|
||||
private int mRetryAfter = 0;
|
||||
private String mReasonPhrase = "";
|
||||
|
||||
/**
|
||||
* Gets the Options command ID.
|
||||
* @hide
|
||||
*/
|
||||
public OptionsCmdId getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Options command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(OptionsCmdId cmdId) {
|
||||
this.mCmdId = cmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request ID
|
||||
* @hide
|
||||
*/
|
||||
public int getRequestId() {
|
||||
return mRequestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the request ID
|
||||
* @hide
|
||||
*/
|
||||
public void setRequestId(int requestId) {
|
||||
this.mRequestId = requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SIP response code.
|
||||
* @hide
|
||||
*/
|
||||
public int getSipResponseCode() {
|
||||
return mSipResponseCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP response code.
|
||||
* @hide
|
||||
*/
|
||||
public void setSipResponseCode(int sipResponseCode) {
|
||||
this.mSipResponseCode = sipResponseCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reason phrase associated with the SIP responce code.
|
||||
* @hide
|
||||
*/
|
||||
public String getReasonPhrase() {
|
||||
return mReasonPhrase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP response code reason phrase.
|
||||
* @hide
|
||||
*/
|
||||
public void setReasonPhrase(String reasonPhrase) {
|
||||
this.mReasonPhrase = reasonPhrase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SIP retryAfter sec value .
|
||||
* @hide
|
||||
*/
|
||||
public int getRetryAfter() {
|
||||
return mRetryAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP retryAfter sec value
|
||||
* @hide
|
||||
*/
|
||||
public void setRetryAfter(int retryAfter) {
|
||||
this.mRetryAfter = retryAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the OptionsSipResponse class.
|
||||
* @hide
|
||||
*/
|
||||
public OptionsSipResponse() {
|
||||
mCmdId = new OptionsCmdId();
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
|
||||
dest.writeInt(mRequestId);
|
||||
dest.writeInt(mSipResponseCode);
|
||||
dest.writeString(mReasonPhrase);
|
||||
dest.writeParcelable(mCmdId, flags);
|
||||
dest.writeInt(mRetryAfter);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<OptionsSipResponse> CREATOR =
|
||||
new Parcelable.Creator<OptionsSipResponse>() {
|
||||
public OptionsSipResponse createFromParcel(Parcel source) {
|
||||
return new OptionsSipResponse(source);
|
||||
}
|
||||
|
||||
public OptionsSipResponse[] newArray(int size) {
|
||||
return new OptionsSipResponse[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private OptionsSipResponse(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mRequestId = source.readInt();
|
||||
mSipResponseCode = source.readInt();
|
||||
mReasonPhrase = source.readString();
|
||||
mCmdId = source.readParcelable(OptionsCmdId.class.getClassLoader());
|
||||
mRetryAfter = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
import com.android.ims.internal.uce.presence.PresPublishTriggerType;
|
||||
import com.android.ims.internal.uce.presence.PresCmdStatus;
|
||||
import com.android.ims.internal.uce.presence.PresCapInfo;
|
||||
import com.android.ims.internal.uce.presence.PresSipResponse;
|
||||
import com.android.ims.internal.uce.presence.PresTupleInfo;
|
||||
import com.android.ims.internal.uce.presence.PresResInstanceInfo;
|
||||
import com.android.ims.internal.uce.presence.PresResInfo;
|
||||
import com.android.ims.internal.uce.presence.PresRlmiInfo;
|
||||
|
||||
|
||||
/**
|
||||
* IPresenceListener
|
||||
* {@hide} */
|
||||
interface IPresenceListener
|
||||
{
|
||||
/**
|
||||
* Gets the version of the presence listener implementation.
|
||||
* @param version, version information.
|
||||
*/
|
||||
void getVersionCb(in String version );
|
||||
|
||||
/**
|
||||
* Callback function to be invoked by the Presence service to notify the listener of service
|
||||
* availability.
|
||||
* @param statusCode, UCE_SUCCESS as service availability.
|
||||
*/
|
||||
void serviceAvailable(in StatusCode statusCode);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked by the Presence service to notify the listener of service
|
||||
* unavailability.
|
||||
* @param statusCode, UCE_SUCCESS as service unAvailability.
|
||||
*/
|
||||
void serviceUnAvailable(in StatusCode statusCode);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked by the Presence service to notify the listener to send a
|
||||
* publish request.
|
||||
* @param publishTrigger, Publish trigger for the network being supported.
|
||||
*/
|
||||
void publishTriggering(in PresPublishTriggerType publishTrigger);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client of the status of an asynchronous call.
|
||||
* @param cmdStatus, command status of the request placed.
|
||||
*/
|
||||
void cmdStatus( in PresCmdStatus cmdStatus);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client when the response for a SIP message,
|
||||
* such as PUBLISH or SUBSCRIBE, has been received.
|
||||
* @param sipResponse, network response received for the request placed.
|
||||
*/
|
||||
void sipResponseReceived(in PresSipResponse sipResponse);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client when the NOTIFY message carrying a
|
||||
* single contact's capabilities information is received.
|
||||
* @param presentityURI, URI of the remote entity the request was placed.
|
||||
* @param tupleInfo, array of capability information remote entity supports.
|
||||
*/
|
||||
void capInfoReceived(in String presentityURI,
|
||||
in PresTupleInfo [] tupleInfo);
|
||||
|
||||
/**
|
||||
* Callback function to be invoked to inform the client when the NOTIFY message carrying
|
||||
* contact's capabilities information is received.
|
||||
* @param rlmiInfo, resource infomation received from network.
|
||||
* @param resInfo, array of capabilities received from network for the list of remore URI.
|
||||
*/
|
||||
void listCapInfoReceived(in PresRlmiInfo rlmiInfo,
|
||||
in PresResInfo [] resInfo);
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import com.android.ims.internal.uce.presence.IPresenceListener;
|
||||
import com.android.ims.internal.uce.presence.PresCapInfo;
|
||||
import com.android.ims.internal.uce.presence.PresServiceInfo;
|
||||
import com.android.ims.internal.uce.common.UceLong;
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
|
||||
/** IPresenceService
|
||||
{@hide} */
|
||||
interface IPresenceService
|
||||
{
|
||||
|
||||
/**
|
||||
* Gets the version of the Presence service implementation.
|
||||
* The verion information is received in getVersionCb callback.
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getVersion(int presenceServiceHdl);
|
||||
|
||||
/**
|
||||
* Adds a listener to the Presence service.
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param presenceServiceListener IPresenceListener Object.
|
||||
* @param presenceServiceListenerHdl wrapper for client's listener handle to be stored.
|
||||
*
|
||||
* The service will fill UceLong.mUceLong with presenceListenerHandle.
|
||||
*
|
||||
* @return StatusCode, status of the request placed
|
||||
*/
|
||||
StatusCode addListener(int presenceServiceHdl, IPresenceListener presenceServiceListener,
|
||||
inout UceLong presenceServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Removes a listener from the Presence service.
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param presenceServiceListenerHdl provided in createPresenceService() or Addlistener().
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode removeListener(int presenceServiceHdl, in UceLong presenceServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Re-enables the Presence service if it is in the Blocked state due to receiving a SIP
|
||||
* response 489 Bad event.
|
||||
* The application must call this API before calling any presence API after receiving a SIP
|
||||
* response 489 Bad event.
|
||||
* The status of this request is notified in cmdStatus callback.
|
||||
*
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param userData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode reenableService(int presenceServiceHdl, int userData);
|
||||
|
||||
/**
|
||||
* Sends a request to publish current device capabilities.
|
||||
* The network response is notifed in sipResponseReceived() callback.
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param myCapInfo PresCapInfo object.
|
||||
* @param userData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode publishMyCap(int presenceServiceHdl, in PresCapInfo myCapInfo , int userData);
|
||||
|
||||
/**
|
||||
* Retrieves the capability information for a single contact. Clients receive the requested
|
||||
* information via the listener callback function capInfoReceived() callback.
|
||||
*
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param remoteUri remote contact URI
|
||||
* @param userData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getContactCap(int presenceServiceHdl , String remoteUri, int userData);
|
||||
|
||||
/**
|
||||
* Retrieves the capability information for a list of contacts. Clients receive the requested
|
||||
* information via the listener callback function listCapInfoReceived() callback.
|
||||
*
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param remoteUriList list of remote contact URI's.
|
||||
* @param userData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode getContactListCap(int presenceServiceHdl, in String[] remoteUriList, int userData);
|
||||
|
||||
/**
|
||||
* Sets the mapping between a new feature tag and the corresponding service tuple information
|
||||
* to be included in the published document.
|
||||
* The staus of this call is received in cmdStatus callback.
|
||||
*
|
||||
* @param presenceServiceHdl returned in createPresenceService().
|
||||
* @param featureTag to be supported
|
||||
* @param PresServiceInfo service information describing the featureTag.
|
||||
* @param userData, userData provided by client to identify the request/API call, it
|
||||
* is returned in the cmdStatus() callback for client to match response
|
||||
* with original request.
|
||||
* @return StatusCode, status of the request placed.
|
||||
*/
|
||||
StatusCode setNewFeatureTag(int presenceServiceHdl, String featureTag,
|
||||
in PresServiceInfo serviceInfo, int userData);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresCapInfo;
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import com.android.ims.internal.uce.common.CapInfo;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
|
||||
/** @hide */
|
||||
public class PresCapInfo implements Parcelable {
|
||||
|
||||
private CapInfo mCapInfo;
|
||||
private String mContactUri = "";
|
||||
|
||||
/**
|
||||
* Gets the UCE capability information.
|
||||
* @hide
|
||||
*/
|
||||
public CapInfo getCapInfo() {
|
||||
return mCapInfo;
|
||||
}
|
||||
|
||||
/** Sets the UCE Capability information.
|
||||
* @hide
|
||||
*/
|
||||
public void setCapInfo(CapInfo capInfo) {
|
||||
this.mCapInfo = capInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the contact URI.
|
||||
* @hide
|
||||
*/
|
||||
public String getContactUri() {
|
||||
return mContactUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the contact URI.
|
||||
* @hide
|
||||
*/
|
||||
public void setContactUri(String contactUri) {
|
||||
this.mContactUri = contactUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresCapInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresCapInfo() {
|
||||
mCapInfo = new CapInfo();
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mContactUri);
|
||||
dest.writeParcelable(mCapInfo, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresCapInfo> CREATOR =
|
||||
new Parcelable.Creator<PresCapInfo>() {
|
||||
|
||||
public PresCapInfo createFromParcel(Parcel source) {
|
||||
return new PresCapInfo(source);
|
||||
}
|
||||
|
||||
public PresCapInfo[] newArray(int size) {
|
||||
return new PresCapInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresCapInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mContactUri = source.readString();
|
||||
mCapInfo = source.readParcelable(CapInfo.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresCmdID;
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresCmdId implements Parcelable {
|
||||
|
||||
/** Presence Command Status ID
|
||||
* @hide */
|
||||
|
||||
|
||||
/** Command ID corresponding to function GetVersion(). */
|
||||
public static final int UCE_PRES_CMD_GET_VERSION = 0;
|
||||
/** Command ID corresponding to function Publish(). */
|
||||
public static final int UCE_PRES_CMD_PUBLISHMYCAP = 1;
|
||||
/** Command ID corresponding to function GetContactCap(). */
|
||||
public static final int UCE_PRES_CMD_GETCONTACTCAP = 2;
|
||||
/** Command ID corresponding to function GetContactListCap(). */
|
||||
public static final int UCE_PRES_CMD_GETCONTACTLISTCAP = 3;
|
||||
/** Command ID corresponding to function SetNewFeatureTag(). */
|
||||
public static final int UCE_PRES_CMD_SETNEWFEATURETAG = 4;
|
||||
/** Command ID corresponding to API ReenableService(). */
|
||||
public static final int UCE_PRES_CMD_REENABLE_SERVICE = 5;
|
||||
/** Command ID is unknown. */
|
||||
public static final int UCE_PRES_CMD_UNKNOWN = 6;
|
||||
|
||||
|
||||
private int mCmdId = UCE_PRES_CMD_UNKNOWN;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public int getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(int nCmdId) {
|
||||
this.mCmdId = nCmdId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the PresCmdId class.
|
||||
* @hide
|
||||
*/
|
||||
public PresCmdId(){};
|
||||
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mCmdId);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresCmdId> CREATOR =
|
||||
new Parcelable.Creator<PresCmdId>() {
|
||||
|
||||
public PresCmdId createFromParcel(Parcel source) {
|
||||
|
||||
return new PresCmdId(source);
|
||||
}
|
||||
|
||||
public PresCmdId[] newArray(int size) {
|
||||
|
||||
return new PresCmdId[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresCmdId(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mCmdId = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresCmdStatus;
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
|
||||
/** @hide */
|
||||
public class PresCmdStatus implements Parcelable{
|
||||
|
||||
private PresCmdId mCmdId = new PresCmdId();
|
||||
private StatusCode mStatus = new StatusCode();
|
||||
private int mUserData;
|
||||
private int mRequestId;
|
||||
|
||||
/**
|
||||
* Gets the Presence command ID.
|
||||
* @hide
|
||||
*/
|
||||
public PresCmdId getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(PresCmdId cmdId) {
|
||||
this.mCmdId = cmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user data.
|
||||
* @hide
|
||||
*/
|
||||
public int getUserData() {
|
||||
return mUserData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user data.
|
||||
* @hide
|
||||
*/
|
||||
public void setUserData(int userData) {
|
||||
this.mUserData = userData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public StatusCode getStatus() {
|
||||
return mStatus;
|
||||
}
|
||||
/**
|
||||
* Sets the status code.
|
||||
* @hide
|
||||
*/
|
||||
public void setStatus(StatusCode status) {
|
||||
this.mStatus = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request ID.
|
||||
* @hide
|
||||
*/
|
||||
public int getRequestId() {
|
||||
return mRequestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the request ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setRequestId(int requestId) {
|
||||
this.mRequestId = requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresCmdStatus class.
|
||||
* @hide
|
||||
*/
|
||||
public PresCmdStatus() {
|
||||
mStatus = new StatusCode();
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mUserData);
|
||||
dest.writeInt(mRequestId);
|
||||
dest.writeParcelable(mCmdId, flags);
|
||||
dest.writeParcelable(mStatus, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresCmdStatus> CREATOR =
|
||||
new Parcelable.Creator<PresCmdStatus>() {
|
||||
|
||||
public PresCmdStatus createFromParcel(Parcel source) {
|
||||
|
||||
return new PresCmdStatus(source);
|
||||
}
|
||||
|
||||
public PresCmdStatus[] newArray(int size) {
|
||||
|
||||
return new PresCmdStatus[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresCmdStatus(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mUserData = source.readInt();
|
||||
mRequestId = source.readInt();
|
||||
mCmdId = source.readParcelable(PresCmdId.class.getClassLoader());
|
||||
mStatus = source.readParcelable(StatusCode.class.getClassLoader());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresPublishTriggerType;
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresPublishTriggerType implements Parcelable {
|
||||
|
||||
/** Publish Trigger Indication Definitions
|
||||
* @hide
|
||||
*/
|
||||
|
||||
/** ETag expired. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_ETAG_EXPIRED = 0;
|
||||
/** Move to LTE with VoPS disabled. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_LTE_VOPS_DISABLED = 1;
|
||||
/** Move to LTE with VoPS enabled. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_LTE_VOPS_ENABLED = 2;
|
||||
/** Move to eHRPD. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_EHRPD = 3;
|
||||
/** Move to HSPA+. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_HSPAPLUS = 4;
|
||||
/** Move to 3G. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_3G = 5;
|
||||
/** Move to 2G. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_2G = 6;
|
||||
/** Move to WLAN */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_WLAN = 7;
|
||||
/** Move to IWLAN */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_MOVE_TO_IWLAN = 8;
|
||||
/** Trigger is unknown. */
|
||||
public static final int UCE_PRES_PUBLISH_TRIGGER_UNKNOWN = 9;
|
||||
|
||||
|
||||
|
||||
|
||||
private int mPublishTriggerType = UCE_PRES_PUBLISH_TRIGGER_UNKNOWN;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the publish trigger types.
|
||||
* @hide
|
||||
*/
|
||||
public int getPublishTrigeerType() {
|
||||
return mPublishTriggerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the publish trigger type.
|
||||
* @hide
|
||||
*/
|
||||
public void setPublishTrigeerType(int nPublishTriggerType) {
|
||||
this.mPublishTriggerType = nPublishTriggerType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the PresPublishTriggerType class.
|
||||
* @hide
|
||||
*/
|
||||
public PresPublishTriggerType(){};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mPublishTriggerType);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresPublishTriggerType> CREATOR =
|
||||
new Parcelable.Creator<PresPublishTriggerType>() {
|
||||
|
||||
public PresPublishTriggerType createFromParcel(Parcel source) {
|
||||
|
||||
return new PresPublishTriggerType(source);
|
||||
}
|
||||
|
||||
public PresPublishTriggerType[] newArray(int size) {
|
||||
|
||||
return new PresPublishTriggerType[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresPublishTriggerType(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mPublishTriggerType = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresResInfo;
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresResInfo implements Parcelable {
|
||||
|
||||
private String mResUri = "";
|
||||
private String mDisplayName = "";
|
||||
private PresResInstanceInfo mInstanceInfo;
|
||||
|
||||
/**
|
||||
* Gets the Presence service resource instance information.
|
||||
* @hide
|
||||
*/
|
||||
public PresResInstanceInfo getInstanceInfo() {
|
||||
return mInstanceInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Presence service resource instance information.
|
||||
* @hide
|
||||
*/
|
||||
public void setInstanceInfo(PresResInstanceInfo instanceInfo) {
|
||||
this.mInstanceInfo = instanceInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the resource URI.
|
||||
* @hide
|
||||
*/
|
||||
public String getResUri() {
|
||||
return mResUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the resource URI.
|
||||
* @hide
|
||||
*/
|
||||
public void setResUri(String resUri) {
|
||||
this.mResUri = resUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display name.
|
||||
* @hide
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return mDisplayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the display name.
|
||||
* @hide
|
||||
*/
|
||||
public void setDisplayName(String displayName) {
|
||||
this.mDisplayName = displayName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the PresResInstanceInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresResInfo() {
|
||||
mInstanceInfo = new PresResInstanceInfo();
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mResUri);
|
||||
dest.writeString(mDisplayName);
|
||||
dest.writeParcelable(mInstanceInfo, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresResInfo> CREATOR =
|
||||
new Parcelable.Creator<PresResInfo>() {
|
||||
public PresResInfo createFromParcel(Parcel source) {
|
||||
return new PresResInfo(source);
|
||||
}
|
||||
|
||||
public PresResInfo[] newArray(int size) {
|
||||
return new PresResInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresResInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mResUri = source.readString();
|
||||
mDisplayName = source.readString();
|
||||
mInstanceInfo = source.readParcelable(PresResInstanceInfo.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresResInstanceInfo;
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.util.Arrays;
|
||||
|
||||
/** @hide */
|
||||
public class PresResInstanceInfo implements Parcelable{
|
||||
|
||||
/**
|
||||
* UCE resource instance state definitions.
|
||||
* @hide
|
||||
*/
|
||||
|
||||
/** Active state. */
|
||||
public static final int UCE_PRES_RES_INSTANCE_STATE_ACTIVE = 0;
|
||||
/** Pending state. */
|
||||
public static final int UCE_PRES_RES_INSTANCE_STATE_PENDING = 1;
|
||||
/** Terminated state. */
|
||||
public static final int UCE_PRES_RES_INSTANCE_STATE_TERMINATED = 2;
|
||||
/** Unknown state. */
|
||||
public static final int UCE_PRES_RES_INSTANCE_STATE_UNKNOWN = 3;
|
||||
/** Unknown instance. */
|
||||
public static final int UCE_PRES_RES_INSTANCE_UNKNOWN = 4;
|
||||
|
||||
|
||||
private int mResInstanceState;
|
||||
private String mId = "";
|
||||
private String mReason = "";
|
||||
private String mPresentityUri = "";
|
||||
private PresTupleInfo mTupleInfoArray[];
|
||||
|
||||
|
||||
/**
|
||||
* Gets the resource instance state.
|
||||
* @hide
|
||||
*/
|
||||
public int getResInstanceState() {
|
||||
return mResInstanceState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the resource instance state.
|
||||
* @hide
|
||||
*/
|
||||
public void setResInstanceState(int nResInstanceState) {
|
||||
this.mResInstanceState = nResInstanceState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the resource ID.
|
||||
* @hide
|
||||
*/
|
||||
public String getResId() {
|
||||
return mId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the resource ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setResId(String resourceId) {
|
||||
this.mId = resourceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reason phrase associated with the SIP response
|
||||
* code.
|
||||
* @hide
|
||||
*/
|
||||
public String getReason() {
|
||||
return mReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the reason phrase associated with the SIP response
|
||||
* code.
|
||||
* @hide
|
||||
*/
|
||||
public void setReason(String reason) {
|
||||
this.mReason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the entity URI.
|
||||
* @hide
|
||||
*/
|
||||
public String getPresentityUri() {
|
||||
return mPresentityUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the entity URI.
|
||||
* @hide
|
||||
*/
|
||||
public void setPresentityUri(String presentityUri) {
|
||||
this.mPresentityUri = presentityUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the tuple information.
|
||||
* @hide
|
||||
*/
|
||||
public PresTupleInfo[] getTupleInfo() {
|
||||
return mTupleInfoArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tuple information.
|
||||
* @hide
|
||||
*/
|
||||
public void setTupleInfo(PresTupleInfo[] tupleInfo) {
|
||||
this.mTupleInfoArray = new PresTupleInfo[tupleInfo.length];
|
||||
this.mTupleInfoArray = tupleInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the PresResInstanceInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresResInstanceInfo(){
|
||||
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mId);
|
||||
dest.writeString(mReason);
|
||||
dest.writeInt(mResInstanceState);
|
||||
dest.writeString(mPresentityUri);
|
||||
dest.writeParcelableArray(mTupleInfoArray, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresResInstanceInfo> CREATOR =
|
||||
new Parcelable.Creator<PresResInstanceInfo>() {
|
||||
|
||||
public PresResInstanceInfo createFromParcel(Parcel source) {
|
||||
|
||||
return new PresResInstanceInfo(source);
|
||||
}
|
||||
|
||||
public PresResInstanceInfo[] newArray(int size) {
|
||||
|
||||
return new PresResInstanceInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresResInstanceInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mId = source.readString();
|
||||
mReason = source.readString();
|
||||
mResInstanceState = source.readInt();
|
||||
mPresentityUri = source.readString();
|
||||
Parcelable[] tempParcelableArray = source.readParcelableArray(
|
||||
PresTupleInfo.class.getClassLoader());
|
||||
mTupleInfoArray = new PresTupleInfo[] {};
|
||||
if(tempParcelableArray != null) {
|
||||
mTupleInfoArray = Arrays.copyOf(tempParcelableArray, tempParcelableArray.length,
|
||||
PresTupleInfo[].class);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresRlmiInfo;
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresRlmiInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* uri corresponding to the list. Typically, this is the URI to
|
||||
* which the SUBSCRIBE request was sent.
|
||||
*/
|
||||
private String mUri = "";
|
||||
/** list version number from 0 to 2^32-1 */
|
||||
private int mVersion;
|
||||
/**
|
||||
* Indicate whether the NOTIFY message contains information for
|
||||
* every resource in the list
|
||||
*/
|
||||
private boolean mFullState;
|
||||
/** list name */
|
||||
private String mListName = "";
|
||||
/**
|
||||
* unique request ID used to match NOTIFY with original list
|
||||
* SUBSCRIBE
|
||||
*/
|
||||
private int mRequestId;
|
||||
/** subscription state*/
|
||||
private PresSubscriptionState mPresSubscriptionState;
|
||||
/** active subscription expires time in second */
|
||||
private int mSubscriptionExpireTime;
|
||||
/** list subscrption terminated reason */
|
||||
private String mSubscriptionTerminatedReason;
|
||||
|
||||
/**
|
||||
* Gets the URI.
|
||||
* @hide
|
||||
*/
|
||||
public String getUri() {
|
||||
return mUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the URI.
|
||||
* @hide
|
||||
*/
|
||||
public void setUri(String uri) {
|
||||
this.mUri = uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version.
|
||||
* @hide
|
||||
*/
|
||||
public int getVersion() {
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version.
|
||||
* @hide
|
||||
*/
|
||||
public void setVersion(int version) {
|
||||
this.mVersion = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the RLMI state.
|
||||
* @hide
|
||||
*/
|
||||
public boolean isFullState() {
|
||||
return mFullState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RLMI state.
|
||||
* @hide
|
||||
*/
|
||||
public void setFullState(boolean fullState) {
|
||||
this.mFullState = fullState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the RLMI list name.
|
||||
* @hide
|
||||
*/
|
||||
public String getListName() {
|
||||
return mListName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RLMI list name.
|
||||
* @hide
|
||||
*/
|
||||
public void setListName(String listName) {
|
||||
this.mListName = listName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the subscription request ID.
|
||||
* @hide
|
||||
*/
|
||||
public int getRequestId() {
|
||||
return mRequestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the subscription request ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setRequestId(int requestId) {
|
||||
this.mRequestId = requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the presence subscription state.
|
||||
* @hide
|
||||
*/
|
||||
public PresSubscriptionState getPresSubscriptionState() {
|
||||
return mPresSubscriptionState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the presence subscription state.
|
||||
* @hide
|
||||
*/
|
||||
public void setPresSubscriptionState(PresSubscriptionState presSubscriptionState) {
|
||||
this.mPresSubscriptionState = presSubscriptionState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the presence subscription expiration time.
|
||||
* @hide
|
||||
*/
|
||||
public int getSubscriptionExpireTime() {
|
||||
return mSubscriptionExpireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the presence subscription expiration time.
|
||||
* @hide
|
||||
*/
|
||||
public void setSubscriptionExpireTime(int subscriptionExpireTime) {
|
||||
this.mSubscriptionExpireTime = subscriptionExpireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the presence subscription terminated reason.
|
||||
* @hide
|
||||
*/
|
||||
public String getSubscriptionTerminatedReason() {
|
||||
return mSubscriptionTerminatedReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the presence subscription terminated reason.
|
||||
* @hide
|
||||
*/
|
||||
public void setSubscriptionTerminatedReason(String subscriptionTerminatedReason) {
|
||||
this.mSubscriptionTerminatedReason = subscriptionTerminatedReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresTupleInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresRlmiInfo(){};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mUri);
|
||||
dest.writeInt(mVersion);
|
||||
dest.writeInt(mFullState ? 1 : 0);
|
||||
dest.writeString(mListName);
|
||||
dest.writeInt(mRequestId);
|
||||
dest.writeParcelable(mPresSubscriptionState, flags);
|
||||
dest.writeInt(mSubscriptionExpireTime);
|
||||
dest.writeString(mSubscriptionTerminatedReason);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresRlmiInfo> CREATOR =
|
||||
new Parcelable.Creator<PresRlmiInfo>() {
|
||||
|
||||
public PresRlmiInfo createFromParcel(Parcel source) {
|
||||
return new PresRlmiInfo(source);
|
||||
}
|
||||
|
||||
public PresRlmiInfo[] newArray(int size) {
|
||||
return new PresRlmiInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresRlmiInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mUri = source.readString();
|
||||
mVersion = source.readInt();
|
||||
mFullState = (source.readInt() == 0) ? false : true;
|
||||
mListName = source.readString();
|
||||
mRequestId = source.readInt();
|
||||
mPresSubscriptionState = source.readParcelable(
|
||||
PresSubscriptionState.class.getClassLoader());
|
||||
mSubscriptionExpireTime = source.readInt();
|
||||
mSubscriptionTerminatedReason = source.readString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresServiceInfo;
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresServiceInfo implements Parcelable {
|
||||
|
||||
/** Presence Service Information
|
||||
* @hide
|
||||
*/
|
||||
|
||||
/** No media capability. */
|
||||
public static final int UCE_PRES_MEDIA_CAP_NONE = 0;
|
||||
/** Full duplex audio only. */
|
||||
public static final int UCE_PRES_MEDIA_CAP_FULL_AUDIO_ONLY = 1;
|
||||
/** Full duplex audio and video. */
|
||||
public static final int UCE_PRES_MEDIA_CAP_FULL_AUDIO_AND_VIDEO = 2;
|
||||
/** Media cap is unknown. */
|
||||
public static final int UCE_PRES_MEDIA_CAP_UNKNOWN = 3;
|
||||
|
||||
|
||||
private int mMediaCap = UCE_PRES_MEDIA_CAP_NONE;
|
||||
private String mServiceID = "";
|
||||
private String mServiceDesc = "";
|
||||
private String mServiceVer = "";
|
||||
|
||||
/**
|
||||
* Gets the media type.
|
||||
* @hide
|
||||
*/
|
||||
public int getMediaType() {
|
||||
return mMediaCap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the media type.
|
||||
* @hide
|
||||
*/
|
||||
public void setMediaType(int nMediaCap) {
|
||||
this.mMediaCap = nMediaCap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the service ID.
|
||||
* @hide
|
||||
*/
|
||||
public String getServiceId() {
|
||||
return mServiceID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the service ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setServiceId(String serviceID) {
|
||||
this.mServiceID = serviceID;
|
||||
}
|
||||
/**
|
||||
* Gets the service description.
|
||||
* @hide
|
||||
*/
|
||||
public String getServiceDesc() {
|
||||
return mServiceDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the service description.
|
||||
* @hide
|
||||
*/
|
||||
public void setServiceDesc(String serviceDesc) {
|
||||
this.mServiceDesc = serviceDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the service version.
|
||||
* @hide
|
||||
*/
|
||||
public String getServiceVer() {
|
||||
return mServiceVer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the service version.
|
||||
* @hide
|
||||
*/
|
||||
public void setServiceVer(String serviceVer) {
|
||||
this.mServiceVer = serviceVer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresServiceInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresServiceInfo() {};
|
||||
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mServiceID);
|
||||
dest.writeString(mServiceDesc);
|
||||
dest.writeString(mServiceVer);
|
||||
dest.writeInt(mMediaCap);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresServiceInfo> CREATOR =
|
||||
new Parcelable.Creator<PresServiceInfo>() {
|
||||
|
||||
public PresServiceInfo createFromParcel(Parcel source) {
|
||||
return new PresServiceInfo(source);
|
||||
}
|
||||
|
||||
public PresServiceInfo[] newArray(int size) {
|
||||
return new PresServiceInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresServiceInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mServiceID = source.readString();
|
||||
mServiceDesc = source.readString();
|
||||
mServiceVer = source.readString();
|
||||
mMediaCap = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresSipResponse;
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresSipResponse implements Parcelable {
|
||||
|
||||
private PresCmdId mCmdId = new PresCmdId();
|
||||
private int mRequestId = 0;
|
||||
private int mSipResponseCode = 0;
|
||||
private int mRetryAfter = 0;
|
||||
private String mReasonPhrase = "";
|
||||
|
||||
/**
|
||||
* Gets the Presence command ID.
|
||||
* @hide
|
||||
*/
|
||||
public PresCmdId getCmdId() {
|
||||
return mCmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Presence command ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setCmdId(PresCmdId cmdId) {
|
||||
this.mCmdId = cmdId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request ID.
|
||||
* @hide
|
||||
*/
|
||||
public int getRequestId() {
|
||||
return mRequestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the request ID.
|
||||
* @hide
|
||||
*/
|
||||
public void setRequestId(int requestId) {
|
||||
this.mRequestId = requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SIP response code.
|
||||
* @hide
|
||||
*/
|
||||
public int getSipResponseCode() {
|
||||
return mSipResponseCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP response code.
|
||||
* @hide
|
||||
*/
|
||||
public void setSipResponseCode(int sipResponseCode) {
|
||||
this.mSipResponseCode = sipResponseCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the reason phrase associated with the SIP responce
|
||||
* code.
|
||||
* @hide
|
||||
*/
|
||||
public String getReasonPhrase() {
|
||||
return mReasonPhrase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP response code reason phrase.
|
||||
* @hide
|
||||
*/
|
||||
public void setReasonPhrase(String reasonPhrase) {
|
||||
this.mReasonPhrase = reasonPhrase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SIP retryAfter sec value.
|
||||
* @hide
|
||||
*/
|
||||
public int getRetryAfter() {
|
||||
return mRetryAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SIP retryAfter sec value
|
||||
* @hide
|
||||
*/
|
||||
public void setRetryAfter(int retryAfter) {
|
||||
this.mRetryAfter = retryAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresSipResponse class.
|
||||
* @hide
|
||||
*/
|
||||
public PresSipResponse(){};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mRequestId);
|
||||
dest.writeInt(mSipResponseCode);
|
||||
dest.writeString(mReasonPhrase);
|
||||
dest.writeParcelable(mCmdId, flags);
|
||||
dest.writeInt(mRetryAfter);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresSipResponse> CREATOR =
|
||||
new Parcelable.Creator<PresSipResponse>() {
|
||||
|
||||
public PresSipResponse createFromParcel(Parcel source) {
|
||||
return new PresSipResponse(source);
|
||||
}
|
||||
|
||||
public PresSipResponse[] newArray(int size) {
|
||||
return new PresSipResponse[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresSipResponse(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mRequestId = source.readInt();
|
||||
mSipResponseCode = source.readInt();
|
||||
mReasonPhrase = source.readString();
|
||||
mCmdId = source.readParcelable(PresCmdId.class.getClassLoader());
|
||||
mRetryAfter = source.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresSubscriptionState;
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresSubscriptionState implements Parcelable {
|
||||
|
||||
/**
|
||||
* Subscription states.
|
||||
* @hide
|
||||
*/
|
||||
|
||||
/** Active state. */
|
||||
public static final int UCE_PRES_SUBSCRIPTION_STATE_ACTIVE = 0;
|
||||
/** Pending state. */
|
||||
public static final int UCE_PRES_SUBSCRIPTION_STATE_PENDING = 1;
|
||||
/** Terminated state. */
|
||||
public static final int UCE_PRES_SUBSCRIPTION_STATE_TERMINATED = 2;
|
||||
/** Unknown state. */
|
||||
public static final int UCE_PRES_SUBSCRIPTION_STATE_UNKNOWN = 3;
|
||||
|
||||
|
||||
private int mPresSubscriptionState = UCE_PRES_SUBSCRIPTION_STATE_UNKNOWN;
|
||||
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mPresSubscriptionState);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresSubscriptionState> CREATOR =
|
||||
new Parcelable.Creator<PresSubscriptionState>() {
|
||||
|
||||
public PresSubscriptionState createFromParcel(Parcel source) {
|
||||
return new PresSubscriptionState(source);
|
||||
}
|
||||
|
||||
public PresSubscriptionState[] newArray(int size) {
|
||||
return new PresSubscriptionState[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresSubscriptionState(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mPresSubscriptionState = source.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresSubscriptionState class.
|
||||
* @hide
|
||||
*/
|
||||
public PresSubscriptionState() { };
|
||||
|
||||
/**
|
||||
* Gets the Presence subscription state.
|
||||
* @hide
|
||||
*/
|
||||
public int getPresSubscriptionStateValue() {
|
||||
return mPresSubscriptionState;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the Presence subscription state.
|
||||
* @hide
|
||||
*/
|
||||
public void setPresSubscriptionState(int nPresSubscriptionState) {
|
||||
this.mPresSubscriptionState = nPresSubscriptionState;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
parcelable PresTupleInfo;
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.presence;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/** @hide */
|
||||
public class PresTupleInfo implements Parcelable {
|
||||
|
||||
private String mFeatureTag = "";
|
||||
private String mContactUri = "";
|
||||
private String mTimestamp = "";
|
||||
|
||||
|
||||
/**
|
||||
* Gets the feature tag.
|
||||
* @hide
|
||||
*/
|
||||
public String getFeatureTag() {
|
||||
return mFeatureTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the feature tag.
|
||||
* @hide
|
||||
*/
|
||||
public void setFeatureTag(String featureTag) {
|
||||
this.mFeatureTag = featureTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the contact URI.
|
||||
* @hide
|
||||
*/
|
||||
public String getContactUri() {
|
||||
return mContactUri;
|
||||
}
|
||||
/**
|
||||
* Sets the contact URI.
|
||||
* @hide
|
||||
*/
|
||||
public void setContactUri(String contactUri) {
|
||||
this.mContactUri = contactUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the timestamp.
|
||||
* @hide
|
||||
*/
|
||||
public String getTimestamp() {
|
||||
return mTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timestamp.
|
||||
* @hide
|
||||
*/
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.mTimestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the PresTupleInfo class.
|
||||
* @hide
|
||||
*/
|
||||
public PresTupleInfo(){};
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mFeatureTag);
|
||||
dest.writeString(mContactUri);
|
||||
dest.writeString(mTimestamp);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<PresTupleInfo> CREATOR =
|
||||
new Parcelable.Creator<PresTupleInfo>() {
|
||||
|
||||
public PresTupleInfo createFromParcel(Parcel source) {
|
||||
return new PresTupleInfo(source);
|
||||
}
|
||||
|
||||
public PresTupleInfo[] newArray(int size) {
|
||||
return new PresTupleInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
private PresTupleInfo(Parcel source) {
|
||||
readFromParcel(source);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void readFromParcel(Parcel source) {
|
||||
mFeatureTag = source.readString();
|
||||
mContactUri = source.readString();
|
||||
mTimestamp = source.readString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.uceservice;
|
||||
|
||||
/** IUceListener
|
||||
* {@hide} */
|
||||
interface IUceListener
|
||||
{
|
||||
/**
|
||||
* Get UCE Status
|
||||
* @param serviceStatusValue defined in ImsUceManager
|
||||
* @hide
|
||||
*/
|
||||
void setStatus(int serviceStatusValue);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.uceservice;
|
||||
|
||||
import com.android.ims.internal.uce.uceservice.IUceListener;
|
||||
import com.android.ims.internal.uce.presence.IPresenceService;
|
||||
import com.android.ims.internal.uce.options.IOptionsListener;
|
||||
import com.android.ims.internal.uce.presence.IPresenceListener;
|
||||
import com.android.ims.internal.uce.options.IOptionsService;
|
||||
import com.android.ims.internal.uce.common.UceLong;
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
|
||||
/** IUceService
|
||||
* UCE service interface class.
|
||||
* {@hide} */
|
||||
interface IUceService
|
||||
{
|
||||
|
||||
/**
|
||||
* Starts the Uce service.
|
||||
* @param uceListener IUceListener object
|
||||
* @return boolean true if the service stop start is processed successfully, FALSE otherwise.
|
||||
*
|
||||
* Service status is returned in setStatus callback in IUceListener.
|
||||
* @hide
|
||||
*/
|
||||
boolean startService(IUceListener uceListener);
|
||||
|
||||
/**
|
||||
* Stops the UCE service.
|
||||
* @return boolean true if the service stop request is processed successfully, FALSE otherwise.
|
||||
* @hide
|
||||
*/
|
||||
boolean stopService();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Requests the UCE service start status.
|
||||
* @return boolean true if service started else false.
|
||||
* @hide
|
||||
*/
|
||||
boolean isServiceStarted();
|
||||
|
||||
/**
|
||||
* Creates a options service for Capability Discovery.
|
||||
* @param optionsListener IOptionsListener object.
|
||||
* @param optionsServiceListenerHdl wrapper for client's listener handle to be stored.
|
||||
*
|
||||
* The service will fill UceLong.mUceLong with presenceListenerHandle allocated and
|
||||
* used to validate callbacks received in IPresenceListener are indeed from the
|
||||
* service the client created.
|
||||
*
|
||||
* @return optionsServiceHandle
|
||||
* @hide
|
||||
*/
|
||||
int createOptionsService(IOptionsListener optionsListener,
|
||||
inout UceLong optionsServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Destroys a Options service.
|
||||
* @param optionsServiceHandle this is received in serviceCreated() callback
|
||||
* in IOptionsListener
|
||||
* @hide
|
||||
*/
|
||||
void destroyOptionsService(int optionsServiceHandle);
|
||||
|
||||
/**
|
||||
* Creates a presence service.
|
||||
* @param presenceServiceListener IPresenceListener object
|
||||
* @param presenceServiceListenerHdl wrapper for client's listener handle to be stored.
|
||||
*
|
||||
* The service will fill UceLong.mUceLong with presenceListenerHandle allocated and
|
||||
* used to validate callbacks received in IPresenceListener are indeed from the
|
||||
* service the client created.
|
||||
*
|
||||
* @return presenceServiceHdl
|
||||
* @hide
|
||||
*/
|
||||
int createPresenceService(IPresenceListener presenceServiceListener,
|
||||
inout UceLong presenceServiceListenerHdl);
|
||||
|
||||
/**
|
||||
* Destroys a presence service.
|
||||
* @param presenceServiceHdl handle returned during createPresenceService()
|
||||
* @hide
|
||||
*/
|
||||
void destroyPresenceService(int presenceServiceHdl);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Query the UCE Service for information to know whether the is registered.
|
||||
* @return boolean, true if Registered to for network events else false.
|
||||
* @hide
|
||||
*/
|
||||
boolean getServiceStatus();
|
||||
|
||||
/**
|
||||
* Query the UCE Service for presence Service.
|
||||
* @return IPresenceService object.
|
||||
* @hide
|
||||
*/
|
||||
IPresenceService getPresenceService();
|
||||
|
||||
/**
|
||||
* Query the UCE Service for options service object.
|
||||
* @return IOptionsService object.
|
||||
* @hide
|
||||
*/
|
||||
IOptionsService getOptionsService();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce.uceservice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import java.util.HashMap;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* ImsUceManager Declaration
|
||||
* @hide
|
||||
*/
|
||||
public class ImsUceManager {
|
||||
|
||||
private static final String LOG_TAG = "ImsUceManager";
|
||||
/**
|
||||
* Uce Service name Internal Uce only
|
||||
* @hide
|
||||
*/
|
||||
private static final String UCE_SERVICE = "uce";
|
||||
|
||||
/**
|
||||
* IUceService object
|
||||
* @hide
|
||||
*/
|
||||
private IUceService mUceService = null;
|
||||
private UceServiceDeathRecipient mDeathReceipient = new UceServiceDeathRecipient();
|
||||
private Context mContext;
|
||||
private int mPhoneId;
|
||||
/**
|
||||
* Stores the UceManager instaces of Clients identified by
|
||||
* phoneId
|
||||
* @hide
|
||||
*/
|
||||
private static HashMap<Integer, ImsUceManager> sUceManagerInstances =
|
||||
new HashMap<Integer, ImsUceManager>();
|
||||
|
||||
public static final String ACTION_UCE_SERVICE_UP =
|
||||
"com.android.ims.internal.uce.UCE_SERVICE_UP";
|
||||
public static final String ACTION_UCE_SERVICE_DOWN =
|
||||
"com.android.ims.internal.uce.UCE_SERVICE_DOWN";
|
||||
|
||||
/** Uce Service status received in IUceListener.setStatus()
|
||||
* callback
|
||||
* @hide
|
||||
*/
|
||||
public static final int UCE_SERVICE_STATUS_FAILURE = 0;
|
||||
/** indicate UI to call Presence/Options API. */
|
||||
public static final int UCE_SERVICE_STATUS_ON = 1;
|
||||
/** Indicate UI destroy Presence/Options */
|
||||
public static final int UCE_SERVICE_STATUS_CLOSED = 2;
|
||||
/** Service up and trying to register for network events */
|
||||
public static final int UCE_SERVICE_STATUS_READY = 3;
|
||||
|
||||
/**
|
||||
* Part of the ACTION_UCE_SERVICE_UP or _DOWN intents. A long
|
||||
* value; the phone ID corresponding to the IMS service coming up or down.
|
||||
* Internal use only.
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_PHONE_ID = "android:phone_id";
|
||||
|
||||
|
||||
/**
|
||||
* Gets the instance of UCE Manager
|
||||
* @hide
|
||||
*/
|
||||
public static ImsUceManager getInstance(Context context, int phoneId) {
|
||||
//if (DBG) Log.d (LOG_TAG, "GetInstance Called");
|
||||
synchronized (sUceManagerInstances) {
|
||||
if (sUceManagerInstances.containsKey(phoneId)) {
|
||||
return sUceManagerInstances.get(phoneId);
|
||||
} else {
|
||||
ImsUceManager uceMgr = new ImsUceManager(context, phoneId);
|
||||
sUceManagerInstances.put(phoneId, uceMgr);
|
||||
return uceMgr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @hide
|
||||
*/
|
||||
private ImsUceManager(Context context, int phoneId) {
|
||||
//if (DBG) Log.d (LOG_TAG, "Constructor");
|
||||
mContext = context;
|
||||
mPhoneId = phoneId;
|
||||
createUceService(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Uce service Instance
|
||||
*
|
||||
* client should call this API only after createUceService()
|
||||
* this instance is deleted when ACTION_UCE_SERVICE_DOWN event
|
||||
* is received.
|
||||
* @hide
|
||||
*/
|
||||
public IUceService getUceServiceInstance() {
|
||||
//if (DBG) Log.d (LOG_TAG, "GetUceServiceInstance Called");
|
||||
return mUceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the UCE service name
|
||||
* @hide
|
||||
*/
|
||||
private String getUceServiceName(int phoneId) {
|
||||
return UCE_SERVICE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the IBinder to UCE service
|
||||
*
|
||||
* Client should call this after receving ACTION_UCE_SERVICE_UP
|
||||
* event.
|
||||
* @hide
|
||||
*/
|
||||
public void createUceService(boolean checkService) {
|
||||
//if (DBG) Log.d (LOG_TAG, "CreateUceService Called");
|
||||
if (checkService) {
|
||||
IBinder binder = ServiceManager.checkService(getUceServiceName(mPhoneId));
|
||||
|
||||
if (binder == null) {
|
||||
//if (DBG)Log.d (LOG_TAG, "Unable to find IBinder");
|
||||
return;
|
||||
}
|
||||
}
|
||||
IBinder b = ServiceManager.getService(getUceServiceName(mPhoneId));
|
||||
|
||||
if (b != null) {
|
||||
try {
|
||||
b.linkToDeath(mDeathReceipient, 0);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
this.mUceService = IUceService.Stub.asInterface(b);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Death recipient class for monitoring IMS service.
|
||||
*
|
||||
* After receiving ACTION_UCE_SERVICE_DOWN event, the client
|
||||
* should wait to receive ACTION_UCE_SERVICE_UP and call
|
||||
* createUceService inorder to create mUceService instance.
|
||||
* @hide
|
||||
*/
|
||||
private class UceServiceDeathRecipient implements IBinder.DeathRecipient {
|
||||
@Override
|
||||
public void binderDied() {
|
||||
//if (DBG) Log.d (LOG_TAG, "found IBinder/IUceService Service Died");
|
||||
mUceService = null;
|
||||
|
||||
if (mContext != null) {
|
||||
Intent intent = new Intent(ACTION_UCE_SERVICE_DOWN);
|
||||
intent.putExtra(EXTRA_PHONE_ID, mPhoneId);
|
||||
mContext.sendBroadcast(new Intent(intent));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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.
|
||||
*/
|
||||
|
||||
package com.android.ims.internal.uce;
|
||||
|
||||
import com.android.ims.internal.uce.uceservice.IUceService;
|
||||
import com.android.ims.internal.uce.uceservice.IUceListener;
|
||||
import com.android.ims.internal.uce.common.StatusCode;
|
||||
import com.android.ims.internal.uce.common.UceLong;
|
||||
import com.android.ims.internal.uce.options.IOptionsListener;
|
||||
import com.android.ims.internal.uce.options.IOptionsService;
|
||||
import com.android.ims.internal.uce.presence.IPresenceService;
|
||||
import com.android.ims.internal.uce.presence.IPresenceListener;
|
||||
|
||||
/**
|
||||
* Sub IUceService interface. To enable forward compatability
|
||||
* during developlemt
|
||||
* @hide
|
||||
*/
|
||||
public abstract class UceServiceBase {
|
||||
/**
|
||||
* IUceService Stub Implementation
|
||||
*/
|
||||
private final class UceServiceBinder extends IUceService.Stub {
|
||||
@Override
|
||||
public boolean startService(IUceListener uceListener) {
|
||||
return onServiceStart(uceListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopService() {
|
||||
return onStopService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isServiceStarted() {
|
||||
return onIsServiceStarted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int createOptionsService(IOptionsListener optionsListener,
|
||||
UceLong optionsServiceListenerHdl) {
|
||||
return onCreateOptionsService(optionsListener, optionsServiceListenerHdl);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroyOptionsService(int optionsServiceHandle) {
|
||||
onDestroyOptionsService(optionsServiceHandle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int createPresenceService(
|
||||
IPresenceListener presServiceListener,
|
||||
UceLong presServiceListenerHdl) {
|
||||
return onCreatePresService(presServiceListener, presServiceListenerHdl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyPresenceService(int presServiceHdl) {
|
||||
onDestroyPresService(presServiceHdl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getServiceStatus() {
|
||||
return onGetServiceStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPresenceService getPresenceService() {
|
||||
return onGetPresenceService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOptionsService getOptionsService() {
|
||||
return onGetOptionsService();
|
||||
}
|
||||
}
|
||||
|
||||
private UceServiceBinder mBinder;
|
||||
|
||||
public UceServiceBinder getBinder() {
|
||||
if (mBinder == null) {
|
||||
mBinder = new UceServiceBinder();
|
||||
}
|
||||
return mBinder;
|
||||
}
|
||||
|
||||
protected boolean onServiceStart(IUceListener uceListener) {
|
||||
//no-op
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean onStopService() {
|
||||
//no-op
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean onIsServiceStarted() {
|
||||
//no-op
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int onCreateOptionsService(IOptionsListener optionsListener,
|
||||
UceLong optionsServiceListenerHdl) {
|
||||
//no-op
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void onDestroyOptionsService(int cdServiceHandle) {
|
||||
//no-op
|
||||
return;
|
||||
}
|
||||
|
||||
protected int onCreatePresService(IPresenceListener presServiceListener,
|
||||
UceLong presServiceListenerHdl) {
|
||||
//no-op
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void onDestroyPresService(int presServiceHdl) {
|
||||
//no-op
|
||||
return;
|
||||
}
|
||||
|
||||
protected boolean onGetServiceStatus() {
|
||||
//no-op
|
||||
return false;
|
||||
}
|
||||
|
||||
protected IPresenceService onGetPresenceService() {
|
||||
//no-op
|
||||
return null;
|
||||
}
|
||||
|
||||
protected IOptionsService onGetOptionsService () {
|
||||
//no-op
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user