diff --git a/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
index 49e1ccf..cc31b58 100644
--- a/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
+++ b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
@@ -30,7 +30,7 @@
 /*
  * Changes from Qualcomm Innovation Center are provided under the following license:
  *
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * SPDX-License-Identifier: BSD-3-Clause-Clear
  */
 
@@ -285,4 +285,9 @@
     public void onDualDataRecommendation(DualDataRecommendation rec)
             throws RemoteException {
     }
+
+    @Override
+    public void onSimPersoUnlockStatusChange(int slotId, QtiPersoUnlockStatus persoUnlockStatus)
+            throws RemoteException {
+    }
 }
diff --git a/extphone/src/com/qti/extphone/ExtPhoneCallbackListener.java b/extphone/src/com/qti/extphone/ExtPhoneCallbackListener.java
index e3016e2..d4b006e 100644
--- a/extphone/src/com/qti/extphone/ExtPhoneCallbackListener.java
+++ b/extphone/src/com/qti/extphone/ExtPhoneCallbackListener.java
@@ -22,6 +22,7 @@
 import com.qti.extphone.NrConfigType;
 import com.qti.extphone.NrIconType;
 import com.qti.extphone.QRadioResponseInfo;
+import com.qti.extphone.QtiPersoUnlockStatus;
 import com.qti.extphone.SignalStrength;
 import com.qti.extphone.Status;
 import com.qti.extphone.Token;
@@ -76,6 +77,7 @@
     public static final int EVENT_ON_DUAL_DATA_CAPABILITY_CHANGED = 39;
     public static final int EVENT_SET_DUAL_DATA_USER_PREFERENCE_RESPONSE = 40;
     public static final int EVENT_ON_DUAL_DATA_RECOMMENDATION = 41;
+    public static final int EVENT_ON_SIM_PERSO_UNLOCK_STATUS_CHANGE = 42;
 
     private Handler mHandler;
     IExtPhoneCallback mCallback = new IExtPhoneCallbackStub(this);
@@ -518,6 +520,17 @@
                             Log.e(TAG, "EVENT_ON_DUAL_DATA_RECOMMENDATION : Exception = " + e);
                         }
                         break;
+                    case EVENT_ON_SIM_PERSO_UNLOCK_STATUS_CHANGE:
+                        try {
+                            IExtPhoneCallbackStub.Result result =
+                                    (IExtPhoneCallbackStub.Result) msg.obj;
+                            ExtPhoneCallbackListener.this.onSimPersoUnlockStatusChange(
+                                    result.mSlotId, (QtiPersoUnlockStatus)result.mData);
+                        } catch (RemoteException e) {
+                            Log.e(TAG,
+                                    "EVENT_ON_SIM_PERSO_UNLOCK_STATUS_CHANGE : Exception = " + e);
+                        }
+                        break;
                     default :
                         Log.d(TAG, "default : " + msg.what);
                 }
@@ -755,6 +768,12 @@
         Log.d(TAG, "UNIMPLEMENTED: onDualDataRecommendation: rec = " + rec);
     }
 
+    public void onSimPersoUnlockStatusChange(int slotId, QtiPersoUnlockStatus persoUnlockStatus)
+            throws RemoteException {
+        Log.d(TAG, "UNIMPLEMENTED: onSimPersoUnlockStatusChange: slotId = "
+                + slotId + " persoUnlockStatus = " + persoUnlockStatus);
+    }
+
     private static class IExtPhoneCallbackStub extends IExtPhoneCallback.Stub {
         private WeakReference<ExtPhoneCallbackListener> mExtPhoneCallbackListenerWeakRef;
 
@@ -1032,6 +1051,13 @@
                     new Result(-1, null, null, -1, rec));
         }
 
+        @Override
+        public void onSimPersoUnlockStatusChange(int slotId, QtiPersoUnlockStatus persoUnlockStatus)
+                throws RemoteException {
+            send(EVENT_ON_SIM_PERSO_UNLOCK_STATUS_CHANGE, 0, 0,
+                    new Result(slotId, null, null, -1, persoUnlockStatus));
+        }
+
         class Result {
             int mSlotId;
             Token mToken;
diff --git a/extphone/src/com/qti/extphone/ExtTelephonyManager.java b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
index 5d85322..b77a58d 100644
--- a/extphone/src/com/qti/extphone/ExtTelephonyManager.java
+++ b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
@@ -1143,6 +1143,20 @@
         return token;
     }
 
+    public QtiPersoUnlockStatus getSimPersoUnlockStatus(int slotId) {
+        QtiPersoUnlockStatus persoUnlockStatus = null;
+        if (!isServiceConnected()) {
+            Log.e(LOG_TAG, "service not connected!");
+            return persoUnlockStatus;
+        }
+        try {
+            persoUnlockStatus = mExtTelephonyService.getSimPersoUnlockStatus(slotId);
+        } catch (RemoteException e) {
+            Log.e(LOG_TAG, "Remote exception for getSimPersoUnlockStatus", e);
+        }
+        return persoUnlockStatus;
+    }
+
     public Client registerCallback(String packageName, IExtPhoneCallback callback) {
         Client client = null;
         if (!isServiceConnected()) {
diff --git a/extphone/src/com/qti/extphone/IExtPhone.aidl b/extphone/src/com/qti/extphone/IExtPhone.aidl
index 3ff300d..72641ce 100644
--- a/extphone/src/com/qti/extphone/IExtPhone.aidl
+++ b/extphone/src/com/qti/extphone/IExtPhone.aidl
@@ -45,6 +45,7 @@
 import com.qti.extphone.MsimPreference;
 import com.qti.extphone.NrConfig;
 import com.qti.extphone.QtiImeiInfo;
+import com.qti.extphone.QtiPersoUnlockStatus;
 import com.qti.extphone.QtiSetNetworkSelectionMode;
 import com.qti.extphone.QtiSimType;
 import com.qti.extphone.Token;
@@ -616,4 +617,12 @@
      * Response function is IExtPhoneCallback#setDualDataUserPreferenceResponse().
      */
     Token setDualDataUserPreference(in Client client, in boolean enable);
+
+    /**
+     * Query the SIM Perso unlock Status
+     *
+     * @param - slotId slot ID
+     * @return - persoUnlockStatus which can be generally temporary or permanent.
+     */
+    QtiPersoUnlockStatus getSimPersoUnlockStatus(int slotId);
 }
diff --git a/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
index 751bffc..5434618 100644
--- a/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
+++ b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
@@ -48,6 +48,7 @@
 import com.qti.extphone.QosParametersResult;
 import com.qti.extphone.QtiCallForwardInfo;
 import com.qti.extphone.QtiImeiInfo;
+import com.qti.extphone.QtiPersoUnlockStatus;
 import com.qti.extphone.SignalStrength;
 import com.qti.extphone.QtiSimType;
 import com.qti.extphone.SmsResult;
@@ -395,4 +396,12 @@
      * @param rec <DualDataRecommendation> to allow/disallow internet pdn on nDDS.
      */
     void onDualDataRecommendation(in DualDataRecommendation rec);
+
+    /**
+     * Indication received when persoSubState is unlocked either temporarily or permanently
+     *
+     * @param - slotId on which the persoSubState changed
+     * @param - persoUnlockStatus which can be generally temporary or permanent.
+     */
+    void onSimPersoUnlockStatusChange(int slotId, in QtiPersoUnlockStatus persoUnlockStatus);
 }
diff --git a/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.aidl b/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.aidl
new file mode 100644
index 0000000..bfad957
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.aidl
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
+package com.qti.extphone;
+
+parcelable QtiPersoUnlockStatus;
\ No newline at end of file
diff --git a/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.java b/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.java
new file mode 100644
index 0000000..9d86524
--- /dev/null
+++ b/extphone/src/com/qti/extphone/QtiPersoUnlockStatus.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
+package com.qti.extphone;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class QtiPersoUnlockStatus implements Parcelable {
+    private static final String TAG = "QtiPersoUnlockStatus";
+
+    public static final int UNKNOWN = 0;
+    public static final int TEMPORARY_UNLOCKED  = 1;
+    public static final int PERMANENT_UNLOCKED  = 2;
+
+    private int mPersoUnlockStatus;
+
+    public QtiPersoUnlockStatus(int status) {
+        mPersoUnlockStatus = status;
+    }
+
+    public QtiPersoUnlockStatus(Parcel in) {
+        mPersoUnlockStatus = in.readInt();
+    }
+
+    public int get() {
+        return mPersoUnlockStatus;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        out.writeInt(mPersoUnlockStatus);
+    }
+
+    public static final Parcelable.Creator<QtiPersoUnlockStatus> CREATOR =
+            new Parcelable.Creator() {
+        public QtiPersoUnlockStatus createFromParcel(Parcel in) {
+            return new QtiPersoUnlockStatus(in);
+        }
+
+        public QtiPersoUnlockStatus[] newArray(int size) {
+            return new QtiPersoUnlockStatus[size];
+        }
+    };
+
+    @Override
+    public String toString() {
+        return TAG + ": " + get();
+    }
+}
