Is the telephony manager reliable and volatile (cdma)?

I want to know if I can rely on telephony values ​​such as country, MCC, etc. on Android for my application. Can I change them in perspective using setprop? I tried changing using setprop, it did not work. In my opinion, a telephony manager is a class / interface that represents a configuration of GSM or CDMA equipment. In the case of GSM it can be sim, and in the case of CDMA it can be hardware. My questions:

  • Who updates these values ​​in both cases for the first time?
  • Are these OS values ​​read-only?
  • What if the user moves to another country or zone, some of the values, such as country code and MCC values, are updated automatically?
  • Can I reset these values?

I am not going to change any of these values, but I want to understand its work! I would appreciate it if someone could help me with this.

+3
source share
3 answers

@Bo The way CDMA works is different from GSM. CDMA always has one home base and many places for visitors. and you can always find out about the visitor user using the methods of TelephonyManager, which is considered invalid for CDMA.

+1
source

According to android documentation

Provides access to information about telephony services on the device. Applications can use the methods of this class to determine telephony and status, as well as to access certain types of subscriber information. Applications can also register a listener to be notified of telephony status changes.

TelephonyManager is used to read phone information. Regarding your question about the MCC and MNC codes: yes, they will change when the phone is in another country. You can subscribe to receive these events and define this user now in different countries.

+2
source

I decided to add it as an answer ...

I found a way to solve this problem on a CDMA phone. If it is a CDMA phone, then the phone always has ICC equipment comparable to SIM cards in GSM. All you have to do is use the system properties related to the hardware. Programmatically, you can use Java reflection to obtain this information. This is not changeable, even the system is rooted unlike a GSM device. Class c = Class.forName ("android.os.SystemProperties"); Method get = c.getMethod ("get", String.class); String homeOperator = ((String) get.invoke (c, "ro.cdma.home.operator.numeric"));

0
source

Source: https://habr.com/ru/post/1396746/


All Articles