summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorStuart Scott <stuartscott@google.com>2015-04-02 18:00:02 -0700
committerStuart Scott <stuartscott@google.com>2015-04-20 10:52:35 -0700
commitf1fb39763d87dabe254b6ed64ac8f20145035bc0 (patch)
tree72547ce7ccccfb5c242c6a5fbce3adf9ba401bf9 /telephony/java/android
parent19f1faa376c08edbd2c7e19ad33107e1b9520777 (diff)
downloadframeworks_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/android')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java15
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) {
}
}
}