diff options
author | Stuart Scott <stuartscott@google.com> | 2015-04-02 18:00:02 -0700 |
---|---|---|
committer | Stuart Scott <stuartscott@google.com> | 2015-04-20 10:52:35 -0700 |
commit | f1fb39763d87dabe254b6ed64ac8f20145035bc0 (patch) | |
tree | 72547ce7ccccfb5c242c6a5fbce3adf9ba401bf9 /telephony/java | |
parent | 19f1faa376c08edbd2c7e19ad33107e1b9520777 (diff) | |
download | frameworks_base-f1fb39763d87dabe254b6ed64ac8f20145035bc0.zip frameworks_base-f1fb39763d87dabe254b6ed64ac8f20145035bc0.tar.gz frameworks_base-f1fb39763d87dabe254b6ed64ac8f20145035bc0.tar.bz2 |
Move factoryReset to service and protect.
bug:16161518
Change-Id: I02d1bbae1887c62ee426e6f03e8bc1f18c6666bf
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); } |