Merge "Add TelephonyManager#rebootModem API to substitute TelephonyManager#rebootRadio."
This commit is contained in:
committed by
Android (Google) Code Review
commit
e428e5f97e
@@ -43310,6 +43310,7 @@ package android.telephony {
|
||||
method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
|
||||
method public boolean isWorldPhone();
|
||||
method @Deprecated public void listen(android.telephony.PhoneStateListener, int);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void rebootModem();
|
||||
method public void registerTelephonyCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyCallback);
|
||||
method public void registerTelephonyCallback(boolean, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyCallback);
|
||||
method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestCellInfoUpdate(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
|
||||
|
||||
@@ -13256,7 +13256,7 @@ package android.telephony {
|
||||
method public boolean needsOtaServiceProvisioning();
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
|
||||
method @RequiresPermission(android.Manifest.permission.REBOOT) public int prepareForUnattendedReboot();
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
|
||||
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void removeCarrierPrivilegesListener(@NonNull android.telephony.TelephonyManager.CarrierPrivilegesListener);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void reportDefaultNetworkStatus(boolean);
|
||||
method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
|
||||
|
||||
@@ -7639,7 +7639,7 @@ public class TelephonyManager {
|
||||
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
|
||||
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
|
||||
*
|
||||
* TODO: remove this one. use {@link #rebootRadio()} for reset type 1 and
|
||||
* TODO: remove this one. use {@link #rebootModem()} for reset type 1 and
|
||||
* {@link #resetRadioConfig()} for reset type 3
|
||||
*
|
||||
* @param resetType reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV reset
|
||||
@@ -7706,6 +7706,8 @@ public class TelephonyManager {
|
||||
*
|
||||
* @return {@code true} on success; {@code false} on any failure.
|
||||
*
|
||||
* @deprecated Using {@link #rebootModem()} instead.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
|
||||
@@ -7725,6 +7727,30 @@ public class TelephonyManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a radio modem reset. Used for device configuration by some carriers.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
|
||||
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
|
||||
* @throws IllegalStateException if the Telephony process is not currently available.
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
|
||||
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS)
|
||||
public void rebootModem() {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony == null) {
|
||||
throw new IllegalStateException("telephony service is null.");
|
||||
}
|
||||
telephony.rebootModem(getSlotIndex());
|
||||
} catch (RemoteException ex) {
|
||||
Rlog.e(TAG, "rebootRadio RemoteException", ex);
|
||||
throw ex.rethrowAsRuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an appropriate subscription ID for any situation.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user