Add telephonyFactoryReset in TelephonyManagerFacade.
Test: run test in the lab
Bug: None
Change-Id: Ie11607e4a2ee042a1fe61773c593fac243b74439
diff --git a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java b/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
index 3da8e10..059dfcb 100644
--- a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
+++ b/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
@@ -115,6 +115,19 @@
mSubscriptionManager = SubscriptionManager.from(mService);
}
+ /**
+ * Reset TelephonyManager settings to factory default.
+ * @param subId the subriber id to be reset, use default id if not provided.
+ */
+ @Rpc(description = "Resets TelephonyManager settings to factory default.")
+ public void telephonyFactoryReset(
+ @RpcOptional @RpcParameter(name = "subId") Integer subId) {
+ if (subId == null) {
+ subId = SubscriptionManager.getDefaultVoiceSubscriptionId();
+ }
+ mTelephonyManager.factoryReset(subId);
+ }
+
@Rpc(description = "Set network preference.")
public boolean telephonySetPreferredNetworkTypes(
@RpcParameter(name = "nwPreference") String nwPreference) {