Merge remote-tracking branch 'origin/atel-sys.lnx.1.0' into HEAD
Change-Id: I67c12a64132c59df678587a4e8be8bf4ee8eb9e1
diff --git a/extphone/Android.bp b/extphone/Android.bp
new file mode 100644
index 0000000..81195af
--- /dev/null
+++ b/extphone/Android.bp
@@ -0,0 +1,54 @@
+
+java_library {
+ name: "extphonelib",
+ provides_uses_lib: "com.qti.extphone.extphonelib",
+ installable: true,
+ sdk_version: "system_current",
+
+ srcs: [
+ "src/com/**/*.java",
+ "src/com/**/I*.aidl",
+ ],
+ system_ext_specific: true,
+
+}
+
+java_library {
+ name: "extphonelib-product",
+ provides_uses_lib: "com.qti.extphone.extphonelib-product",
+ installable: true,
+ sdk_version: "system_current",
+
+ srcs: [
+ "src/com/**/*.java",
+ "src/com/**/I*.aidl",
+ ],
+ product_specific: true,
+
+}
+
+// ==========================================
+
+prebuilt_etc {
+
+ name: "extphonelib.xml",
+ // This will install the file in /system_ext/etc/permissions
+
+ src: "extphonelib.xml",
+ sub_dir: "permissions",
+ system_ext_specific: true,
+
+}
+
+prebuilt_etc {
+
+ name: "extphonelib_product.xml",
+
+ // This will install the file in /product/etc/permissions
+
+ src: "extphonelib_product.xml",
+ sub_dir: "permissions",
+ product_specific: true,
+
+}
+
diff --git a/extphone/extphonelib.xml b/extphone/extphonelib.xml
new file mode 100644
index 0000000..fc96f55
--- /dev/null
+++ b/extphone/extphonelib.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+copyright (c) 2020-2021, 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.
+-->
+<permissions>
+ <library name="com.qti.extphone.extphonelib"
+ file="/system_ext/framework/extphonelib.jar"/>
+</permissions>
diff --git a/extphone/extphonelib_product.xml b/extphone/extphonelib_product.xml
new file mode 100644
index 0000000..80c8b70
--- /dev/null
+++ b/extphone/extphonelib_product.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+copyright (c) 2020-2021, 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.
+-->
+<permissions>
+ <library name="com.qti.extphone.extphonelib-product"
+ file="/product/framework/extphonelib-product.jar"/>
+</permissions>
diff --git a/internal/src/org/codeaurora/internal/IDsda.aidl b/extphone/src/com/qti/extphone/BearerAllocationStatus.aidl
similarity index 81%
rename from internal/src/org/codeaurora/internal/IDsda.aidl
rename to extphone/src/com/qti/extphone/BearerAllocationStatus.aidl
index f688d89..eedf876 100644
--- a/internal/src/org/codeaurora/internal/IDsda.aidl
+++ b/extphone/src/com/qti/extphone/BearerAllocationStatus.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+/*
+ * Copyright (c) 2021, 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
@@ -25,17 +25,9 @@
* 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.internal;
-
-/**
- * Interface for DSDA API, to be called from telephony-fwk and they will
- * be handled in service/telecom.
*
- * {@hide}
*/
-interface IDsda{
- void switchToActiveSub(int subId);
- int getActiveSubscription();
-}
+
+package com.qti.extphone;
+
+parcelable BearerAllocationStatus;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/BearerAllocationStatus.java b/extphone/src/com/qti/extphone/BearerAllocationStatus.java
new file mode 100644
index 0000000..0216b4c
--- /dev/null
+++ b/extphone/src/com/qti/extphone/BearerAllocationStatus.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class BearerAllocationStatus implements Parcelable {
+
+ private static final String TAG = "BearerAllocationStatus";
+
+ public static final int INVALID = -1;
+ public static final int NOT_ALLOCATED = 0;
+ public static final int ALLOCATED = 1;
+ public static final int MMW_ALLOCATED = 2;
+
+ private int mValue;
+
+ public BearerAllocationStatus(int val) {
+ mValue = val;
+ }
+
+ public BearerAllocationStatus(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ public int getBearerAllocationStatus() {
+ return mValue;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mValue);
+ }
+
+ public static final Parcelable.Creator<BearerAllocationStatus> CREATOR =
+ new Parcelable.Creator() {
+ public BearerAllocationStatus createFromParcel(Parcel in) {
+ return new BearerAllocationStatus(in);
+ }
+
+ public BearerAllocationStatus[] newArray(int size) {
+ return new BearerAllocationStatus[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + getBearerAllocationStatus();
+ }
+
+}
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/Client.aidl b/extphone/src/com/qti/extphone/Client.aidl
new file mode 100644
index 0000000..a7bb9c8
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Client.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable Client;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/Client.java b/extphone/src/com/qti/extphone/Client.java
new file mode 100644
index 0000000..e3de634
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Client.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class Client implements Parcelable {
+
+ private static final String TAG = "Client";
+
+ private int mId;
+ private int mUid;
+ private String mPackageName;
+ private IExtPhoneCallback mCallback;
+
+ public Client(int id, int uid, String packageName, IExtPhoneCallback callback) {
+ mId = id;
+ mUid = uid;
+ mPackageName = packageName;
+ mCallback = callback;
+ }
+
+ public Client(Parcel in) {
+ mId = in.readInt();
+ mUid = in.readInt();
+ mPackageName = in.readString();
+ mCallback = IExtPhoneCallback.Stub.asInterface(in.readStrongBinder());
+ }
+
+ public int getId() {
+ return mId;
+ }
+
+ public int getUid() {
+ return mUid;
+ }
+
+ public String getPackageName() {
+ return mPackageName;
+ }
+
+ public IExtPhoneCallback getCallback() {
+ return mCallback;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mId);
+ out.writeInt(mUid);
+ out.writeString(mPackageName);
+ out.writeStrongInterface(mCallback);
+ }
+
+ public static final Parcelable.Creator<Client> CREATOR = new Parcelable.Creator() {
+ public Client createFromParcel(Parcel in) {
+ return new Client(in);
+ }
+
+ public Client[] newArray(int size) {
+ return new Client[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mId = in.readInt();
+ mUid = in.readInt();
+ mPackageName = in.readString();
+ mCallback = IExtPhoneCallback.Stub.asInterface(in.readStrongBinder());
+ }
+
+ @Override
+ public String toString() {
+ return "Client{" + "mId=" + getId() + ", mUid=" + getUid() + ", mPackageName='" +
+ getPackageName() + '\'' + ", mCallback=" + getCallback() + '}';
+ }
+}
diff --git a/extphone/src/com/qti/extphone/DcParam.aidl b/extphone/src/com/qti/extphone/DcParam.aidl
new file mode 100644
index 0000000..cf2a471
--- /dev/null
+++ b/extphone/src/com/qti/extphone/DcParam.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable DcParam;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/DcParam.java b/extphone/src/com/qti/extphone/DcParam.java
new file mode 100644
index 0000000..2136405
--- /dev/null
+++ b/extphone/src/com/qti/extphone/DcParam.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class DcParam implements Parcelable {
+
+ private static final String TAG = "DcParam";
+
+ public static final int INVALID = -1;
+
+ public static final int ENDC_UNAVAILABLE = 0;
+ public static final int ENDC_AVAILABLE = 1;
+
+ public static final int DCNR_RESTRICTED = 0;
+ public static final int DCNR_UNRESTRICTED = 1;
+
+ private int mEndc = ENDC_UNAVAILABLE;
+ private int mDcnr = DCNR_RESTRICTED;
+
+ public DcParam(int endc, int dcnr) {
+ mEndc = endc;
+ mDcnr = dcnr;
+ }
+
+ public DcParam(Parcel in) {
+ mEndc = in.readInt();
+ mDcnr = in.readInt();
+ }
+
+ public int getEndc() {
+ return mEndc;
+ }
+
+ public int getDcnr() {
+ return mDcnr;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mEndc);
+ out.writeInt(mDcnr);
+ }
+
+ public static final Parcelable.Creator<DcParam> CREATOR = new Parcelable.Creator() {
+ public DcParam createFromParcel(Parcel in) {
+ return new DcParam(in);
+ }
+
+ public DcParam[] newArray(int size) {
+ return new DcParam[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mEndc = in.readInt();
+ mDcnr = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": Endc: " + getEndc() + " Dcnr: " + getDcnr();
+ }
+
+}
diff --git a/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
new file mode 100644
index 0000000..934887b
--- /dev/null
+++ b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.RemoteException;
+import android.util.Log;
+import com.qti.extphone.BearerAllocationStatus;
+import com.qti.extphone.DcParam;
+import com.qti.extphone.IExtPhoneCallback;
+import com.qti.extphone.NrConfig;
+import com.qti.extphone.NrConfigType;
+import com.qti.extphone.NrIconType;
+import com.qti.extphone.QRadioResponseInfo;
+import com.qti.extphone.SignalStrength;
+import com.qti.extphone.Status;
+import com.qti.extphone.Token;
+import com.qti.extphone.UpperLayerIndInfo;
+
+public class ExtPhoneCallbackBase extends IExtPhoneCallback.Stub {
+ private static final String TAG = "ExtPhoneCallbackBase";
+
+ @Override
+ public void onNrIconType(int slotId, Token token, Status status, NrIconType
+ nrIconType) throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onNrIconType: slotId = " + slotId + " token = " + token +
+ " status = " + status + " NrIconType = " + nrIconType);
+ }
+
+ @Override
+ public void onEnableEndc(int slotId, Token token, Status status) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onEnableEndc: slotId = " + slotId + " token = " + token +
+ " status = " + status);
+ }
+
+ @Override
+ public void onEndcStatus(int slotId, Token token, Status status, boolean enableStatus) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onEndcStatus: slotId = " + slotId + " token = " + token +
+ " status = " + status + " enableStatus = " + enableStatus);
+ }
+
+ @Override
+ public void onSetNrConfig(int slotId, Token token, Status status) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onSetNrConfig: slotId = " + slotId + " token = " + token +
+ " status = " +status);
+ }
+
+ @Override
+ public void onNrConfigStatus(int slotId, Token token, Status status, NrConfig nrConfig) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onNrConfigStatus: slotId = " + slotId + " token = " + token +
+ " status = " + status + " NrConfig = " + nrConfig);
+ }
+
+ @Override
+ public void sendCdmaSmsResponse(int slotId, Token token, Status status, SmsResult sms) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: sendCdmaSmsResponse: slotId = " + slotId +
+ " token = " + token + " status = " + status + " SmsResult = " + sms);
+ }
+
+ @Override
+ public void on5gStatus(int slotId, Token token, Status status, boolean enableStatus) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: on5gStatus: slotId = " + slotId + " token = " + token +
+ " status" + status + " enableStatus = " + enableStatus);
+ }
+
+ @Override
+ public void onAnyNrBearerAllocation(int slotId, Token token, Status status,
+ BearerAllocationStatus bearerStatus) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onNrBearerAllocationChange: slotId = " + slotId +
+ " token = " + token + " status = " + status + " bearerStatus = " + bearerStatus);
+ }
+
+ @Override
+ public void getQtiRadioCapabilityResponse(int slotId, Token token, Status status, int raf)
+ throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: getQtiRadioCapabilityResponse: slotId = " + slotId +
+ " token = " + token + " status" + status + " raf = " + raf);
+ }
+
+ public void onNrDcParam(int slotId, Token token, Status status, DcParam dcParam) throws
+ RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onNrDcParam: slotId = " + slotId +
+ " token = " + token + " status" + status + " dcParam = " + dcParam);
+ }
+
+ @Override
+ public void onUpperLayerIndInfo(int slotId, Token token, Status status,
+ UpperLayerIndInfo uilInfo) throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onUpperLayerIndInfo: slotId = " + slotId +
+ " token = " + token + " " + "status" + status +
+ " UpperLayerIndInfo = " + uilInfo);
+ }
+
+ @Override
+ public void on5gConfigInfo(int slotId, Token token, Status status, NrConfigType
+ nrConfigType) throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: on5gConfigInfo: slotId = " + slotId + " token = " +
+ token + " " + "status" + status + " NrConfigType = " + nrConfigType);
+ }
+
+ @Override
+ public void onSignalStrength(int slotId, Token token, Status status, SignalStrength
+ signalStrength) throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: onSignalStrength: slotId = " + slotId +
+ " token = " + token + " " + "status" + status +
+ " signalStrength = " + signalStrength);
+ }
+
+ @Override
+ public void setCarrierInfoForImsiEncryptionResponse(int slotId, Token token,
+ QRadioResponseInfo info) throws RemoteException {
+ Log.d(TAG, "UNIMPLEMENTED: setCarrierInfoForImsiEncryptionResponse: slotId = " + slotId +
+ " token = " + token + " info = " + info);
+ }
+
+ @Override
+ public void queryCallForwardStatusResponse(Status status, QtiCallForwardInfo[] infos) throws
+ RemoteException {
+ Log.d(TAG, "queryCallForwardStatusResponse: status = " + status + " CallForwardInfo = "
+ + infos);
+ }
+
+ @Override
+ public void getFacilityLockForAppResponse(Status status, int[] response) throws
+ RemoteException {
+ Log.d(TAG, "getFacilityLockForAppResponse: status = " + status + " response = "
+ + response);
+ }
+
+ @Override
+ public void setSmartDdsSwitchToggleResponse(Token token, boolean result) throws
+ RemoteException {
+ Log.d(TAG, "setSmartDdsSwitchToggleResponse: token = " + token + " result = " + result);
+ }
+}
diff --git a/extphone/src/com/qti/extphone/ExtTelephonyManager.java b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
new file mode 100644
index 0000000..98022d0
--- /dev/null
+++ b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
@@ -0,0 +1,754 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.util.Log;
+import android.os.Message;
+import android.content.Context;
+import android.os.IBinder;
+import android.os.Handler;
+import android.os.RemoteException;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.content.ComponentName;
+
+import android.telephony.ImsiEncryptionInfo;
+
+/**
+* ExtTelephonyManager class provides ExtTelephonyService interface to
+* the clients. Clients needs to instantiate this class to use APIs from
+* IExtPhone.aidl. ExtTelephonyManager class has the logic to connect
+* or disconnect to the bound service.
+*/
+public class ExtTelephonyManager {
+
+ private static final String LOG_TAG = "ExtTelephonyManager";
+ private static final boolean DBG = true;
+ private static Context mContext;
+ private Boolean mServiceConnected;
+ private ExtTelephonyServiceConnection mConnection;
+ private IExtPhone mExtTelephonyService = null;
+ private Handler mServiceConnectionStatusHandler = null;
+ private int mServiceConnectionStatusId;
+ private int INVALID = -1;
+ private static ExtTelephonyManager mInstance;
+ private ServiceCallback mServiceCb = null;
+ private static int mClientCount = 0;
+
+ /**
+ * Constructor
+ * @param context context in which the bindService will be
+ * initiated.
+ */
+ public ExtTelephonyManager(Context context) {
+ this.mContext = context;
+ mServiceConnected = false;
+ log("ExtTelephonyManager() ...");
+ }
+
+ /**
+ * This method returns the singleton instance of ExtTelephonyManager object
+ */
+ public static synchronized ExtTelephonyManager getInstance(Context context) {
+ synchronized (ExtTelephonyManager.class) {
+ if (mInstance == null) {
+ mInstance = new ExtTelephonyManager(context);
+ }
+ return mInstance;
+ }
+ }
+
+ /**
+ * To check if the service is connected or not
+ * @return boolean true if service is connected, false oterwise
+ */
+ public boolean isServiceConnected() {
+ return mServiceConnected;
+ }
+
+ public boolean isFeatureSupported(int feature) {
+ boolean ret = false;
+ if (!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.isFeatureSupported(feature);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "isFeatureSupported, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Initiate connection with the service.
+ *
+ * @param serviceCallback {@link ServiceCallback} to receive
+ * service-level callbacks.
+ *
+ * @return boolean Immediate result of the operation. true if
+ * successful.
+ * NOTE: This does not garuntee a successful
+ * connection. The client needs to use handler
+ * to listen to the Result.
+ */
+ public boolean connectService(ServiceCallback cb) {
+ mServiceCb = cb;
+ mClientCount += 1;
+ log("Creating ExtTelephonyService. If not started yet, start ...");
+ Intent intent = new Intent();
+ intent.setComponent(new ComponentName("com.qti.phone",
+ "com.qti.phone.ExtTelephonyService"));
+ mConnection = new ExtTelephonyServiceConnection();
+ boolean success = mContext.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
+ log("bindService result: " + success);
+ return success;
+ }
+
+ /**
+ * Disconnect the connection with the Service.
+ *
+ */
+ public void disconnectService() {
+ log( "disconnectService() mClientCount="+mClientCount);
+ if (mClientCount > 0) mClientCount -= 1;
+ if (mClientCount <= 0 && mConnection != null) {
+ mContext.unbindService(mConnection);
+ mConnection = null;
+ }
+ }
+
+ /**
+ *
+ * Internal helper functions/variables
+ */
+ private class ExtTelephonyServiceConnection implements ServiceConnection {
+
+ public void onServiceConnected(ComponentName name, IBinder boundService) {
+ mExtTelephonyService = IExtPhone.Stub.asInterface((IBinder) boundService);
+ if (mExtTelephonyService == null) {
+ log("ExtTelephonyService Connect Failed (onServiceConnected)... ");
+ } else {
+ log("ExtTelephonyService connected ... ");
+ }
+ mServiceConnected = true;
+ if (mServiceCb != null) {
+ mServiceCb.onConnected();
+ }
+ }
+
+ public void onServiceDisconnected(ComponentName name) {
+ log("The connection to the service got disconnected!");
+ mExtTelephonyService = null;
+ mServiceConnected = false;
+ if (mServiceCb != null) {
+ mServiceCb.onDisconnected();
+ }
+ }
+ }
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - integer value assigned
+ */
+ public int getPropertyValueInt(String property, int def) {
+ int ret = INVALID;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ log("getPropertyValueInt: property=" + property);
+ try {
+ ret = mExtTelephonyService.getPropertyValueInt(property, def);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "getPropertyValueInt, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - boolean value assigned
+ */
+ public boolean getPropertyValueBool(String property, boolean def) {
+ boolean ret = def;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ log("getPropertyValueBool: property=" + property);
+ try {
+ ret = mExtTelephonyService.getPropertyValueBool(property, def);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "getPropertyValueBool, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - string value assigned
+ */
+ public String getPropertyValueString(String property, String def) {
+ String ret = def;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ log("getPropertyValueString: property=" + property);
+ try {
+ ret = mExtTelephonyService.getPropertyValueString(property, def);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "getPropertyValueString, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Check if slotId has PrimaryCarrier SIM card present or not.
+ * @param - slotId
+ * @return true or false
+ */
+ public boolean isPrimaryCarrierSlotId(int slotId) {
+ boolean ret = false;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.isPrimaryCarrierSlotId(slotId);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "isPrimaryCarrierSlotId, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Get current primary card slot Id.
+ * @param - void
+ * @return slot index
+ */
+ public int getCurrentPrimaryCardSlotId() {
+ int ret = INVALID;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.getCurrentPrimaryCardSlotId();
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "getCurrentPrimaryCardSlotId, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Returns ID of the slot in which PrimaryCarrier SIM card is present.
+ * If none of the slots contains PrimaryCarrier SIM, this would return '-1'
+ * Supported values: 0, 1, -1
+ */
+ public int getPrimaryCarrierSlotId() {
+ int ret = INVALID;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.getPrimaryCarrierSlotId();
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "getPrimaryCarrierSlotId, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Set Primary card on given slot.
+ * @param - slotId to be set as Primary Card.
+ * @return void
+ */
+ public void setPrimaryCardOnSlot(int slotId) {
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return;
+ }
+ try {
+ mExtTelephonyService.setPrimaryCardOnSlot(slotId);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "setPrimaryCardOnSlot, remote exception");
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Perform incremental scan using QCRIL hooks.
+ * @param - slotId
+ * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
+ * @return true if the request has successfully been sent to the modem, false otherwise.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ public boolean performIncrementalScan(int slotId) {
+ boolean ret = false;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.performIncrementalScan(slotId);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "performIncrementalScan, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Abort incremental scan using QCRIL hooks.
+ * @param - slotId
+ * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
+ * @return true if the request has successfully been sent to the modem, false otherwise.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ public boolean abortIncrementalScan(int slotId) {
+ boolean ret = false;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.abortIncrementalScan(slotId);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "abortIncrementalScan, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Check for Sms Prompt is Enabled or Not.
+ * @return
+ * true - Sms Prompt is Enabled
+ * false - Sms prompt is Disabled
+ * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
+ */
+ public boolean isSMSPromptEnabled() {
+ boolean ret = false;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return ret;
+ }
+ try {
+ ret = mExtTelephonyService.isSMSPromptEnabled();
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "isSMSPromptEnabled, remote exception");
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ /**
+ * Enable/Disable Sms prompt option.
+ * @param - enabled
+ * true - to enable Sms prompt
+ * false - to disable Sms prompt
+ * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ public void setSMSPromptEnabled(boolean enabled) {
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return;
+ }
+ try {
+ mExtTelephonyService.setSMSPromptEnabled(enabled);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "setSMSPromptEnabled, remote exception");
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * supply pin to unlock sim locked on network.
+ * @param - netpin - network pin to unlock the sim.
+ * @param - type - PersoSubState for which the sim is locked onto.
+ * @param - callback - callback to notify UI, whether the request was success or failure.
+ * @param - phoneId - slot id on which the pin request is sent.
+ * @return void
+ */
+ public void supplyIccDepersonalization(String netpin, String type,
+ IDepersoResCallback callback, int phoneId) {
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return;
+ }
+ try {
+ mExtTelephonyService.supplyIccDepersonalization(netpin,
+ type, callback, phoneId);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "supplyIccDepersonalization, remote exception");
+ e.printStackTrace();
+ }
+ }
+
+ public Token enableEndc(int slot, boolean enable, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.enableEndc(slot, enable, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "enableEndc, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryNrIconType(int slot, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryNrIconType(slot, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "queryNrIconType, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryEndcStatus(int slot, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryEndcStatus(slot, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "queryEndcStatus, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token setNrConfig(int slot, NrConfig config, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.setNrConfig(slot, config, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "setNrConfig, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryNrConfig(int slot, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryNrConfig(slot, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "queryNrConfig, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token sendCdmaSms(int slot, byte[] pdu, boolean expectMore, Client client) {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.sendCdmaSms(slot, pdu, expectMore, client);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "sendCdmaSms, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token getQtiRadioCapability(int slotId, Client client) throws RemoteException {
+ Token token = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ token = mExtTelephonyService.getQtiRadioCapability(slotId, client);
+ return token;
+ }
+
+ public Token enable5g(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.enable5g(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "enable5g, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token disable5g(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.disable5g(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "disable5g, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryNrBearerAllocation(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryNrBearerAllocation(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "queryNrBearerAllocation, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token setCarrierInfoForImsiEncryption(int slot, ImsiEncryptionInfo info,
+ Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.setCarrierInfoForImsiEncryption(slot, info, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "setCarrierInfoForImsiEncryption, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token enable5gOnly(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.enable5gOnly(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "enable5gOnly, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token query5gStatus(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.query5gStatus(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "query5gStatus, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryNrDcParam(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryNrDcParam(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "queryNrDcParam, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryNrSignalStrength(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryNrSignalStrength(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "queryNrSignalStrength, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token queryUpperLayerIndInfo(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.queryUpperLayerIndInfo(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "queryUpperLayerIndInfo, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public Token query5gConfigInfo(int slot, Client client) {
+ Token token = null;
+ if(!mServiceConnected){
+ Log.e(LOG_TAG, "service not connected!");
+ return token;
+ }
+ try {
+ token = mExtTelephonyService.query5gConfigInfo(slot, client);
+ } catch(RemoteException e){
+ Log.e(LOG_TAG, "query5gConfigInfo, remote exception");
+ e.printStackTrace();
+ }
+ return token;
+ }
+
+ public void queryCallForwardStatus(int slotId, int cfReason, int serviceClass, String number,
+ boolean expectMore, Client client) throws RemoteException {
+ try {
+ mExtTelephonyService.queryCallForwardStatus(slotId, cfReason, serviceClass, number,
+ expectMore, client);
+ } catch(RemoteException e){
+ throw new RemoteException("queryCallForwardStatus ended in remote exception");
+ }
+ }
+
+ public void getFacilityLockForApp(int slotId, String facility, String password,
+ int serviceClass, String appId, boolean expectMore, Client client)
+ throws RemoteException {
+ try {
+ mExtTelephonyService.getFacilityLockForApp(slotId, facility, password, serviceClass,
+ appId, expectMore, client);
+ } catch(RemoteException e){
+ throw new RemoteException("getFacilityLockForApp ended in remote exception");
+ }
+ }
+
+
+ public boolean isSmartDdsSwitchFeatureAvailable() throws RemoteException {
+ try {
+ return mExtTelephonyService.isSmartDdsSwitchFeatureAvailable();
+ } catch (RemoteException e) {
+ throw new RemoteException("isSmartDdsSwitchFeatureAvailable ended in remote exception");
+ }
+ }
+
+ public void setSmartDdsSwitchToggle(boolean isEnabled, Client client)
+ throws RemoteException {
+ try {
+ mExtTelephonyService.setSmartDdsSwitchToggle(isEnabled, client);
+ } catch (RemoteException e) {
+ throw new RemoteException("setSmartDdsSwitchToggle ended in remote exception");
+ }
+ }
+
+ public Client registerCallback(String packageName, IExtPhoneCallback callback) {
+ Client client = null;
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return client;
+ }
+ try {
+ client = mExtTelephonyService.registerCallback(packageName, callback);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "registerCallback, remote exception");
+ e.printStackTrace();
+ }
+ return client;
+ }
+
+ public void unRegisterCallback(IExtPhoneCallback callback) {
+ if (!mServiceConnected) {
+ Log.e(LOG_TAG, "service not connected!");
+ return;
+ }
+ try {
+ mExtTelephonyService.unRegisterCallback(callback);
+ } catch(RemoteException e) {
+ Log.e(LOG_TAG, "unRegisterCallback, remote exception");
+ e.printStackTrace();
+ }
+ }
+
+ private void log(String str) {
+ if (DBG) {
+ Log.d(LOG_TAG, str);
+ }
+ }
+}
diff --git a/extphone/src/com/qti/extphone/IDepersoResCallback.aidl b/extphone/src/com/qti/extphone/IDepersoResCallback.aidl
new file mode 100644
index 0000000..80beb31
--- /dev/null
+++ b/extphone/src/com/qti/extphone/IDepersoResCallback.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+oneway interface IDepersoResCallback {
+ void onDepersoResult(int result, int phoneId);
+}
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/IExtPhone.aidl b/extphone/src/com/qti/extphone/IExtPhone.aidl
new file mode 100644
index 0000000..0a0f20a
--- /dev/null
+++ b/extphone/src/com/qti/extphone/IExtPhone.aidl
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.telephony.ImsiEncryptionInfo;
+
+import com.qti.extphone.Token;
+import com.qti.extphone.Client;
+import com.qti.extphone.IDepersoResCallback;
+import com.qti.extphone.IExtPhoneCallback;
+import com.qti.extphone.NrConfig;
+
+interface IExtPhone {
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - integer value assigned
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ int getPropertyValueInt(String property, int def);
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - boolean value assigned
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ boolean getPropertyValueBool(String property, boolean def);
+
+ /**
+ * Get value assigned to vendor property
+ * @param - property name
+ * @param - default value of property
+ * @return - string value assigned
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ String getPropertyValueString(String property, String def);
+
+ /**
+ * Get current primary card slot Id.
+ * @param - void
+ * @return slot index
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ int getCurrentPrimaryCardSlotId();
+
+ /**
+ * Returns ID of the slot in which PrimaryCarrier SIM card is present.
+ * If none of the slots contains PrimaryCarrier SIM, this would return '-1'
+ * Supported values: 0, 1, -1
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ int getPrimaryCarrierSlotId();
+
+ /**
+ * Check if slotId has PrimaryCarrier SIM card present or not.
+ * @param - slotId
+ * @return true or false
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ boolean isPrimaryCarrierSlotId(int slotId);
+
+ /**
+ * Set Primary card on given slot.
+ * @param - slotId to be set as Primary Card.
+ * @return void
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ void setPrimaryCardOnSlot(int slotId);
+
+ /**
+ * Perform incremental scan using QCRIL hooks.
+ * @param - slotId
+ * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
+ * @return true if the request has successfully been sent to the modem, false otherwise.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ boolean performIncrementalScan(int slotId);
+
+ /**
+ * Abort incremental scan using QCRIL hooks.
+ * @param - slotId
+ * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
+ * @return true if the request has successfully been sent to the modem, false otherwise.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ boolean abortIncrementalScan(int slotId);
+
+ /**
+ * Check for Sms Prompt is Enabled or Not.
+ * @return
+ * true - Sms Prompt is Enabled
+ * false - Sms prompt is Disabled
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ boolean isSMSPromptEnabled();
+
+ /**
+ * Enable/Disable Sms prompt option.
+ * @param - enabled
+ * true - to enable Sms prompt
+ * false - to disable Sms prompt
+ * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ void setSMSPromptEnabled(boolean enabled);
+
+ /**
+ * supply pin to unlock sim locked on network.
+ * @param - netpin - network pin to unlock the sim.
+ * @param - type - PersoSubState for which the sim is locked onto.
+ * @param - callback - callback to notify UI, whether the request was success or failure.
+ * @param - phoneId - slot id on which the pin request is sent.
+ * @return void
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ void supplyIccDepersonalization(String netpin, String type, in IDepersoResCallback callback,
+ int phoneId);
+
+ /**
+ * Async api
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ Token queryNrIconType(int slotId, in Client client);
+
+ /**
+ * Enable/disable endc on a given slotId.
+ * @param - slotId
+ * @param - enabled
+ * true - to enable endc
+ * false - to disable endc
+ * @param - client registered with packagename to receive
+ * callbacks.
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ Token enableEndc(int slotId, boolean enable, in Client client);
+
+ /**
+ * To query endc status on a given slotId.
+ * @param - slotId
+ * @param - client registered with packagename to receive
+ * callbacks.
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ Token queryEndcStatus(int slotId, in Client client);
+
+ /**
+ * Async api
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ Client registerCallback(String packageName, IExtPhoneCallback callback);
+
+ /**
+ * Async api
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ void unRegisterCallback(IExtPhoneCallback callback);
+
+ /**
+ * Set nr config to NSA/SA/NSA+SA on a given slotId.
+ * @param - slotId
+ * @param - def
+ * NR_CONFIG_INVALID - invalid config
+ * NR_CONFIG_COMBINED_SA_NSA - set to NSA+SA
+ * NR_CONFIG_NSA - set to NSA
+ * NR_CONFIG_SA - set to SA
+ * @param - client registered with packagename to receive
+ * callbacks.
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ Token setNrConfig(int slotId, in NrConfig def, in Client client);
+
+ /**
+ * Query current nr config on a given slotId.
+ * @param - slotId
+ * @param - client registered with packagename to receive
+ * callbacks.
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ Token queryNrConfig(int slotId, in Client client);
+
+ /**
+ * Send a CDMA SMS message on a given slotId.
+ * @param - slotId
+ * @param - pdu contains the message to be sent
+ * callbacks.
+ * @param expectMore more messages are expected to be sent or not
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ Token sendCdmaSms(int slotId, in byte[] pdu, boolean expectMore, in Client client);
+
+ /**
+ * Get phone radio capability.
+ * @param - slotId
+ * @param - client registered with packagename to receive callbacks.
+ * @return Integer Token to be used to compare with the response.
+ * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ Token getQtiRadioCapability(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token enable5g(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token disable5g(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token queryNrBearerAllocation(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token enable5gOnly(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token query5gStatus(int slotId, in Client client);
+
+ /**
+ * Async api
+ * a.k.a NR EN-DC and restrict-DCNR.
+ * @deprecated
+ */
+ Token queryNrDcParam(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token queryNrSignalStrength(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token queryUpperLayerIndInfo(int slotId, in Client client);
+
+ /**
+ * Async api
+ * @deprecated
+ */
+ Token query5gConfigInfo(int slotId, in Client client);
+
+ /**
+ * Send a CarrierInfoForImsiEncryption request.
+ * @param - slotId
+ * @param - pdu contains the message to be sent
+ * callbacks.
+ * @param expectMore more messages are expected to be sent or not
+ * @return Integer Token to be used to compare with the response.
+ */
+ Token setCarrierInfoForImsiEncryption(int slotId,
+ in ImsiEncryptionInfo info, in Client client);
+
+ /**
+ * Query call forward status for the given reason.
+ *
+ * cfReason is one of CF_REASON_*
+ * @param expectMore more messages are expected to be sent or not
+ * @param - client registered with packagename to receive
+ * callbacks.
+ */
+ void queryCallForwardStatus(int slotId, int cfReason, int serviceClass, String number,
+ boolean expectMore, in Client client);
+
+ /**
+ * Query the status of a facility lock state
+ *
+ * @param facility is the facility string code from TS 27.007 7.4
+ * (eg "AO" for BAOC, "SC" for SIM lock)
+ * @param password is the password, or "" if not required
+ * @param serviceClass is the TS 27.007 service class bit vector of services to query
+ * @param appId is AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ * This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
+ * @param - client registered with packagename to receive
+ * callbacks.
+ */
+ void getFacilityLockForApp(int slotId, String facility, String password, int serviceClass,
+ String appId, boolean expectMore, in Client client);
+
+ /**
+ * Check whether the smart DDS switch feature supported
+ *
+ * @return - boolean value indicating whether the smart DDS switch feature is available
+ */
+ boolean isSmartDdsSwitchFeatureAvailable();
+
+ /**
+ * Enable/disable the smart DDS switch
+ *
+ * @param - isEnabled is the switch on or off, true: on, false: off
+ * @param - client registered with packagename to receive callbacks
+ */
+ void setSmartDdsSwitchToggle(boolean isEnabled, in Client client);
+
+ boolean isFeatureSupported(int feature);
+}
diff --git a/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
new file mode 100644
index 0000000..483c57b
--- /dev/null
+++ b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import com.qti.extphone.BearerAllocationStatus;
+import com.qti.extphone.DcParam;
+import com.qti.extphone.NrConfig;
+import com.qti.extphone.NrConfigType;
+import com.qti.extphone.NrIconType;
+import com.qti.extphone.QtiCallForwardInfo;
+import com.qti.extphone.QRadioResponseInfo;
+import com.qti.extphone.SignalStrength;
+import com.qti.extphone.SmsResult;
+import com.qti.extphone.Status;
+import com.qti.extphone.Token;
+import com.qti.extphone.UpperLayerIndInfo;
+
+interface IExtPhoneCallback {
+
+ void onNrIconType(int slotId, in Token token, in Status status,
+ in NrIconType nrIconType);
+
+ /**
+ * Response to enableEndc
+ * @param - slotId
+ * @param - token is the same token which is recived in enableEndc
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ */
+ void onEnableEndc(int slotId, in Token token, in Status status);
+
+ /**
+ * Response to queryEndcStatus
+ * @param - slotId
+ * @param - token is the same token which is recived in queryEndcStatus
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ * @param - enableStatus true if endce is enabled otherwise false
+ */
+ void onEndcStatus(int slotId, in Token token, in Status status, boolean enableStatus);
+
+ /**
+ * Response to setNrConfig
+ * @param - slotId
+ * @param - token is the same token which is recived in setNrConfig
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ */
+ void onSetNrConfig(int slotId, in Token token, in Status status);
+
+ /**
+ * Response to queryNrConfig
+ * @param - slotId
+ * @param - token is the same token which is recived in queryNrConfig
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ * @param - nrConfig: NSA + SA/NSA/SA
+ */
+ void onNrConfigStatus(int slotId, in Token token, in Status status, in NrConfig nrConfig);
+
+ /**
+ * Response to sendCdmaSms
+ * @param - slotId
+ * @param - token is the same token which is recived in sendCdmaSms
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ * @param sms Sms result struct as defined by SmsResult
+ *
+ */
+ void sendCdmaSmsResponse(int slotId, in Token token, in Status status, in SmsResult sms);
+
+ /**
+ * Response to getQtiRadioCapability
+ * @param - slotId
+ * @param - token is the same token which is recived in getQtiRadioCapability
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ * @param - raf Radio Access Family 32-bit bitmap of
+ * vendor.qti.hardware.radio.qtiradio.V2_6.RadioAccessFamily
+ */
+ void getQtiRadioCapabilityResponse(int slotId, in Token token, in Status status, int raf);
+
+ /**
+ * @deprecated
+ */
+ void on5gStatus(int slotId, in Token token, in Status status, boolean enableStatus);
+
+ /**
+ * @deprecated
+ */
+ void onAnyNrBearerAllocation(int slotId, in Token token, in Status status,
+ in BearerAllocationStatus bearerStatus);
+
+ /**
+ *@deprecated
+ */
+ void onNrDcParam(int slotId, in Token token, in Status status, in DcParam dcParam);
+
+ /**
+ * @deprecated
+ */
+ void onUpperLayerIndInfo(int slotId, in Token token, in Status status,
+ in UpperLayerIndInfo upperLayerInfo);
+
+ /**
+ * @deprecated
+ * use onNrConfigStatus instead to get current nr config.
+ */
+ void on5gConfigInfo(int slotId, in Token token, in Status status,
+ in NrConfigType nrConfigType);
+
+ /**
+ * @deprecated
+ */
+ void onSignalStrength(int slotId, in Token token, in Status status,
+ in SignalStrength signalStrength);
+
+ /**
+ * Response to setCarrierInfoForImsiEncryptionResponse
+ * @param - slotId
+ * @param - token is the same token which is recived in enableEndc
+ * @param - info QtiRadioResponseInfo
+ */
+ void setCarrierInfoForImsiEncryptionResponse(int slotId, in Token token,
+ in QRadioResponseInfo info);
+
+ /**
+ * @param status SUCCESS/FAILURE based on the modem Result code
+ * @param infos indicates array of CallForwardInfo, one for
+ * each distinct registered phone number.
+ * @return void.
+ */
+ void queryCallForwardStatusResponse(in Status status, in QtiCallForwardInfo[] infos);
+
+ /**
+ * @param - status SUCCESS/FAILURE based on the modem Result code
+ * @param response 0 is the TS 27.007 service class bit vector of
+ * services for which the specified barring facility
+ * is active. "0" means "disabled for all"
+ */
+ void getFacilityLockForAppResponse(in Status status, in int[] response);
+
+ /**
+ * Response to setSmartDdsSwitchToggle
+ * @param - token is the same token which is recived in setSmartDdsSwitchToggle
+ * @param - result SUCCESS/FAILURE based on the CnE HAL response
+ */
+ void setSmartDdsSwitchToggleResponse(in Token token, boolean result);
+}
diff --git a/extphone/src/com/qti/extphone/NrConfig.aidl b/extphone/src/com/qti/extphone/NrConfig.aidl
new file mode 100644
index 0000000..a3bfe8f
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrConfig.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable NrConfig;
diff --git a/extphone/src/com/qti/extphone/NrConfig.java b/extphone/src/com/qti/extphone/NrConfig.java
new file mode 100644
index 0000000..0423466
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrConfig.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class NrConfig implements Parcelable{
+ private static final String TAG = "NrConfig";
+
+ public static final int NR_CONFIG_INVALID = -1;
+ public static final int NR_CONFIG_COMBINED_SA_NSA = 0;
+ public static final int NR_CONFIG_NSA = 1;
+ public static final int NR_CONFIG_SA = 2;
+
+ private int mValue;
+
+ public NrConfig(int val) {
+ mValue = val;
+ }
+
+ public NrConfig(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ public int get() {
+ return mValue;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mValue);
+ }
+
+ public static final Parcelable.Creator<NrConfig> CREATOR = new Parcelable.Creator() {
+ public NrConfig createFromParcel(Parcel in) {
+ return new NrConfig(in);
+ }
+
+ public NrConfig[] newArray(int size) {
+ return new NrConfig[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + get();
+ }
+}
diff --git a/extphone/src/com/qti/extphone/NrConfigType.aidl b/extphone/src/com/qti/extphone/NrConfigType.aidl
new file mode 100644
index 0000000..d9122e0
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrConfigType.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable NrConfigType;
diff --git a/extphone/src/com/qti/extphone/NrConfigType.java b/extphone/src/com/qti/extphone/NrConfigType.java
new file mode 100644
index 0000000..2c9a675
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrConfigType.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class NrConfigType implements Parcelable{
+ private static final String TAG = "NrConfigType";
+
+ public static final int INVALID = -1;
+ public static final int NSA_CONFIGURATION = 0;
+ public static final int SA_CONFIGURATION = 1;
+
+ private int mValue;
+
+ public NrConfigType(int val) {
+ mValue = val;
+ }
+
+ public NrConfigType(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ public int getNrConfigType() {
+ return mValue;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mValue);
+ }
+
+ public static final Parcelable.Creator<NrConfigType> CREATOR = new Parcelable.Creator() {
+ public NrConfigType createFromParcel(Parcel in) {
+ return new NrConfigType(in);
+ }
+
+ public NrConfigType[] newArray(int size) {
+ return new NrConfigType[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + getNrConfigType();
+ }
+}
diff --git a/extphone/src/com/qti/extphone/NrIconType.aidl b/extphone/src/com/qti/extphone/NrIconType.aidl
new file mode 100644
index 0000000..4a00324
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrIconType.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable NrIconType;
diff --git a/extphone/src/com/qti/extphone/NrIconType.java b/extphone/src/com/qti/extphone/NrIconType.java
new file mode 100644
index 0000000..124968b
--- /dev/null
+++ b/extphone/src/com/qti/extphone/NrIconType.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class NrIconType implements Parcelable{
+ private static final String TAG = "NrIconType";
+
+ public static final int INVALID = -1;
+ public static final int TYPE_NONE = 0;
+ public static final int TYPE_5G_BASIC = 1;
+ public static final int TYPE_5G_UWB = 2;
+
+ private int mValue;
+
+ public NrIconType(int val) {
+ mValue = val;
+ }
+
+ public NrIconType(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ public int get() {
+ return mValue;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mValue);
+ }
+
+ public static final Parcelable.Creator<NrIconType> CREATOR = new Parcelable.Creator() {
+ public NrIconType createFromParcel(Parcel in) {
+ return new NrIconType(in);
+ }
+
+ public NrIconType[] newArray(int size) {
+ return new NrIconType[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + get();
+ }
+}
diff --git a/extphone/src/com/qti/extphone/QRadioResponseInfo.aidl b/extphone/src/com/qti/extphone/QRadioResponseInfo.aidl
new file mode 100644
index 0000000..e90b849
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QRadioResponseInfo.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable QRadioResponseInfo;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/QRadioResponseInfo.java b/extphone/src/com/qti/extphone/QRadioResponseInfo.java
new file mode 100644
index 0000000..2a7e800
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QRadioResponseInfo.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class QRadioResponseInfo implements Parcelable {
+
+ private static final String TAG = "QRadioResponseInfo";
+
+ // RadioResponseType
+ public static final int SOLICITED = 0;
+ public static final int SOLICITED_ACK = 1;
+ public static final int SOLICITED_ACK_EXP = 2;
+
+ // RadioError
+ public static final int NONE = 0;
+ public static final int RADIO_NOT_AVAILABLE = 1;
+ public static final int GENERIC_FAILURE = 2;
+
+ private int mResponseType;
+ private int mSerial;
+ private int mError;
+
+ public QRadioResponseInfo(int responseType, int serial, int error) {
+ mResponseType = responseType;
+ mSerial = serial;
+ mError = error;
+ }
+
+ public QRadioResponseInfo(Parcel in) {
+ mResponseType = in.readInt();
+ mSerial = in.readInt();
+ mError = in.readInt();
+ }
+
+ public int getResponseType() {
+ return mResponseType;
+ }
+
+ public int getSerial() {
+ return mSerial;
+ }
+
+ public int getError() {
+ return mError;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mResponseType);
+ out.writeInt(mSerial);
+ out.writeInt(mError);
+ }
+
+ public static final Parcelable.Creator<QRadioResponseInfo> CREATOR = new Parcelable.Creator() {
+ public QRadioResponseInfo createFromParcel(Parcel in) {
+ return new QRadioResponseInfo(in);
+ }
+
+ public QRadioResponseInfo[] newArray(int size) {
+ return new QRadioResponseInfo[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mResponseType = in.readInt();
+ mSerial = in.readInt();
+ mError = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": ResponseType: " + getResponseType() + " Serial: " + getSerial() +
+ " Error: " + getError();
+ }
+
+}
+
diff --git a/extphone/src/com/qti/extphone/QtiCallForwardInfo.aidl b/extphone/src/com/qti/extphone/QtiCallForwardInfo.aidl
new file mode 100644
index 0000000..fa66b16
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiCallForwardInfo.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable QtiCallForwardInfo;
diff --git a/extphone/src/com/qti/extphone/QtiCallForwardInfo.java b/extphone/src/com/qti/extphone/QtiCallForwardInfo.java
new file mode 100644
index 0000000..b8a40d5
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiCallForwardInfo.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class QtiCallForwardInfo implements Parcelable {
+ private static final String TAG = "QtiCallForwardInfo";
+
+ public int status; /*1 = active, 0 = not active */
+ public int reason; /* from TS 27.007 7.11 "reason" */
+ public int serviceClass; /* Saum of CommandsInterface.SERVICE_CLASS */
+ public int toa; /* "type" from TS 27.007 7.11 */
+ public String number; /* "number" from TS 27.007 7.11 */
+ public int timeSeconds; /* for CF no reply only */
+
+ public QtiCallForwardInfo() {
+ }
+
+ public QtiCallForwardInfo(Parcel in) {
+ status = in.readInt();
+ reason = in.readInt();
+ serviceClass = in.readInt();
+ toa = in.readInt();
+ number = in.readString();
+ timeSeconds = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(status);
+ out.writeInt(reason);
+ out.writeInt(serviceClass);
+ out.writeInt(toa);
+ out.writeString(number);
+ out.writeInt(timeSeconds);
+ }
+
+ public static final Parcelable.Creator<QtiCallForwardInfo> CREATOR = new Parcelable.Creator() {
+ public QtiCallForwardInfo createFromParcel(Parcel in) {
+ return new QtiCallForwardInfo(in);
+ }
+
+ public QtiCallForwardInfo[] newArray(int size) {
+ return new QtiCallForwardInfo[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ status = in.readInt();
+ reason = in.readInt();
+ serviceClass = in.readInt();
+ toa = in.readInt();
+ number = in.readString();
+ timeSeconds = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return "[QtiCallForwardInfo: status=" + (status == 0 ? " not active " : " active ")
+ + ", reason= " + reason + ", serviceClass= " + serviceClass
+ + ", timeSec= " + timeSeconds + " seconds" + "]";
+ }
+}
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/ServiceCallback.java b/extphone/src/com/qti/extphone/ServiceCallback.java
new file mode 100644
index 0000000..78800a1
--- /dev/null
+++ b/extphone/src/com/qti/extphone/ServiceCallback.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+public interface ServiceCallback {
+ public void onConnected();
+
+ public void onDisconnected();
+}
diff --git a/extphone/src/com/qti/extphone/SignalStrength.aidl b/extphone/src/com/qti/extphone/SignalStrength.aidl
new file mode 100644
index 0000000..bb521e5
--- /dev/null
+++ b/extphone/src/com/qti/extphone/SignalStrength.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable SignalStrength;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/SignalStrength.java b/extphone/src/com/qti/extphone/SignalStrength.java
new file mode 100644
index 0000000..a0d1cef
--- /dev/null
+++ b/extphone/src/com/qti/extphone/SignalStrength.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class SignalStrength implements Parcelable {
+
+ private static final String TAG = "SignalStrength";
+
+ public static final int INVALID = -32768;
+
+ private static final int MAX_NR_RSRP = -44;
+ private static final int MIN_NR_RSRP = -140;
+
+ private static final int MAX_NR_SNR = -160;
+ private static final int MIN_NR_SNR = -240;
+
+ private int mNrRsrp;
+ private int mNrSnr;
+
+ public SignalStrength() {
+ mNrRsrp = INVALID;
+ mNrSnr = INVALID;
+ }
+
+ public SignalStrength(int rsrp, int snr) {
+ mNrRsrp = rsrp;
+ mNrSnr = snr;
+ }
+
+ public SignalStrength(Parcel in) {
+ mNrRsrp = in.readInt();
+ mNrSnr = in.readInt();
+ }
+
+ public int getRsrp() {
+ return mNrRsrp;
+ }
+
+ public int getSnr() {
+ return mNrSnr;
+ }
+
+ @Override
+ public String toString() {
+ return (TAG + ": Rsrp: " + getRsrp() + " Snr: " + getSnr());
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mNrRsrp);
+ out.writeInt(mNrSnr);
+ }
+
+ public static final Parcelable.Creator<SignalStrength> CREATOR = new Parcelable.Creator() {
+ public SignalStrength createFromParcel(Parcel in) {
+ return new SignalStrength(in);
+ }
+
+ public SignalStrength[] newArray(int size) {
+ return new SignalStrength[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mNrRsrp = in.readInt();
+ mNrSnr = in.readInt();
+ }
+}
diff --git a/extphone/src/com/qti/extphone/SmsResult.aidl b/extphone/src/com/qti/extphone/SmsResult.aidl
new file mode 100644
index 0000000..f48abdf
--- /dev/null
+++ b/extphone/src/com/qti/extphone/SmsResult.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable SmsResult;
diff --git a/extphone/src/com/qti/extphone/SmsResult.java b/extphone/src/com/qti/extphone/SmsResult.java
new file mode 100644
index 0000000..79e833a
--- /dev/null
+++ b/extphone/src/com/qti/extphone/SmsResult.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class SmsResult implements Parcelable{
+ private static final String TAG = "SmsResult";
+
+ private int mMessageRef;
+ private String mAckPDU;
+ private int mErrorCode;
+
+ public SmsResult(int messageRef, String ackPDU, int errorCode) {
+ mMessageRef = messageRef;
+ mAckPDU = ackPDU;
+ mErrorCode = errorCode;
+ }
+
+ public SmsResult(Parcel in) {
+ mMessageRef = in.readInt();
+ mAckPDU = in.readString();
+ mErrorCode = in.readInt();
+ }
+
+ public int getMessageRef() {
+ return mMessageRef;
+ }
+
+ public String getAckPDU() {
+ return mAckPDU;
+ }
+
+ public int getErrorCode() {
+ return mErrorCode;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mMessageRef);
+ out.writeString(mAckPDU);
+ out.writeInt(mErrorCode);
+ }
+
+ public static final Parcelable.Creator<SmsResult> CREATOR = new Parcelable.Creator() {
+ public SmsResult createFromParcel(Parcel in) {
+ return new SmsResult(in);
+ }
+
+ public SmsResult[] newArray(int size) {
+ return new SmsResult[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mMessageRef = in.readInt();
+ mAckPDU = in.readString();
+ mErrorCode = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return "SmsResult{" + "mMessageRef=" + getMessageRef() + ", mErrorCode=" + getErrorCode() +
+ ", mAckPDU='" + getAckPDU() + '\'' + "}";
+ }
+}
diff --git a/extphone/src/com/qti/extphone/Status.aidl b/extphone/src/com/qti/extphone/Status.aidl
new file mode 100644
index 0000000..70f8e09
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Status.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable Status;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/Status.java b/extphone/src/com/qti/extphone/Status.java
new file mode 100644
index 0000000..5720437
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Status.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class Status implements Parcelable {
+
+ private static final String TAG = "Status";
+
+ public static final int EXCEPTION = -1;
+ public static final int FAILURE = 0;
+ public static final int SUCCESS = 1;
+
+ private int mStatus;
+
+ public Status(int status) {
+ mStatus = status;
+ }
+
+ public Status(Parcel in) {
+ mStatus = in.readInt();
+ }
+
+ public int get() {
+ return mStatus;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mStatus);
+ }
+
+ public static final Parcelable.Creator<Status> CREATOR = new Parcelable.Creator() {
+ public Status createFromParcel(Parcel in) {
+ return new Status(in);
+ }
+
+ public Status[] newArray(int size) {
+ return new Status[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mStatus = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + get();
+ }
+
+}
diff --git a/extphone/src/com/qti/extphone/Token.aidl b/extphone/src/com/qti/extphone/Token.aidl
new file mode 100644
index 0000000..78399e9
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Token.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable Token;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/Token.java b/extphone/src/com/qti/extphone/Token.java
new file mode 100644
index 0000000..b6d318b
--- /dev/null
+++ b/extphone/src/com/qti/extphone/Token.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Objects;
+
+public class Token implements Parcelable {
+
+ private static final String TAG = "Token";
+
+ public static final int UNSOL = -1;
+
+ private int mValue;
+
+ public Token(int val) {
+ mValue = val;
+ }
+
+ public Token(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ public int get() {
+ return mValue;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mValue);
+ }
+
+ public static final Parcelable.Creator<Token> CREATOR = new Parcelable.Creator() {
+ public Token createFromParcel(Parcel in) {
+ return new Token(in);
+ }
+
+ public Token[] newArray(int size) {
+ return new Token[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mValue = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": " + get();
+ }
+
+}
diff --git a/extphone/src/com/qti/extphone/UpperLayerIndInfo.aidl b/extphone/src/com/qti/extphone/UpperLayerIndInfo.aidl
new file mode 100644
index 0000000..f7bbc2b
--- /dev/null
+++ b/extphone/src/com/qti/extphone/UpperLayerIndInfo.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+parcelable UpperLayerIndInfo;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/UpperLayerIndInfo.java b/extphone/src/com/qti/extphone/UpperLayerIndInfo.java
new file mode 100644
index 0000000..fca940f
--- /dev/null
+++ b/extphone/src/com/qti/extphone/UpperLayerIndInfo.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class UpperLayerIndInfo implements Parcelable {
+
+ private static final String TAG = "UpperLayerIndInfo";
+
+ public static final int INVALID = -1;
+
+ public static final int PLMN_INFO_LIST_UNAVAILABLE = 0;
+ public static final int PLMN_INFO_LIST_AVAILABLE = 1;
+
+ public static final int UPPER_LAYER_IND_INFO_UNAVAILABLE = 0;
+ public static final int UPPER_LAYER_IND_INFO_AVAILABLE = 1;
+
+ private int mPlmnInfoListAvailable = PLMN_INFO_LIST_UNAVAILABLE;
+ private int mUpperLayerIndInfoAvailable = UPPER_LAYER_IND_INFO_UNAVAILABLE;
+
+ public UpperLayerIndInfo(int plmn, int ulinfo) {
+ mPlmnInfoListAvailable = plmn;
+ mUpperLayerIndInfoAvailable = ulinfo;
+ }
+
+ public UpperLayerIndInfo(Parcel in) {
+ mPlmnInfoListAvailable = in.readInt();
+ mUpperLayerIndInfoAvailable = in.readInt();
+ }
+
+ public int getPlmnInfoListAvailable() {
+ return mPlmnInfoListAvailable;
+ }
+
+ public int getUpperLayerIndInfoAvailable() {
+ return mUpperLayerIndInfoAvailable;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mPlmnInfoListAvailable);
+ out.writeInt(mUpperLayerIndInfoAvailable);
+ }
+
+ public static final Parcelable.Creator<UpperLayerIndInfo> CREATOR = new Parcelable.Creator() {
+ public UpperLayerIndInfo createFromParcel(Parcel in) {
+ return new UpperLayerIndInfo(in);
+ }
+
+ public UpperLayerIndInfo[] newArray(int size) {
+ return new UpperLayerIndInfo[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mPlmnInfoListAvailable = in.readInt();
+ mUpperLayerIndInfoAvailable = in.readInt();
+ }
+
+ @Override
+ public String toString() {
+ return TAG + ": PLMN: " + getPlmnInfoListAvailable() + " UpperLayerIndInfo: " +
+ getUpperLayerIndInfoAvailable();
+ }
+
+}
+
diff --git a/ims/ConfURIDialer/Android.bp b/ims/ConfURIDialer/Android.bp
index d22516a..f0a8406 100644
--- a/ims/ConfURIDialer/Android.bp
+++ b/ims/ConfURIDialer/Android.bp
@@ -5,9 +5,9 @@
srcs: ["**/*.java"],
- platform_apis: true,
+ sdk_version: "system_current",
certificate: "platform",
- system_ext_specific: true
+ product_specific: true
}
diff --git a/ims/ConfURIDialer/AndroidManifest.xml b/ims/ConfURIDialer/AndroidManifest.xml
index 2435929..fa9870f 100644
--- a/ims/ConfURIDialer/AndroidManifest.xml
+++ b/ims/ConfURIDialer/AndroidManifest.xml
@@ -42,6 +42,7 @@
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
+ <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
<application
android:label="@string/applicationLabel"
diff --git a/ims/ims-ext-common/Android.bp b/ims/ims-ext-common/Android.bp
index c9b0215..00799d2 100644
--- a/ims/ims-ext-common/Android.bp
+++ b/ims/ims-ext-common/Android.bp
@@ -1,6 +1,7 @@
java_library {
name: "ims-ext-common",
+ provides_uses_lib: "ims-ext-common",
installable: true,
sdk_version: "system_current",
aidl: {
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
index 0e7e853..4630a43 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
@@ -68,9 +68,6 @@
/* Call encryption status extra key. The value will be a boolean. */
public static final String CALL_ENCRYPTION_EXTRA_KEY = "CallEncryption";
- /* Call History Info extra key. The value will be a ArrayList of Strings. */
- public static final String EXTRAS_CALL_HISTORY_INFO = "CallHistoryInfo";
-
/* Call fail code extra key name */
public static final String EXTRAS_KEY_CALL_FAIL_EXTRA_CODE = "CallFailExtraCode";
@@ -255,9 +252,16 @@
* For TMO - 0 : Upon Request Mode (Disabled)
* 1 : Automatic Mode (Full)
* For Vzw - 1 : Automatic Mode (Full)
- *
*/
- public static final String PROPERTY_RTT_OPERATING_MODE = "persist.vendor.radio.rtt.operval";
+ public static final String QTI_IMS_RTT_OPERATING_MODE = "qti.settings.rtt_operation";
+
+ /**
+ * Whether dialing normal call is ON or OFF
+ * The value 1 - enable (Voice call), 0 - disable (RTT call)
+ * This is set through ImsSettings UI
+ */
+ public static final String QTI_IMS_CAN_START_RTT_CALL =
+ "qti.settings.can_start_rtt_call";
// RTT default phone id
public static final int RTT_DEFAULT_PHONE_ID = 0;
@@ -274,39 +278,18 @@
// RTT Visibility On
public static final int RTT_VISIBILITY_ENABLED = 1;
- /**
- * Broadcast Action: Send RTT Text Message
- */
- public static final String ACTION_SEND_RTT_TEXT =
- "org.codeaurora.intent.action.send.rtt.text";
+ // RTT Call Type Off
+ public static final int RTT_CALL_TYPE_RTT = 0;
- /**
- * RTT Text Value
- */
- public static final String RTT_TEXT_VALUE =
- "org.codeaurora.intent.action.rtt.textvalue";
+ // RTT Call Type On
+ public static final int RTT_CALL_TYPE_VOICE = 1;
- /**
- * Broadcast Action: RTT Operation
- */
- public static final String ACTION_RTT_OPERATION =
- "org.codeaurora.intent.action.send.rtt.operation";
-
- /**
- * RTT Operation Type
- */
- public static final String RTT_OPERATION_TYPE =
- "org.codeaurora.intent.action.rtt.operation.type";
-
- // RTT Operation Type can be one of the following
- // To request upgrade of regular call to RTT call
- public static final int RTT_UPGRADE_INITIATE = 1;
- // To accept incoming RTT upgrade request
- public static final int RTT_UPGRADE_CONFIRM = 2;
- // To reject incoming RTT upgrade request
- public static final int RTT_UPGRADE_REJECT = 3;
- // To request downgrade of RTT call to regular call
- public static final int RTT_DOWNGRADE_INITIATE = 4;
+ // RTT Operating mode
+ // Dials normal voice call by default and provides an option
+ // to upgrade call to RTT in InCallUi.
+ public static final int RTT_UPON_REQUEST_MODE = 0;
+ // All the calls dialed are RTT calls by default.
+ public static final int RTT_AUTOMATIC_MODE = 1;
// Recorder Auto-Scaling Factor
public static final int RECORDER_SCALING_FACTOR = 8;
@@ -428,4 +411,19 @@
public static final String EXTRAS_CALL_PROGRESS_INFO_TYPE = "CallProgInfoType";
public static final String EXTRAS_CALL_PROGRESS_REASON_CODE = "CallProgReasonCode";
public static final String EXTRAS_CALL_PROGRESS_REASON_TEXT = "CallProgReasonText";
+
+ /*Sms call back constants*/
+ public static final int SCBM_STATUS_EXIT = 0;
+ public static final int SCBM_STATUS_ENTER = 1;
+
+ /**
+ * Intent action broadcasted when Sms Callback Mode is changed
+ */
+ public static final String ACTION_SMS_CALLBACK_MODE =
+ "org.codeaurora.intent.action.SMS_CALLBACK_MODE";
+ /**
+ * Extra key for when modem enters/exits sms callback mode.
+ * Type: boolean
+ */
+ public static String EXTRA_SMS_CALLBACK_MODE = "sms_callback_mode";
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsUnsupportedImageFormatException.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallExtras.java
similarity index 69%
rename from ims/ims-ext-common/src/org/codeaurora/ims/QtiImsUnsupportedImageFormatException.java
rename to ims/ims-ext-common/src/org/codeaurora/ims/QtiCallExtras.java
index 4241577..b08910d 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsUnsupportedImageFormatException.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallExtras.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015, 2019-2021 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
@@ -25,22 +25,23 @@
* 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;
/**
- * This class is to handle custom unsupported image format exception
+ * The class contains definitions for Qti specific call extras related to value added features.
*/
-public class QtiImsUnsupportedImageFormatException extends QtiImsException {
+/**
+ * @hide
+ */
+public class QtiCallExtras {
- public QtiImsUnsupportedImageFormatException() {
- // Empty constructor
- }
+ /* Call History Info extra key. The value will be a ArrayList of Strings. */
+ public static final String EXTRAS_CALL_HISTORY_INFO = "CallHistoryInfo";
- public QtiImsUnsupportedImageFormatException(String message) {
- super(message);
- }
+ /* Call Diversion Info extra key. The value will be a ArrayList of Strings. */
+ public static final String EXTRAS_CALL_DIVERSION_INFO = "CallDiversionInfo";
- public QtiImsUnsupportedImageFormatException(String message, Throwable cause) {
- super(message, cause);
- }
+ /* MT DTMF Info extra key. The value will be a String. */
+ public static final String EXTRAS_INCOMING_DTMF_INFO = "IncomingDtmfInfo";
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
index 32a2a06..139d80c 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
@@ -133,4 +133,22 @@
*/
public static final String KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED =
"carrier_call_progress_notification";
+
+ /* List of numbers that should be treated as customer service numbers.
+ * Number list are whitelisted in carrier config file, more numbers could
+ * be added, below is format.
+ * <string-array name="carrier_support_video_service_numbers" num="2">
+ * <item value="0532100860086"/>
+ * <item value="0201008616"/>
+ * </string-array>
+ */
+ public static final String KEY_CARRIER_VIDEO_CUSTOMER_SERVICE_NUMBERS =
+ "carrier_support_video_service_numbers";
+
+ /* Config to determine if Carrier supports set media config (screen size and max avc and
+ * hevc resolution) to modem.
+ * true - if set media config is supported else false.
+ */
+ public static final String KEY_CARRIER_SEND_MEDIA_CONFIG_SUPPORTED =
+ "carrier_support_send_media_configs_to_radio_layer_bool";
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
index 9cb5381..78feebf 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
@@ -162,6 +162,19 @@
public ICrsCrbtController getCrsCrbtController(int phoneId) {
return onGetCrsCrbtController(phoneId);
}
+
+ @Override
+ public void queryCallForwardStatus(int phoneId, int reason, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener) {
+ onQueryCallForwardStatus(phoneId, reason, serviceClass, expectMore, listener);
+ }
+
+ @Override
+ public void queryCallBarring(int phoneId, int cbType, String password, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener) {
+ onQueryCallBarringStatus(phoneId, cbType, password, serviceClass, expectMore,
+ listener);
+ }
};
private QtiImsExtBinder mQtiImsExtBinder;
@@ -259,4 +272,12 @@
//no-op
return null;
}
+ protected void onQueryCallForwardStatus(int phoneId, int reason, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener) {
+ // no-op
+ }
+ protected void onQueryCallBarringStatus(int phoneId, int cbType, String password,
+ int serviceClass, boolean expectMore, IQtiImsExtListener listener) {
+ // no-op
+ }
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
index 6696415..ce7796a 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017, 2019-2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017, 2019-2021 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
@@ -29,6 +29,7 @@
package org.codeaurora.ims;
import org.codeaurora.ims.internal.IQtiImsExtListener;
+import android.telephony.ims.ImsCallForwardInfo;
/**
* This class contains default implementation for IQtiImsExtListener.
@@ -93,5 +94,13 @@
public void onUssdFailed(int phoneId, int type, int errorCode,
String errorMessage) {
}
+
+ @Override
+ public void queryCallForwardStatusResponse(int phoneId, ImsCallForwardInfo[] cfInfoList) {
+ }
+
+ @Override
+ public void queryCallBarringResponse(int[] response) {
+ }
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
index 4314eb9..d46b282 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
@@ -381,4 +381,26 @@
throw new QtiImsException("Failed to retrieve CrsCrbtInterface : " + e);
}
}
+
+ public void queryCallForwardStatus(int phoneId, int reason, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener) throws QtiImsException {
+ validateInvariants(phoneId);
+ try {
+ mQtiImsExt.queryCallForwardStatus(phoneId, reason, serviceClass, expectMore, listener);
+ } catch(RemoteException e) {
+ throw new QtiImsException("Remote ImsService queryCallForwardStatus : " + e);
+ }
+ }
+
+ public void queryCallBarring(int phoneId, int cbType, String password, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener) throws QtiImsException {
+ validateInvariants(phoneId);
+ try {
+ mQtiImsExt.queryCallBarring(phoneId, cbType, password, serviceClass, expectMore,
+ listener);
+ } catch(RemoteException e) {
+ throw new QtiImsException("Remote ImsService queryCallBarring : " + e);
+ }
+ }
+
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
index abda8cf..4358347 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
@@ -288,4 +288,35 @@
* Returns the ICrsCrbtnterface IBinder
*/
ICrsCrbtController getCrsCrbtController(int phoneId);
+
+ /**
+ * queryCallForwardStatus
+ * gets a call forwarding option.
+ *
+ * @param phoneId indicates the phone instance which triggered the request
+ * @param reason is one of the valid call forwarding
+ * CF_REASONS, as defined in
+ * <code>com.android.internal.telephony.CommandsInterface.</code>
+ * @param serviceClass is service class, that is used to get CFT
+ * SERVICE_CLASS, as defined in
+ * <code>com.android.internal.telephony.CommandsInterface.</code>
+ * @param listener an IQtiImsExtListener instance to indicate the response
+ * @param expectMore flag to indicate call forward callforward requests are in line.
+ * @return void
+ */
+ oneway void queryCallForwardStatus(int phoneId, int reason, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener);
+
+
+ /**
+ * Retrieves the configuration of the call barring for specified service class.
+ *
+ * @param cbType type of call barring to be queried; ImsUtInterface#CB_XXX
+ * @param result message to pass the result of this operation
+ * The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
+ * @param serviceClass service class for e.g. voice/video
+ * @param expectMore flag to indicate call forward callbarring requests are in line.
+ */
+ oneway void queryCallBarring(int phoneId, int cbType, String password, int serviceClass,
+ boolean expectMore, IQtiImsExtListener listener);
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
index 6416192..69c2e65 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, 2019-2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2016, 2019-2021 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
@@ -179,4 +179,17 @@
*
*/
void onUssdFailed(int phoneId, int type, int errorCode, String errorMessage);
+
+ /**
+ * @param phoneId indicates the phone instance which triggered the request
+ * @param cfInfoList array of ImsCallForwardInfo
+ * @return void.
+ */
+ void queryCallForwardStatusResponse(int phoneId, in ImsCallForwardInfo[] cfInfoList);
+
+ /**
+ * @param response indicates the callbarring status enabled or disabled.
+ */
+ void queryCallBarringResponse(in int[] response);
+
}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
index fbb2ca3..132cee2 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
@@ -226,6 +226,21 @@
return false;
}
+ public String[] getStringArray(Context context, int phoneId, String key) {
+ if (!isValidPhoneId(phoneId)) {
+ Log.d(TAG, "Invalid phone ID: " + phoneId);
+ return null;
+ }
+ sanityCheckConfigsLoaded(context, phoneId);
+ logd("getString", "mInitialized - " + mInitialized.get() + " context - " + context);
+ PersistableBundle pb = mConfigsMap.get(phoneId);
+ if (pb != null) {
+ return pb.getStringArray(key);
+ }
+ Log.d(TAG, "WARNING, no carrier configs on phone Id: " + phoneId);
+ return null;
+ }
+
private static void logd(String tag, String msg) {
if (DEBUG) {
android.util.Log.d(TAG, tag + DELIMITER + msg);
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
index 03ba272..449d423 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
@@ -35,6 +35,8 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
+import android.net.Uri;
+import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -45,6 +47,11 @@
import android.util.Log;
import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.lang.IllegalArgumentException;
+import java.lang.SecurityException;
import org.codeaurora.ims.QtiCallConstants;
import org.codeaurora.ims.QtiCarrierConfigs;
@@ -112,7 +119,6 @@
//Value representing volte preference is NOT known
public static final int QTI_IMS_VOLTE_PREF_UNKNOWN = 2;
-
/* Incoming conference call extra key */
public static final String QTI_IMS_INCOMING_CONF_EXTRA_KEY = "incomingConference";
@@ -197,13 +203,12 @@
QTI_IMS_STATIC_IMAGE_SETTING);
}
- private static boolean isValidUriStr(String uri) {
+ private static boolean isValidUriStr(String uriStr) {
/* uri is not valid if
- * 1. uri is null
- * 2. uri is empty
- * 3. uri doesn't exist in UE
+ * 1. uriStr is null
+ * 2. uriStr is empty
*/
- return uri != null && !uri.isEmpty() && (new File(uri)).exists();
+ return uriStr != null && !uriStr.isEmpty();
}
/**
@@ -248,28 +253,54 @@
* Decodes an image pointed to by uri as per requested Width and requested Height
* and returns a bitmap
*/
- public static Bitmap decodeImage(String uri, int reqWidth, int reqHeight) {
- if (uri == null) {
+ public static Bitmap decodeImage(String uriStr, Context context, int reqWidth, int reqHeight) {
+ if (uriStr == null) {
return null;
}
+ ParcelFileDescriptor parcelFileDescriptor = null;
- BitmapFactory.Options options = new BitmapFactory.Options();
- // Each pixel is stored on 4 bytes
- options.inPreferredConfig = Bitmap.Config.ARGB_8888;
- /* If set to true, the decoder will return null (no bitmap),
- but the out... fields (i.e. outWidth, outHeight and outMimeType)
- will still be set, allowing the caller to query the bitmap
- without having to allocate the memory for its pixels */
- options.inJustDecodeBounds = true;
- BitmapFactory.decodeFile(uri, options);
+ Uri uri = Uri.parse(uriStr);
- // Calculate inSampleSize
- options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
+ try {
+ parcelFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r");
+ FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
- // Decode bitmap with inSampleSize set
- options.inJustDecodeBounds = false;
- Bitmap bitmap = BitmapFactory.decodeFile(uri, options);
- return scaleImage(bitmap, reqWidth, reqHeight);
+ BitmapFactory.Options options = new BitmapFactory.Options();
+ // Each pixel is stored on 4 bytes
+ options.inPreferredConfig = Bitmap.Config.ARGB_8888;
+ /* If set to true, the decoder will return null (no bitmap),
+ but the out... fields (i.e. outWidth, outHeight and outMimeType)
+ will still be set, allowing the caller to query the bitmap
+ without having to allocate the memory for its pixels */
+ options.inJustDecodeBounds = true;
+ BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
+
+ // Calculate inSampleSize
+ options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
+
+ // Decode bitmap with inSampleSize set
+ options.inJustDecodeBounds = false;
+ Bitmap image = BitmapFactory.decodeFileDescriptor(fileDescriptor, null, options);
+
+ return scaleImage(image, reqWidth, reqHeight);
+ } catch (FileNotFoundException e) {
+ Log.e(LOG_TAG, "File not found for uri: " + uri + " exception : " + e);
+ } catch (IllegalArgumentException e) {
+ Log.e(LOG_TAG, "Check arguments passed to decodeFileDescriptor, exception : " + e);
+ } catch (SecurityException e) {
+ //If the selected static image file located under file path "/sdcard/" is deleted,
+ //SecurityException is thrown by ContentResolver#openFileDescriptor.
+ Log.e(LOG_TAG, "SecurityException, exception : " + e);
+ } finally {
+ try {
+ if (parcelFileDescriptor != null) {
+ parcelFileDescriptor.close();
+ }
+ } catch (IOException e) {
+ Log.e(LOG_TAG, "Closing parcelFileDescriptor " + " exception : " + e);
+ }
+ }
+ return null;
}
// scales the image using reqWidth/reqHeight and returns a scaled bitmap
@@ -341,7 +372,7 @@
throw new QtiImsException("invalid file path");
}
- Bitmap imageBitmap = decodeImage(uriStr, reqWidth, reqHeight);
+ Bitmap imageBitmap = decodeImage(uriStr, context, reqWidth, reqHeight);
if (imageBitmap == null) {
throw new QtiImsException("image decoding error");
}
@@ -516,6 +547,24 @@
Settings.Secure.RTT_CALLING_MODE + convertRttPhoneId(phoneId), value ? 1 : 0);
}
+ // Sets global settings with call type preference
+ public static void setCanStartRttCall(boolean value, Context context, int phoneId) {
+ android.provider.Settings.Global.putInt(context.getContentResolver(),
+ QtiCallConstants.QTI_IMS_CAN_START_RTT_CALL + convertRttPhoneId(phoneId),
+ value ? QtiCallConstants.RTT_CALL_TYPE_VOICE
+ : QtiCallConstants.RTT_CALL_TYPE_RTT);
+ }
+
+ // Returns true if can start RTT call
+ public static boolean canStartRttCall(Context context, int phoneId) {
+ if (!shallShowRttVisibilitySetting(phoneId, context)) {
+ return true;
+ }
+ return android.provider.Settings.Global.getInt(context.getContentResolver(),
+ QtiCallConstants.QTI_IMS_CAN_START_RTT_CALL + convertRttPhoneId(phoneId),
+ QtiCallConstants.RTT_CALL_TYPE_RTT) == QtiCallConstants.RTT_CALL_TYPE_RTT;
+ }
+
// Returns value of RTT visibility
public static int getRttVisibility(Context context) {
return getRttVisibility(context, QtiCallConstants.RTT_DEFAULT_PHONE_ID);
@@ -547,39 +596,45 @@
// Returns true if Carrier supports RTT auto upgrade
public static boolean isRttAutoUpgradeSupported(int phoneId, Context context) {
return isCarrierConfigEnabled(phoneId, context,
- "rtt_auto_upgrade_bool");
+ CarrierConfigManager.KEY_RTT_AUTO_UPGRADE_BOOL);
}
// Returns true if Carrier supports RTT for Video Calls
public static boolean isRttSupportedOnVtCalls(int phoneId, Context context) {
return isCarrierConfigEnabled(phoneId, context,
- "rtt_supported_for_vt_bool");
+ CarrierConfigManager.KEY_RTT_SUPPORTED_FOR_VT_BOOL);
}
// Returns true if Carrier supports RTT upgrade
// False otherwise
public static boolean isRttUpgradeSupported(int phoneId, Context context) {
return isCarrierConfigEnabled(phoneId, context,
- "rtt_upgrade_supported_bool");
+ CarrierConfigManager.KEY_RTT_UPGRADE_SUPPORTED_BOOL);
}
- // Utility to get the RTT Mode that is set through adb property
- // Mode can be either RTT_MODE_DISABLED or RTT_MODE_FULL
+ // Utility to get the RTT Mode that is set through ImsSettings
+ // Mode can be either RTT_UPON_REQUEST_MODE or RTT_AUTOMATIC_MODE
public static int getRttOperatingMode(Context context) {
return getRttOperatingMode(context, QtiCallConstants.RTT_DEFAULT_PHONE_ID);
}
+ // Utility to get the RTT Operation Mode that is set through ImsSettings
+ // Mode can be either RTT_UPON_REQUEST_MODE or RTT_AUTOMATIC_MODE
+ // Takes a phoneId to support DSDS configuration.
public static int getRttOperatingMode(Context context, int phoneId) {
- int mode = SystemProperties.getInt(QtiCallConstants.PROPERTY_RTT_OPERATING_MODE +
- convertRttPhoneId(phoneId), 0);
- return mode;
+ if (shallShowRttVisibilitySetting(phoneId, context)) {
+ return QtiCallConstants.RTT_AUTOMATIC_MODE;
+ }
+ return android.provider.Settings.Global.getInt(context.getContentResolver(),
+ QtiCallConstants.QTI_IMS_RTT_OPERATING_MODE + convertRttPhoneId(phoneId),
+ QtiCallConstants.RTT_UPON_REQUEST_MODE);
}
// Returns true if Carrier supports RTT downgrade
// False otherwise
public static boolean isRttDowngradeSupported(int phoneId, Context context) {
return isCarrierConfigEnabled(phoneId, context,
- "rtt_downgrade_supported_bool");
+ CarrierConfigManager.KEY_RTT_DOWNGRADE_SUPPORTED_BOOL);
}
// Returns true if Carrier support RTT visibility setting
@@ -589,6 +644,13 @@
QtiCarrierConfigs.KEY_SHOW_RTT_VISIBILITY_SETTING));
}
+ // Returns true if Carrier supports merging RTT calls
+ // False otherwise
+ public static boolean isRttMergeSupported(int phoneId, Context context) {
+ return isCarrierConfigEnabled(phoneId, context,
+ "allow_merging_rtt_calls_bool");
+ }
+
// Returns true if Carrier supports Cancel Modify Call
public static boolean isCancelModifyCallSupported(int phoneId, Context context) {
return (isCarrierConfigEnabled(phoneId, context,
@@ -637,6 +699,15 @@
QtiCallConstants.CALL_COMPOSER_DISABLED);
}
+ // Sets RTT Operation Mode to global settings
+ // Takes a phoneId to support DSDS configuration.
+ public static void setRttOperatingMode(ContentResolver contentResolver, int phoneId,
+ int rttOpMode) {
+ android.provider.Settings.Global.putInt(contentResolver,
+ QtiCallConstants.QTI_IMS_RTT_OPERATING_MODE + convertRttPhoneId(phoneId),
+ rttOpMode);
+ }
+
// Returns true if Carrier supports video CRS
public static boolean isVideoCrsSupported(int phoneId, Context context) {
return isCarrierConfigEnabled(phoneId, context,
@@ -654,4 +725,22 @@
return isCarrierConfigEnabled(phoneId, context,
QtiCarrierConfigs.KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED);
}
+
+ /**
+ * Retrieves the customer service numbers stored for specific operator
+ * Returns stored numbers, or null otherwise.
+ */
+ public static String[] getCustomerServiceNumbers(int phoneId, Context context) {
+ return QtiCarrierConfigHelper.getInstance().getStringArray(context, phoneId,
+ QtiCarrierConfigs.KEY_CARRIER_VIDEO_CUSTOMER_SERVICE_NUMBERS);
+ }
+
+ /**
+ * Returns true if carrier supports set media config(screen size, max
+ * avc/hevc resolution) to modem.
+ */
+ public static boolean isSendMediaConfigurationSupported(int phoneId, Context context) {
+ return isCarrierConfigEnabled(phoneId, context,
+ QtiCarrierConfigs.KEY_CARRIER_SEND_MEDIA_CONFIG_SUPPORTED);
+ }
}
diff --git a/internal/src/org/codeaurora/internal/IExtTelephony.aidl b/internal/src/org/codeaurora/internal/IExtTelephony.aidl
index fa9db8f..711eccf 100644
--- a/internal/src/org/codeaurora/internal/IExtTelephony.aidl
+++ b/internal/src/org/codeaurora/internal/IExtTelephony.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021, 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
@@ -30,16 +30,6 @@
package org.codeaurora.internal;
-import org.codeaurora.internal.IDepersoResCallback;
-import org.codeaurora.internal.IDsda;
-
-import org.codeaurora.internal.SignalStrength;
-import org.codeaurora.internal.Status;
-import org.codeaurora.internal.Token;
-import org.codeaurora.internal.DcParam;
-import org.codeaurora.internal.INetworkCallback;
-import org.codeaurora.internal.Client;
-import org.codeaurora.internal.NrConfig;
/**
* Interface used to interact with the telephony framework for
@@ -49,78 +39,6 @@
interface IExtTelephony {
/**
- * Returns the current SIM Manual provision status.
- * @param slotId user preferred slotId.
- * @return Card provision status as integer, below are
- * possible return values.
- * '0' - returned if Uicc Card is not provisioned.
- * '1' - returned if Uicc Card provisioned.
- * '-1'- returned if there is an error @ below layers OR
- * if framework does not received info from Modem yet.
- * '-2' returned when SIM card is not present in slot.
- * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
- */
- int getCurrentUiccCardProvisioningStatus(int slotId);
-
- /**
- * Returns the user preferred Uicc card provision status.
- * @param slotId user preferred slotId.
- * @return User preference value as integer, below are
- * possible return values.
- * '0' - returned if Uicc Card is not provisioned.
- * '1' - returned if Uicc Card provisioned.
- * '-1'- returned if there is an error @ below layers OR
- * if framework does not received info from Modem yet.
- * '-2' returned when SIM card is not present in slot.
- * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
- */
- int getUiccCardProvisioningUserPreference(int slotId);
-
- /**
- * Activates the Uicc card.
- * @param slotId user preferred slotId.
- * @return Uicc card activation result as Integer, below are
- * supported return values:
- * '0' - Success
- * '-1' -Generic Failure
- * '-2' -Invalid input
- * '-3 -Another request in progress
- * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- int activateUiccCard(int slotId);
-
- /**
- * Deactivates UICC card.
- * @param slotId user preferred slotId.
- * @return Uicc card deactivation result as Integer, below are
- * supported return values:
- * '0' - Success
- * '-1' -Generic Failure
- * '-2' -Invalid input
- * '-3 -Another request in progress
- * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- int deactivateUiccCard(int slotId);
-
- /**
- * Check for Sms Prompt is Enabled or Not.
- * @return
- * true - Sms Prompt is Enabled
- * false - Sms prompt is Disabled
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isSMSPromptEnabled();
-
- /**
- * Enable/Disable Sms prompt option.
- * @param - enabled
- * true - to enable Sms prompt
- * false - to disable Sms prompt
- * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- void setSMSPromptEnabled(boolean enabled);
-
- /**
* Get logical phone id for Emergency call.
* @param - void
* @return phone id
@@ -129,22 +47,6 @@
int getPhoneIdForECall();
/**
- * Set Primary card on given slot.
- * @param - slotId to be set as Primary Card.
- * @return void
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- void setPrimaryCardOnSlot(int slotId);
-
- /**
- * Check is FDN is enabled or not.
- * @param - void
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isFdnEnabled();
-
- /**
* Check if get the icc file handler from specific application family sucessfully
* @param slotId user preferred slotId.
* @param family UICC application family.
@@ -176,116 +78,6 @@
boolean writeEfToIcc(int slotId, int family, int efId, in byte[] efData);
/**
- * Get primary stack phone id.
- * @param - void
- * @return phone id
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- int getPrimaryStackPhoneId();
-
- /**
- * Check if number is emergency number or not.
- * @param - number
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isEmergencyNumber(String number);
-
- /**
- * Check if number is local emergency number or not.
- * @param - number
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isLocalEmergencyNumber(String number);
-
- /**
- * Check if number is potential emergency number or not.
- * @param - number
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isPotentialEmergencyNumber(String number);
-
- /**
- * Check if number is potential Local emergency number or not.
- * @param - number
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isPotentialLocalEmergencyNumber(String number);
-
- /**
- * Check if device in single stanby.
- * @param - void
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isDeviceInSingleStandby();
-
- /* Send local call hold request to RIL.
- * @param subId, send request on this subscription
- * @param enable
- * true - to enable local call hold
- * false - to disable local call hold
- * @return true or false
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- boolean setLocalCallHold(int subId, boolean enable);
-
- /**
- * Send switch to other subscription.
- * @param subId, send request on this subscription
- * @return void
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- void switchToActiveSub(int subId);
-
- /**
- * set adapter, so that IExtTelephony would have interface to send requests to service/telecom
- * @param dsdaAdapter, this adapter used by IExtTelephony as interface for requests in IDsda.
- * @return void
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- void setDsdaAdapter(in IDsda dsdaAdapter);
-
- /**
- * get active subscription.
- * @param void
- * @return subId of active subscription.
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- int getActiveSubscription();
-
- /**
- * returns device is in DSDA configuration or not.
- * @param void
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isDsdaEnabled();
-
- /**
- * supply pin to unlock sim locked on network.
- * @param - netpin - network pin to unlock the sim.
- * @param - type - PersoSubState for which the sim is locked onto.
- * @param - callback - callback to notify UI, whether the request was success or failure.
- * @param - phoneId - slot id on which the pin request is sent.
- * @return void
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- void supplyIccDepersonalization(String netpin, String type, in IDepersoResCallback callback,
- int phoneId);
-
- /**
- * Returns ID of the slot in which PrimaryCarrier SIM card is present.
- * If none of the slots contains PrimaryCarrier SIM, this would return '-1'
- * Supported values: 0, 1, -1
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- int getPrimaryCarrierSlotId();
-
- /**
* Check if slotId has PrimaryCarrier SIM card present or not.
* @param - slotId
* @return true or false
@@ -293,213 +85,4 @@
*/
boolean isPrimaryCarrierSlotId(int slotId);
- /**
- * Change SMSC address based on slotId.
- * @param - slotId
- * @param - SMSC address
- * @return true or false
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- boolean setSmscAddress(int slotId, String smsc);
-
- /**
- * Get SMSC address based on slotId.
- * @param - slotId
- * @param - SMSC address
- * @return SMSC address or null
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- String getSmscAddress(int slotId);
-
- /**
- * Perform incremental scan using QCRIL hooks.
- * @param - slotId
- * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
- * @return true if the request has successfully been sent to the modem, false otherwise.
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- boolean performIncrementalScan(int slotId);
-
- /**
- * Abort incremental scan using QCRIL hooks.
- * @param - slotId
- * Range: 0 <= slotId < {@link TelephonyManager#getActiveModemCount()}
- * @return true if the request has successfully been sent to the modem, false otherwise.
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- boolean abortIncrementalScan(int slotId);
-
- /**
- * Check if target available with given packageName.
- * @param packageName
- * @return true or false
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean isVendorApkAvailable(String packageName);
-
- /**
- * Get current primary card slot Id.
- * @param - void
- * @return slot index
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- int getCurrentPrimaryCardSlotId();
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- Token enable5g(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- Token disable5g(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- Token enable5gOnly(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token query5gStatus(int slotId, in Client client);
-
- /**
- * Async api
- * a.k.a NR EN-DC and restrict-DCNR.
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryNrDcParam(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryNrBearerAllocation(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryNrSignalStrength(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryUpperLayerIndInfo(int slotId, in Client client);
-
- /**
- * Async api
- * @deprecated
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token query5gConfigInfo(int slotId, in Client client);
-
- /**
- * Async api
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryNrIconType(int slotId, in Client client);
-
- /**
- * Enable/disable endc on a given slotId.
- * @param - slotId
- * @param - enabled
- * true - to enable endc
- * false - to disable endc
- * @param - client registered with packagename to receive
- * callbacks.
- * @return Integer Token to be used to compare with the response.
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- Token enableEndc(int slotId, boolean enable, in Client client);
-
- /**
- * To query endc status on a given slotId.
- * @param - slotId
- * @param - client registered with packagename to receive
- * callbacks.
- * @return Integer Token to be used to compare with the response.
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryEndcStatus(int slotId, in Client client);
-
- /**
- * Async api
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Client registerCallback(String packageName, INetworkCallback callback);
-
- /**
- * Async api
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- void unRegisterCallback(INetworkCallback callback);
-
- /**
- * Get value assigned to vendor property
- * @param - property name
- * @param - default value of property
- * @return - integer value assigned
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- int getPropertyValueInt(String property, int def);
-
- /**
- * Get value assigned to vendor property
- * @param - property name
- * @param - default value of property
- * @return - boolean value assigned
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- boolean getPropertyValueBool(String property, boolean def);
-
- /**
- * Get value assigned to vendor property
- * @param - property name
- * @param - default value of property
- * @return - string value assigned
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- String getPropertyValueString(String property, String def);
-
- /**
- * Set nr config to NSA/SA/NSA+SA on a given slotId.
- * @param - slotId
- * @param - def
- * NR_CONFIG_INVALID - invalid config
- * NR_CONFIG_COMBINED_SA_NSA - set to NSA+SA
- * NR_CONFIG_NSA - set to NSA
- * NR_CONFIG_SA - set to SA
- * @param - client registered with packagename to receive
- * callbacks.
- * @return Integer Token to be used to compare with the response.
- * Requires permission: android.Manifest.permission.MODIFY_PHONE_STATE
- */
- Token setNrConfig(int slotId, in NrConfig def, in Client client);
-
- /**
- * Query current nr config on a given slotId.
- * @param - slotId
- * @param - client registered with packagename to receive
- * callbacks.
- * @return Integer Token to be used to compare with the response.
- * Requires permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
- */
- Token queryNrConfig(int slotId, in Client client);
-
}
diff --git a/qti-hidl-wrapper/Android.bp b/qti-hidl-wrapper/Android.bp
index 6e1f38e..7db60fe 100644
--- a/qti-hidl-wrapper/Android.bp
+++ b/qti-hidl-wrapper/Android.bp
@@ -2,6 +2,7 @@
java_library {
name: "qti-telephony-hidl-wrapper",
+ provides_uses_lib: "qti-telephony-hidl-wrapper",
installable: true,
system_ext_specific: true,
sdk_version: "system_current",
@@ -13,6 +14,21 @@
}
+java_library {
+
+ name: "qti-telephony-hidl-wrapper-prd",
+ provides_uses_lib: "qti-telephony-hidl-wrapper-prd",
+ installable: true,
+ product_specific: true,
+ sdk_version: "system_current",
+
+ static_libs: [
+ "android.hidl.base-V1.0-java",
+ "android.hidl.manager-V1.0-java",
+ ],
+
+}
+
// ==========================================================================
prebuilt_etc {
@@ -25,3 +41,14 @@
system_ext_specific: true,
}
+
+prebuilt_etc {
+
+ name: "qti_telephony_hidl_wrapper_prd.xml",
+
+ // This will install the file in /product/etc/permissions
+ src: "qti_telephony_hidl_wrapper_prd.xml",
+ sub_dir: "permissions",
+ product_specific: true,
+
+}
diff --git a/qti-hidl-wrapper/qti_telephony_hidl_wrapper_prd.xml b/qti-hidl-wrapper/qti_telephony_hidl_wrapper_prd.xml
new file mode 100644
index 0000000..a1de23c
--- /dev/null
+++ b/qti-hidl-wrapper/qti_telephony_hidl_wrapper_prd.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+Copyright (c) 2020, 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.
+-->
+
+<permissions>
+ <library name="qti-telephony-hidl-wrapper-prd"
+ file="/product/framework/qti-telephony-hidl-wrapper-prd.jar"/>
+</permissions>
diff --git a/qti-utils/Android.bp b/qti-utils/Android.bp
index 6e3e9de..183d392 100644
--- a/qti-utils/Android.bp
+++ b/qti-utils/Android.bp
@@ -1,6 +1,7 @@
java_library {
name: "qti-telephony-utils",
+ provides_uses_lib: "qti-telephony-utils",
installable: true,
sdk_version: "system_current",
@@ -12,6 +13,20 @@
}
+java_library {
+ name: "qti-telephony-utils-prd",
+ provides_uses_lib: "qti-telephony-utils-prd",
+ installable: true,
+ sdk_version: "system_current",
+
+ srcs: ["src/org/**/*.java"],
+ product_specific: true,
+ libs: [
+ "androidx.annotation_annotation"
+ ]
+
+}
+
// ==========================================================================
prebuilt_etc {
@@ -26,3 +41,15 @@
system_ext_specific: true,
}
+
+prebuilt_etc {
+
+ name: "qti_telephony_utils_prd.xml",
+
+ // This will install the file in /product/etc/permissions
+
+ src: "qti_telephony_utils_prd.xml",
+ sub_dir: "permissions",
+ product_specific: true,
+
+}
diff --git a/qti-utils/qti_telephony_utils_prd.xml b/qti-utils/qti_telephony_utils_prd.xml
new file mode 100644
index 0000000..7063baa
--- /dev/null
+++ b/qti-utils/qti_telephony_utils_prd.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+copyright (c) 2020, 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.
+-->
+<permissions>
+ <library name="qti-telephony-utils-prd"
+ file="/product/framework/qti-telephony-utils-prd.jar"/>
+</permissions>
diff --git a/qti-utils/src/org/codeaurora/utils/EnhancedRadioCapabilityResponse.java b/qti-utils/src/org/codeaurora/utils/EnhancedRadioCapabilityResponse.java
new file mode 100644
index 0000000..3ebb5f7
--- /dev/null
+++ b/qti-utils/src/org/codeaurora/utils/EnhancedRadioCapabilityResponse.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ */
+
+/*
+ * Copyright (C) 2008 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 org.codeaurora.telephony.utils;
+
+import android.util.Log;
+
+public class EnhancedRadioCapabilityResponse {
+
+ private static String LOG_TAG = "EnhancedRadioCapabilityResponse";
+ private String mDeviceCapability;
+
+ public static final int NETWORK_TYPE_UNKNOWN = 0;
+ public static final int NETWORK_TYPE_GPRS = 1;
+ public static final int NETWORK_TYPE_EDGE = 2;
+ public static final int NETWORK_TYPE_UMTS = 3;
+ public static final int NETWORK_TYPE_CDMA = 4;
+ public static final int NETWORK_TYPE_EVDO_0 = 5;
+ public static final int NETWORK_TYPE_EVDO_A = 6;
+ public static final int NETWORK_TYPE_1xRTT = 7;
+ public static final int NETWORK_TYPE_HSDPA = 8;
+ public static final int NETWORK_TYPE_HSUPA = 9;
+ public static final int NETWORK_TYPE_HSPA = 10;
+ public static final int NETWORK_TYPE_IDEN = 11;
+ public static final int NETWORK_TYPE_EVDO_B = 12;
+ public static final int NETWORK_TYPE_LTE = 13;
+ public static final int NETWORK_TYPE_EHRPD = 14;
+ public static final int NETWORK_TYPE_HSPAP = 15;
+ public static final int NETWORK_TYPE_GSM = 16;
+ public static final int NETWORK_TYPE_TD_SCDMA = 17;
+ public static final int NETWORK_TYPE_IWLAN = 18;
+ public static final int NETWORK_TYPE_LTE_CA = 19;
+ public static final int NETWORK_TYPE_NR_NSA = 20;
+ public static final int NETWORK_TYPE_NR_SA = 21;
+
+ /**
+ * network type bitmask unknown.
+ */
+ public static final long NETWORK_TYPE_BITMASK_UNKNOWN = 0L;
+ /**
+ * network type bitmask indicating the support of radio tech GSM.
+ */
+ public static final long NETWORK_TYPE_BITMASK_GSM = (1 << (NETWORK_TYPE_GSM -1));
+ /**
+ * network type bitmask indicating the support of radio tech GPRS.
+ */
+ public static final long NETWORK_TYPE_BITMASK_GPRS = (1 << (NETWORK_TYPE_GPRS -1));
+ /**
+ * network type bitmask indicating the support of radio tech EDGE.
+ */
+ public static final long NETWORK_TYPE_BITMASK_EDGE = (1 << (NETWORK_TYPE_EDGE -1));
+ /**
+ * network type bitmask indicating the support of radio tech CDMA(IS95A/IS95B).
+ */
+ public static final long NETWORK_TYPE_BITMASK_CDMA = (1 << (NETWORK_TYPE_CDMA -1));
+ /**
+ * network type bitmask indicating the support of radio tech 1xRTT.
+ */
+ public static final long NETWORK_TYPE_BITMASK_1xRTT = (1 << (NETWORK_TYPE_1xRTT - 1));
+ /**
+ * network type bitmask indicating the support of radio tech EVDO 0.
+ */
+ public static final long NETWORK_TYPE_BITMASK_EVDO_0 = (1 << (NETWORK_TYPE_EVDO_0 -1));
+ /**
+ * network type bitmask indicating the support of radio tech EVDO A.
+ */
+ public static final long NETWORK_TYPE_BITMASK_EVDO_A = (1 << (NETWORK_TYPE_EVDO_A - 1));
+ /**
+ * network type bitmask indicating the support of radio tech EVDO B.
+ */
+ public static final long NETWORK_TYPE_BITMASK_EVDO_B = (1 << (NETWORK_TYPE_EVDO_B -1));
+ /**
+ * network type bitmask indicating the support of radio tech EHRPD.
+ */
+ public static final long NETWORK_TYPE_BITMASK_EHRPD = (1 << (NETWORK_TYPE_EHRPD -1));
+ /**
+ * network type bitmask indicating the support of radio tech HSUPA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_HSUPA = (1 << (NETWORK_TYPE_HSUPA -1));
+ /**
+ * network type bitmask indicating the support of radio tech HSDPA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_HSDPA = (1 << (NETWORK_TYPE_HSDPA -1));
+ /**
+ * network type bitmask indicating the support of radio tech HSPA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_HSPA = (1 << (NETWORK_TYPE_HSPA -1));
+ /**
+ * network type bitmask indicating the support of radio tech HSPAP.
+ */
+ public static final long NETWORK_TYPE_BITMASK_HSPAP = (1 << (NETWORK_TYPE_HSPAP -1));
+ /**
+ * network type bitmask indicating the support of radio tech UMTS.
+ */
+ public static final long NETWORK_TYPE_BITMASK_UMTS = (1 << (NETWORK_TYPE_UMTS -1));
+ /**
+ * network type bitmask indicating the support of radio tech TD_SCDMA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = (1 << (NETWORK_TYPE_TD_SCDMA -1));
+ /**
+ * network type bitmask indicating the support of radio tech LTE.
+ */
+ public static final long NETWORK_TYPE_BITMASK_LTE = (1 << (NETWORK_TYPE_LTE -1));
+ /**
+ * network type bitmask indicating the support of radio tech LTE CA (carrier aggregation).
+ */
+ public static final long NETWORK_TYPE_BITMASK_LTE_CA = (1 << (NETWORK_TYPE_LTE_CA -1));
+
+ /**
+ * network type bitmask indicating the support of radio tech NR(New Radio) 5G NSA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_NR_NSA = (1 << (NETWORK_TYPE_NR_NSA -1));
+
+ /**
+ * network type bitmask indicating the support of radio tech NR(New Radio) 5G SA.
+ */
+ public static final long NETWORK_TYPE_BITMASK_NR_SA = (1 << (NETWORK_TYPE_NR_SA -1));
+
+
+ public void updateEnhancedRadioCapability(int raf) {
+ Log.d(LOG_TAG, "updateEnhancedRadioCapability: raf:"+ raf);
+ if(raf == NETWORK_TYPE_BITMASK_UNKNOWN) {
+ return;
+ }
+ if((raf & NETWORK_TYPE_BITMASK_NR_SA) != 0){
+ mDeviceCapability = "SA";
+ } else if((raf & NETWORK_TYPE_BITMASK_NR_NSA) != 0) {
+ mDeviceCapability = "NSA";
+ } else if ((raf & NETWORK_TYPE_BITMASK_LTE) != 0) {
+ mDeviceCapability = "LTE";
+ } else if((raf & NETWORK_TYPE_BITMASK_TD_SCDMA) != 0) {
+ mDeviceCapability = "TD_SCDMA";
+ } else if((raf & NETWORK_TYPE_BITMASK_UMTS) != 0){
+ mDeviceCapability = "UMTS";
+ } else if((raf & NETWORK_TYPE_BITMASK_GSM) != 0){
+ mDeviceCapability = "GSM";
+ } else if((raf & NETWORK_TYPE_BITMASK_EVDO_A) != 0){
+ mDeviceCapability = "HDR";
+ } else if((raf & NETWORK_TYPE_BITMASK_1xRTT) != 0){
+ mDeviceCapability = "1xRTT";
+ }
+ Log.d(LOG_TAG, "updateEnhancedRadioCapability:"+ mDeviceCapability);
+ }
+
+ public String getEnhancedRadioCapability() {
+ Log.d(LOG_TAG, "getEnhancedRadioCapability: "+ mDeviceCapability);
+ return mDeviceCapability;
+ }
+}