diff options
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 15 |
1 files changed, 6 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) { } } } |