Primary IMEI FR70532 changes
- Add getImeiInfo() API over IExtPhone.aidl
- Add onImeiTypeChanged() callback method over
IExtPhoneCallback.aidl
CRs-Fixed: 3049743
Change-Id: Idb5ec984d60df56d3581b5cd5980a6e7c15b960c
diff --git a/extphone/src/com/qti/extphone/ExtTelephonyManager.java b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
index 98022d0..68f13cb 100644
--- a/extphone/src/com/qti/extphone/ExtTelephonyManager.java
+++ b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
@@ -700,6 +700,22 @@
}
}
+ /**
+ * To get the IMEI information of all slots on device.
+ * @return
+ * QtiImeiInfo[], contains array of imeiInfo(i.e slotId, IMEI string and IMEI type).
+ *
+ * The calling application should not assume returned array index as slotId, instead the
+ * application has to use the slotId that present in QtiImeiInfo object to know the IMEI
+ * corresponds to a slot.
+ *
+ * Requires Permission: android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
+ */
+ public QtiImeiInfo[] getImeiInfo() {
+ Log.e(LOG_TAG, "getImeiInfo not supported");
+ // TODO : Get & Return IMEI info from ExtTelephonyServiceImpl.java
+ return null;
+ }
public boolean isSmartDdsSwitchFeatureAvailable() throws RemoteException {
try {
diff --git a/extphone/src/com/qti/extphone/QtiImeiInfo.aidl b/extphone/src/com/qti/extphone/QtiImeiInfo.aidl
new file mode 100644
index 0000000..cc66fe1
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiImeiInfo.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 QtiImeiInfo;
diff --git a/extphone/src/com/qti/extphone/QtiImeiInfo.java b/extphone/src/com/qti/extphone/QtiImeiInfo.java
new file mode 100644
index 0000000..5bfc78e
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiImeiInfo.java
@@ -0,0 +1,114 @@
+/*
+ * 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;
+
+import java.util.Objects;
+
+public class QtiImeiInfo implements Parcelable {
+ private static final String TAG = "QtiImeiInfo";
+
+ public static final int IMEI_TYPE_INVALID = -1;
+ public static final int IMEI_TYPE_PRIMARY = 0;
+ public static final int IMEI_TYPE_SECONDARY = 1;
+
+ private int mSlotId;
+ private String mImei;
+ private int mImeiType;
+
+ public QtiImeiInfo(int slotId, String imei, int imeiType) {
+ mSlotId = slotId;
+ mImei = imei;
+ mImeiType = imeiType;
+ }
+
+ public QtiImeiInfo(Parcel in) {
+ mSlotId = in.readInt();
+ mImei = in.readString();
+ mImeiType = in.readInt();
+ }
+
+ public int getSlotId() {
+ return mSlotId;
+ }
+
+ public String getImei() {
+ return mImei;
+ }
+
+ public int getImeiType() {
+ return mImeiType;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mSlotId);
+ out.writeString(mImei);
+ out.writeInt(mImeiType);
+ }
+
+ public static final Parcelable.Creator<QtiImeiInfo> CREATOR = new Parcelable.Creator() {
+ public QtiImeiInfo createFromParcel(Parcel in) {
+ return new QtiImeiInfo(in);
+ }
+
+ public QtiImeiInfo[] newArray(int size) {
+ return new QtiImeiInfo[size];
+ }
+ };
+
+ public void readFromParcel(Parcel in) {
+ mSlotId = in.readInt();
+ mImei = in.readString();
+ mImeiType = in.readInt();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ QtiImeiInfo imeiInfo = (QtiImeiInfo) o;
+
+ return this.mSlotId == imeiInfo.mSlotId &&
+ this.mImeiType == imeiInfo.mImeiType &&
+ Objects.equals(this.mImei, imeiInfo.mImei);
+ }
+
+ @Override
+ public String toString() {
+ return "QtiImeiInfo{" + " slotId=" + mSlotId + " mImeiType=" + getImeiType() + "}";
+ }
+}