summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-10 02:30:36 -0700
committerLinux Build Service Account <lnxbuild@localhost>2018-09-10 02:30:36 -0700
commit593ffe0621f6445afd06ec6fc03023877447a5a2 (patch)
tree47bf75fea376dccd5748606dd995a7d78bb8ab8f
parent74d494e99eb583178aefaf259af8e9d7bc5c842d (diff)
parent8834ec7370fb527662e2c382e14ab3f71efe8bcd (diff)
Merge 8834ec7370fb527662e2c382e14ab3f71efe8bcd on remote branch
Change-Id: I3719ead0bfa83f82cb77037a252deeee7dcdf601
-rw-r--r--ims/src/org/codeaurora/ims/ImsMultiIdentityControllerBase.java85
-rw-r--r--ims/src/org/codeaurora/ims/ImsMultiIdentityListenerBase.java82
-rw-r--r--ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java111
-rw-r--r--ims/src/org/codeaurora/ims/MultiIdentityLineInfo.aidl32
-rw-r--r--ims/src/org/codeaurora/ims/MultiIdentityLineInfo.java173
-rw-r--r--ims/src/org/codeaurora/ims/QtiImsExtBase.java9
-rw-r--r--ims/src/org/codeaurora/ims/QtiImsExtManager.java26
-rw-r--r--ims/src/org/codeaurora/ims/internal/IImsMultiIdentityInterface.aidl59
-rw-r--r--ims/src/org/codeaurora/ims/internal/IImsMultiIdentityListener.aidl64
-rw-r--r--ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl6
10 files changed, 647 insertions, 0 deletions
diff --git a/ims/src/org/codeaurora/ims/ImsMultiIdentityControllerBase.java b/ims/src/org/codeaurora/ims/ImsMultiIdentityControllerBase.java
new file mode 100644
index 0000000..05cf4e2
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/ImsMultiIdentityControllerBase.java
@@ -0,0 +1,85 @@
+/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import android.Manifest;
+import android.content.Context;
+import android.os.RemoteException;
+import org.codeaurora.ims.MultiIdentityLineInfo;
+import org.codeaurora.ims.internal.IImsMultiIdentityListener;
+import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
+import java.util.List;
+import java.util.ArrayList;
+
+public abstract class ImsMultiIdentityControllerBase {
+ public final class MultiIdentityBinder extends IImsMultiIdentityInterface.Stub {
+
+ @Override
+ public void setMultiIdentityListener(
+ IImsMultiIdentityListener listener) throws RemoteException{
+ ImsMultiIdentityControllerBase.this.
+ setMultiIdentityListener(listener);
+ }
+
+ @Override
+ public void updateRegistrationStatus(List<MultiIdentityLineInfo> linesInfo) {
+ ImsMultiIdentityControllerBase.this.
+ updateRegistrationStatus(linesInfo);
+ }
+
+ @Override
+ public void queryVirtualLineInfo(String msisdn) throws RemoteException{
+ ImsMultiIdentityControllerBase.this.
+ queryVirtualLineInfo(msisdn);
+ }
+ }
+
+ private IImsMultiIdentityInterface mBinder;
+
+ public IImsMultiIdentityInterface getBinder() {
+ if (mBinder == null) {
+ mBinder = new MultiIdentityBinder();
+ }
+ return mBinder;
+ }
+
+ protected void setMultiIdentityListener(
+ IImsMultiIdentityListener listener) throws RemoteException{
+ //no-op
+ }
+
+ protected void updateRegistrationStatus(
+ List<MultiIdentityLineInfo> linesInfo) {
+ //no-op
+ }
+
+ protected void queryVirtualLineInfo(String msisdn) throws RemoteException{
+ //no-op
+ }
+}
diff --git a/ims/src/org/codeaurora/ims/ImsMultiIdentityListenerBase.java b/ims/src/org/codeaurora/ims/ImsMultiIdentityListenerBase.java
new file mode 100644
index 0000000..64882d6
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/ImsMultiIdentityListenerBase.java
@@ -0,0 +1,82 @@
+/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import java.util.List;
+import org.codeaurora.ims.MultiIdentityLineInfo;
+import org.codeaurora.ims.internal.IImsMultiIdentityListener;
+
+public abstract class ImsMultiIdentityListenerBase {
+
+ private final class MultiIdentityListener extends IImsMultiIdentityListener.Stub {
+
+ public void onUpdateRegistrationInfoResponse(int phoneId, int response){
+ ImsMultiIdentityListenerBase.this.
+ onUpdateRegistrationInfoResponse(phoneId, response);
+ }
+
+ public void onRegistrationStatusChange(int phoneId,
+ List<MultiIdentityLineInfo> info) {
+ ImsMultiIdentityListenerBase.this.
+ onRegistrationStatusChange(phoneId, info);
+ }
+
+ public void onQueryVirtualLineInfoResponse(int phoneId,
+ String msisdn,
+ List<String> pAssociatedUri) {
+ ImsMultiIdentityListenerBase.this.
+ onQueryVirtualLineInfoResponse(phoneId, msisdn, pAssociatedUri);
+ }
+ }
+
+ private MultiIdentityListener mListener;
+
+ public IImsMultiIdentityListener getListener() {
+ if (mListener == null) {
+ mListener = new MultiIdentityListener();
+ }
+ return mListener;
+ }
+
+ protected void onUpdateRegistrationInfoResponse(int phoneId, int response){
+ // no-op
+ }
+
+ protected void onRegistrationStatusChange(int phoneId,
+ List<MultiIdentityLineInfo> info) {
+
+ // no-op
+ }
+
+ protected void onQueryVirtualLineInfoResponse(int phoneId,
+ String msisdn,
+ List<String> pAssociatedUri) {
+ // no-op
+ }
+}
diff --git a/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java b/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java
new file mode 100644
index 0000000..0786972
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java
@@ -0,0 +1,111 @@
+/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import android.content.Context;
+import android.os.IBinder;
+import android.os.RemoteException;
+import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
+import org.codeaurora.ims.internal.IImsMultiIdentityListener;
+import android.util.Log;
+import java.util.ArrayList;
+
+public class ImsMultiIdentityManager {
+ private static String LOG_TAG = "ImsMultiIdentityManager";
+
+ public final static int REGISTRATION_RESPONSE_FAILURE = 0;
+ public final static int REGISTRATION_RESPONSE_SUCCESS = 1;
+
+ private QtiImsExtManager mQtiImsExtMgr;
+ private volatile IImsMultiIdentityInterface mInterface;
+ private int mPhoneId;
+
+ ImsMultiIdentityManager(int phoneId, QtiImsExtManager imsExtMgr) {
+ mPhoneId = phoneId;
+ mQtiImsExtMgr = imsExtMgr;
+ }
+
+ private void onServiceDied(){
+ mInterface = null;
+ }
+
+ private IImsMultiIdentityInterface getMultiIdentityInterface() throws QtiImsException{
+ IImsMultiIdentityInterface intf = mInterface;
+ if (intf != null) {
+ return intf;
+ }
+ mQtiImsExtMgr.validateInvariants(mPhoneId);
+ intf = mQtiImsExtMgr.getMultiIdentityInterface(mPhoneId);
+ if (intf == null) {
+ Log.e(LOG_TAG, "mInterface is NULL");
+ throw new QtiImsException("Remote Interface is NULL");
+ }
+ mInterface = intf;
+ IBinder binder = intf.asBinder();
+ try {
+ binder.linkToDeath(()->this.onServiceDied(), 0);
+ } catch (RemoteException e) {
+ Log.e(LOG_TAG, "Unable to listen for Server Process death");
+ throw new QtiImsException("Remote linkToDeath Exception : " + e);
+ }
+ return intf;
+ }
+
+ public void setMultiIdentityListener(ImsMultiIdentityListenerBase listener)
+ throws QtiImsException{
+ mQtiImsExtMgr.validateInvariants(mPhoneId);
+ try {
+ getMultiIdentityInterface().setMultiIdentityListener(listener.getListener());
+ }
+ catch (RemoteException e) {
+ throw new QtiImsException("Remote ImsService setMultiIdentityListener : " + e);
+ }
+ }
+
+ public void updateRegistrationStatus(
+ ArrayList<MultiIdentityLineInfo> linesInfo) throws QtiImsException{
+ mQtiImsExtMgr.validateInvariants(mPhoneId);
+ try {
+ getMultiIdentityInterface().updateRegistrationStatus(linesInfo);
+ }
+ catch (RemoteException e) {
+ throw new QtiImsException("Remote ImsService updateRegistrationStatus : " + e);
+ }
+ }
+
+ public void queryVirtualLineInfo(String msisdn) throws QtiImsException{
+ mQtiImsExtMgr.validateInvariants(mPhoneId);
+ try {
+ getMultiIdentityInterface().queryVirtualLineInfo(msisdn);
+ }
+ catch (RemoteException e) {
+ throw new QtiImsException("Remote ImsService queryVirtualLineInfo : " + e);
+ }
+ }
+}
diff --git a/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.aidl b/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.aidl
new file mode 100644
index 0000000..0d76426
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+parcelable MultiIdentityLineInfo;
diff --git a/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.java b/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.java
new file mode 100644
index 0000000..cf6a0fb
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/MultiIdentityLineInfo.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Parcelable object to handle Video Call DataUsage information
+ * @hide
+ */
+
+public class MultiIdentityLineInfo implements Parcelable {
+
+ public static final int LINE_TYPE_PRIMARY = 1;
+ public static final int LINE_TYPE_SECONDARY = 2;
+
+ public static final int LINE_STATUS_UNKNOWN = 0;
+ public static final int LINE_STATUS_INACTIVE = 1;
+ public static final int LINE_STATUS_ACTIVE = 2;
+
+ public static final String LINE_TYPE = "lineType";
+ public static final String ORIGINATING_NUMBER = "originatingNumber";
+ public static final String TERMINATING_NUMBER = "terminatingNumber";
+ public static final MultiIdentityLineInfo defaultLine =
+ new MultiIdentityLineInfo("", LINE_TYPE_PRIMARY);
+
+ private String mMsisdn;
+ private int mLineType;
+ private int mLineStatus;
+
+ public MultiIdentityLineInfo(String msisdn, int type) {
+ this(msisdn, type, LINE_STATUS_UNKNOWN);
+ }
+
+ public MultiIdentityLineInfo(String msisdn, int type, int status) {
+ mMsisdn = msisdn;
+ mLineType = type;
+ mLineStatus = status;
+ }
+
+ public MultiIdentityLineInfo(MultiIdentityLineInfo info) {
+ mMsisdn = info.getMsisdn();
+ mLineType = info.getLineType();
+ mLineStatus = info.getLineStatus();
+ }
+
+ public MultiIdentityLineInfo(Parcel in) {
+ readFromParcel(in);
+ }
+
+
+ /*
+ * This method returns the default line
+ */
+ public static MultiIdentityLineInfo getDefaultLine() {
+ return defaultLine;
+ }
+
+ /*
+ * This method returns the msisdn of line
+ */
+ public String getMsisdn() {
+ return mMsisdn;
+ }
+
+ /*
+ * This method returns the type of line
+ */
+ public int getLineType() {
+ return mLineType;
+ }
+
+ /*
+ * This method returns the status of line
+ */
+ public int getLineStatus() {
+ return mLineStatus;
+ }
+
+ /*
+ * This method sets the msisdn of line
+ */
+ public void setMsisdn(String msisdn) {
+ mMsisdn = msisdn;
+ }
+
+ /*
+ * This method sets the type of line
+ */
+ public void setLineType(int type) {
+ mLineType = type;
+ }
+
+ /*
+ * This method sets the status of line
+ */
+ public void setLineStatus(int status) {
+ mLineStatus = status;
+ }
+
+ /*
+ * This method checks whether the line type
+ * is secondary or not
+ */
+ public boolean isLineSecondary() {
+ return mLineType == LINE_TYPE_SECONDARY;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flag) {
+ dest.writeString(mMsisdn);
+ dest.writeInt(mLineType);
+ dest.writeInt(mLineStatus);
+ }
+
+ public void readFromParcel(Parcel in) {
+ mMsisdn = in.readString();
+ mLineType = in.readInt();
+ mLineStatus = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Creator<MultiIdentityLineInfo> CREATOR =
+ new Creator<MultiIdentityLineInfo>() {
+ @Override
+ public MultiIdentityLineInfo createFromParcel(Parcel in) {
+ return new MultiIdentityLineInfo(in);
+ }
+
+ @Override
+ public MultiIdentityLineInfo[] newArray(int size) {
+ return new MultiIdentityLineInfo[size];
+ }
+ };
+
+ public String toString() {
+ return ("{MultiIdentity Line Info : " + "msisdn = " +
+ mMsisdn + " , line type = " + mLineType +
+ " , line status = " + mLineStatus + "}");
+ }
+}
diff --git a/ims/src/org/codeaurora/ims/QtiImsExtBase.java b/ims/src/org/codeaurora/ims/QtiImsExtBase.java
index 5600fd5..c237803 100644
--- a/ims/src/org/codeaurora/ims/QtiImsExtBase.java
+++ b/ims/src/org/codeaurora/ims/QtiImsExtBase.java
@@ -29,6 +29,7 @@ package org.codeaurora.ims;
import org.codeaurora.ims.internal.IQtiImsExt;
import org.codeaurora.ims.internal.IQtiImsExtListener;
+import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
import org.codeaurora.ims.QtiCallConstants;
/**
@@ -139,6 +140,10 @@ public abstract class QtiImsExtBase {
return onGetVvmAppConfig(phoneId);
}
+ @Override
+ public IImsMultiIdentityInterface getMultiIdentityInterface(int phoneId) {
+ return onGetMultiIdentityInterface(phoneId);
+ }
};
private QtiImsExtBinder mQtiImsExtBinder;
@@ -219,4 +224,8 @@ public abstract class QtiImsExtBase {
// no-op
return 0; //DUMMY VALUE
}
+ protected IImsMultiIdentityInterface onGetMultiIdentityInterface(int phoneId) {
+ // no-op
+ return null;
+ }
}
diff --git a/ims/src/org/codeaurora/ims/QtiImsExtManager.java b/ims/src/org/codeaurora/ims/QtiImsExtManager.java
index 553c448..d861f5e 100644
--- a/ims/src/org/codeaurora/ims/QtiImsExtManager.java
+++ b/ims/src/org/codeaurora/ims/QtiImsExtManager.java
@@ -42,6 +42,7 @@ import com.android.ims.ImsManager;
import org.codeaurora.ims.internal.IQtiImsExt;
import org.codeaurora.ims.internal.IQtiImsExtListener;
+import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
import org.codeaurora.ims.QtiCallConstants;
import org.codeaurora.ims.utils.QtiImsExtUtils;
@@ -356,4 +357,29 @@ public class QtiImsExtManager {
return ret;
}
+
+ public static ImsMultiIdentityManager createImsMultiIdentityManager(
+ int phoneId, Context context) {
+ QtiImsExtManager imsExtMgr = new QtiImsExtManager(context);
+ return new ImsMultiIdentityManager(phoneId, imsExtMgr);
+ }
+
+ /*package private*/
+ IImsMultiIdentityInterface getMultiIdentityInterface(int phoneId)
+ throws QtiImsException {
+ obtainBinder();
+ checkPhoneId(phoneId);
+ checkFeatureStatus(phoneId);
+ try {
+ return mQtiImsExt.getMultiIdentityInterface(phoneId);
+ } catch(RemoteException e) {
+ throw new QtiImsException("Failed to retrieve MultiIdentityInterface : " + e);
+ }
+ }
+
+ /*package private*/
+ void validateInvariants(int phoneId) throws QtiImsException {
+ checkPhoneId(phoneId);
+ checkFeatureStatus(phoneId);
+ }
}
diff --git a/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityInterface.aidl b/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityInterface.aidl
new file mode 100644
index 0000000..145d092
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityInterface.aidl
@@ -0,0 +1,59 @@
+/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims.internal;
+
+import org.codeaurora.ims.MultiIdentityLineInfo;
+import org.codeaurora.ims.internal.IImsMultiIdentityListener;
+import java.util.List;
+
+/**
+ * Used by client application to communicate with vendor code
+ * {@hide}
+ */
+oneway interface IImsMultiIdentityInterface {
+ /**
+ * Used by client to register call back listener with vendor for Response
+ * and UNSOL indications
+ * @param listener call back listener
+ */
+ void setMultiIdentityListener(in IImsMultiIdentityListener listener);
+
+ /**
+ * Used by client for Registering/De-registering lines
+ * @param linesInfo - Status and Type information about the Lines
+ */
+ void updateRegistrationStatus(in List<MultiIdentityLineInfo> linesInfo);
+
+ /**
+ * Used by client for retrieving p-associated URIs of a line
+ * @param msisdn - msisdn of the line
+ */
+ void queryVirtualLineInfo(String msisdn);
+}
+
diff --git a/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityListener.aidl b/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityListener.aidl
new file mode 100644
index 0000000..229b455
--- /dev/null
+++ b/ims/src/org/codeaurora/ims/internal/IImsMultiIdentityListener.aidl
@@ -0,0 +1,64 @@
+/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims.internal;
+
+import java.util.List;
+import org.codeaurora.ims.MultiIdentityLineInfo;
+/**
+ * Used by client application to get the result from lower layer by
+ * communicating with vendor.
+ * {@hide}
+ */
+oneway interface IImsMultiIdentityListener {
+
+ /*
+ * Implemented by the MultiIdentity Client. Used by ATEL to propagate
+ * Registration response to the client
+ * @param phoneId - Denotes the phoneId
+ * @param response - Registration response success/failure
+ */
+ void onUpdateRegistrationInfoResponse(int phoneId, int response);
+
+ /*
+ * Implemented by the MultiIdentity Client. Used by ATEL to propagate
+ * Registration status change indication to the client
+ * @param phoneId - Denotes the phoneId
+ * @param info - Line information which contatins the registration status
+ */
+ void onRegistrationStatusChange(int phoneId, in List<MultiIdentityLineInfo> info);
+
+ /*
+ * Implemented by the MultiIdentity Client. Used by ATEL to propagate
+ * the virtual line info response to the client
+ * @param phoneId - Denotes the phoneId
+ * @param msisdn - msisdn of the line whose information is being queried
+ * @param info - Virtual Line Info response
+ */
+ void onQueryVirtualLineInfoResponse(int phoneId, String msisdn, in List<String> pAssociatedUri);
+}
diff --git a/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl b/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
index a85041b..baa9372 100644
--- a/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
+++ b/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
@@ -29,6 +29,7 @@
package org.codeaurora.ims.internal;
import org.codeaurora.ims.internal.IQtiImsExtListener;
+import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
/**
* Interface through which APP and vendor communicates.
@@ -262,4 +263,9 @@ interface IQtiImsExt {
* @throws RemoteException if calling the IMS service results in an error.
*/
int setVvmAppConfig(int phoneId, int defaultVvmApp);
+
+ /**
+ * Returns the IImsMultiIdentityInterface IBinder
+ */
+ IImsMultiIdentityInterface getMultiIdentityInterface(int phoneId);
}