How can I check SIM card lock at Android application level

I am looking for a way to find out if an Android Android device is locked or not. I know that in the file / efs / there must be a file in which this parameter is stored. The problem is that without root there is no access to / efs /.

USSD codes, such as ## 7465625 #, no longer work for Android 4.1.2 on Samsung devices.

Does anyone know how I can find out if SIM card lock is on?

Thanks Tom

+5
source share
1 answer

Assuming we are talking about the same Sim Lock, you can check the SIM card lock and many other things using Telephony Manager.

TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

int simState = telephonyManager.getSimState();

if (simState == TelephonyManager.SIM_STATE_NETWORK_LOCKED) {
    //do something
}
0
source

All Articles