diff options
Diffstat (limited to 'telephony/java')
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 15 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7c68de2..6d763e7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -4550,15 +4550,12 @@ public class TelephonyManager { * @hide */ public void factoryReset(int subId) { - if (SubscriptionManager.isUsableSubIdValue(subId)) { - // Enable data - setDataEnabled(subId, true); - // Set network selection mode to automatic - setNetworkSelectionModeAutomatic(subId); - // Set preferred mobile network type to the best available - setPreferredNetworkType(subId, RILConstants.PREFERRED_NETWORK_MODE); - // Turn off roaming - SubscriptionManager.from(mContext).setDataRoaming(0, subId); + try { + Log.d(TAG, "factoryReset: subId=" + subId); + ITelephony telephony = getITelephony(); + if (telephony != null) + telephony.factoryReset(subId); + } catch (RemoteException e) { } } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 0b77c26..73f38da 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -942,4 +942,6 @@ interface ITelephony { * Returns the subscription ID associated with the specified PhoneAccount. */ int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); + + void factoryReset(int subId); } |
