method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @WorkerThread public android.os.PersistableBundle getCarrierConfig();
method public int getCarrierIdFromSimMccMnc();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void getCarrierRestrictionStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.telephony.CellLocation getCellLocation();
method public int getDataActivity();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_BASIC_PHONE_STATE}) public int getDataNetworkType();
@@ -13161,6 +13161,81 @@ public class TelephonyManager {
return null;
}
/**
* Carrier restriction status value is unknown, in case modem did not provide any
* information about carrier restriction status.
*/
public static final int CARRIER_RESTRICTION_STATUS_UNKNOWN = 0;
/** The device is not restricted to a carrier */
public static final int CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED = 1;
/** The device is restricted to a carrier. */
public static final int CARRIER_RESTRICTION_STATUS_RESTRICTED = 2;
/** The device is restricted to the carrier of the calling application. */
public static final int CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER = 3;
/** @hide */
@IntDef(prefix = {"CARRIER_RESTRICTION_STATUS_"}, value = {
CARRIER_RESTRICTION_STATUS_UNKNOWN,
CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED,
CARRIER_RESTRICTION_STATUS_RESTRICTED,
CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER
})
public @interface CarrierRestrictionStatus {
}
/**
* Get the carrier restriction status of the device.
* <p>To fetch the carrier restriction status of the device the calling application needs to be
* allowlisted to Android at <a href="https://android.googlesource.com/platform/packages/services/Telephony/+/master/assets/CarrierRestrictionOperatorDetails.json">here</a>.
* The calling application also needs the READ_PHONE_STATE permission.
* The return value of the API is as follows.
* <ul>
* <li>return {@link #CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER} if the caller
* and the device locked by the network are same</li>
* <li>return {@link #CARRIER_RESTRICTION_STATUS_RESTRICTED} if the caller and the
* device locked by the network are different</li>
* <li>return {@link #CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED} if the device is
* not locked</li>
* <li>return {@link #CARRIER_RESTRICTION_STATUS_UNKNOWN} if the device locking
* state is unavailable or radio does not supports the feature</li>
* </ul>
*
* @param executor The executor on which the result listener will be called.
* @param resultListener {@link Consumer} that will be called with the result fetched
* from the radio of type {@link CarrierRestrictionStatus}
* @throws SecurityException if the caller does not have the required permission/privileges or