Query regarding TelephonyManager Methods

54 views
Skip to first unread message

Anees

unread,
Jun 2, 2011, 8:52:21 AM6/2/11
to android-platform
Hello experts,

For the past few days, I have been trying to figure out as to how
different methods inside TelephonyManager class fetch the data.

I referred the method getNetworkOperator() implementation in
TelephonyManager whichis as follows.

public String getNetworkOperator() {
return
SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_NUMERIC);
}


"SystemProperties.get(....)" from TelephonyManager leads me to the
following implementation inside SystemProperties

public static String get(String key) {
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " +
PROP_NAME_MAX);
}
return native_get(key);
}



"native_get(key)" has following declaration:

native_get(key)

Further down native_get(key) in the android open source code, I am not
able to check and it is not exposed I presume.


I would be obliged, if anyone could kindly let me know further down,
how this data is fetched from the SIM and which classes/method I
should refer, so that, I can clearly see, from where and how, the
NetworkOperator details are fetched.

I have been referring the code for days and still I could not find out
how the network operator detail is being fetched in android AOSP.

Any help in this regard would be well appreciated.

Best Regards,
Anees

Hungry Squid

unread,
Jun 2, 2011, 10:03:52 AM6/2/11
to android-...@googlegroups.com
Hi,

The TelephonyProperties.PROPERTY_OPERATOR_NUMERIC is stored as a system property, as suggested.

If you do a reference search on it, you will find in GsmServiceStateTracker.java, in pollStateDone() method, that there is this line

       phone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_NUMERIC, operatorNumeric);

Similarly for CDMA.

Good luck


Anees

unread,
Jun 2, 2011, 2:16:47 PM6/2/11
to android-platform

Hi Rokeyge,

Thanks for your reply, but unfortunately, it does not clarify my
doubt.

To be more specific, I need to know the very root functionality/method/
class which fetches the different attributes associated with a SIM
card.

For eg;

getDeviceId() - Returns the unique device ID, for example, the IMEI
for GSM
getNetworkOperator() - Returns the numeric name (MCC+MNC) of current
registered operator.

Where does these data reside and which are the classes/methods in AOSP
that fetches these data from the location in which it resides. I
searched a lot inside the AOSP, but all my efforts were in vain.

Any help is much appreciated.

Regards,
Anees

Anees

unread,
Jun 2, 2011, 2:24:16 PM6/2/11
to android-platform
Hi Rokeyge,

Thanks for your help. But unfortunately, it does not clarify my query.

To make things more clear, I need to know, the classes/methods which
fetches the various attributes which are related to a SIM.

For eg;
getDeviceId() - Returns the unique device ID, for example, the IMEI
for GSM.
getNetworkOperator() - Returns the numeric name (MCC+MNC) of current
registered operator.

I am quite sure these are the attributes which will vary on a case to
case basis and there would be some specific methods/classes which
would fetch these information from where it is stored.

I searched a lot in the AOSP to find the classes/methods which does
this, but my efforts were in vain.

Any help in this regard is much appreciated.

Kind Regards,
Anees
Reply all
Reply to author
Forward
0 new messages