Move factoryReset to service and protect.
bug:16161518 Change-Id: I02d1bbae1887c62ee426e6f03e8bc1f18c6666bf
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -942,4 +942,6 @@ interface ITelephony {
|
||||
* Returns the subscription ID associated with the specified PhoneAccount.
|
||||
*/
|
||||
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
|
||||
|
||||
void factoryReset(int subId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user